!ovGZXReQuDFezAaAfr:matrix.org

Beyond Chat

289 Members
Matrix-native projects beyond chat: collaborative documents, blogs, generic KV databases, tools for thought, etc.126 Servers

Load older messages


SenderMessageTime
21 Nov 2022
@axon:neuron.computeraxonbut you're not currently leveraging it, at least in the code you showed above?23:13:07
@meri:radical.directorymeriYeah not yet23:13:20
@axon:neuron.computeraxon(thank you by the way! This is super helpful. It's been a bit daunting figuring this out on my own, maybe we can keep comparing notes and help eachother :) )23:14:26
@axon:neuron.computeraxontrying your login method now to see what it returns23:14:46
@meri:radical.directorymeriNo worries :) Happy for DMs as well. I’m just figuring this out as well23:15:02
@axon:neuron.computeraxonAre you doing encryption?23:15:52
@axon:neuron.computeraxonI can't figure out how to recieve encrypted messages, but I can send them23:16:02
@axon:neuron.computeraxon Okay, login like you did above does return access + refresh tokens, like you said. Calling getAccessToken right after that results in the same access token 23:18:04
@meri:radical.directorymeriI want to do encryption but haven’t started that yet23:18:33
@axon:neuron.computeraxonthe tokens look pretty short, not JWTs, so I doubt they encode expiration periods within themselves, there may be an endpoint to return that, or it may just be set time limits that are in the spec idk23:19:10
@axon:neuron.computeraxon
In reply to @meri:radical.directory
I want to do encryption but haven’t started that yet
I had some serious issues with it, though I'm using Vite for building a react app and there were some compatibility issues
23:19:35
@axon:neuron.computeraxonare you going to run your project in the browser, or in Node?23:19:43
@meri:radical.directorymeriIn the browser, I’m using next js. I tried using Svelte but using the sdk with Vite was such a pain and I gave up23:20:21
@axon:neuron.computeraxon it took a ton of time to figure out, but the end result wasn't bad. had to install events from npm, and had to set up a global variable (named "global") and attach some stuff to it 23:22:22
@axon:neuron.computeraxon
global = {
        window: window,
        fetch: fetch.bind(window),
        Olm: window.Olm,
        localStorage: window.localStorage
      };
23:22:37
@axon:neuron.computeraxonplanning to make an issue on the SDK about Vite support so other people with vite can report any problems they have and it can be tracked successfully23:23:12
@axon:neuron.computeraxonthis is my first time using vite lol23:23:17
@meri:radical.directorymeriThat would be great to make an issue! Yeah I’m super new to it too23:23:42
@axon:neuron.computeraxon to other people in this room who have done encryption with the SDK before: How do I make it so that I request and fetch keys when people send me encrypted messages? Getting DecryptionError[msg: The sender's device has not sent us the keys for this message. right now. 23:24:39
@axon:neuron.computeraxon
In reply to @meri:radical.directory
That would be great to make an issue! Yeah I’m super new to it too

I like it, but I really don't like dev not failing when there's a typescript compilation error. I found a vite plugin that fixes that: https://github.com/fi3ework/vite-plugin-checker

However, the plugin is buggy. If I have a syntax error (vs just typescript error), it doesn't recover from that and I have to refresh the browser. Once that kink is figured out, this'll be really great, and I'm curious if it works for you as it.

23:26:03
@axon:neuron.computeraxon
In reply to @meri:radical.directory
That would be great to make an issue! Yeah I’m super new to it too
*

I like it, but I really don't like dev not failing when there's a typescript compilation error. I found a vite plugin that fixes that: https://github.com/fi3ework/vite-plugin-checker

However, the plugin is buggy. If I have a syntax error (vs just typescript error), it doesn't recover from that and I have to refresh the browser. Once that kink is figured out, this'll be really great, and I'm curious if it works for you as is.

23:26:06
@axon:neuron.computeraxon * to other people in this room who have done encryption with the SDK before: How do I make it so that I request and fetch keys when people send me encrypted messages? Getting DecryptionError[msg: The sender's device has not sent us the keys for this message. right now. 23:26:20
@meri:radical.directorymeriI wonder if you could just run a separate terminal simultaneously with something like tsc —watch? Like maybe there is a flag to make it just do type checking and no compiling23:28:48
@axon:neuron.computeraxon
In reply to @meri:radical.directory
I wonder if you could just run a separate terminal simultaneously with something like tsc —watch? Like maybe there is a flag to make it just do type checking and no compiling
no_emit or something stops it from emiting JS. And yeah, that would be an approach, but I think this plugin is much better-- it creates a really slick looking overlay on the site, that you can collapse into just a warning and still work with the site if you want. Apparently it uses worker threads to compile in the background
23:31:33
@meri:radical.directorymeri Nice 😊 23:32:03
22 Nov 2022
@axon:neuron.computeraxonIs there a simple endpoint I can hit to see if my access token is expired?00:00:18
@axon:neuron.computeraxon It looks like isLoggedIn() resolves to true, even with a bad access token, until some later things fail with a 401 00:00:59
@axon:neuron.computeraxonis there some sort of echo auth endpoint?00:01:11
@axon:neuron.computeraxon

huh. It's react-sdk is doing some weird stuff here. Storing the access key encrypted..?

let decryptedAccessToken = accessToken;
        const pickleKey = await PlatformPeg.get().getPickleKey(userId, deviceId);
        if (pickleKey) {
            logger.log("Got pickle key");
            if (typeof accessToken !== "string") {
                const encrKey = await pickleKeyToAesKey(pickleKey);
                decryptedAccessToken = await decryptAES(accessToken, encrKey, "access_token");
                encrKey.fill(0);
            }
        } else {
            logger.log("No pickle key available");
        }
00:04:37
@farribeiro:matrix.orgfarribeiro left the room.00:06:01

Show newer messages


Back to Room List