Closed zhaytee closed 5 years ago
I just tried this with a completely fresh instance of synapse (new accounts and rooms), and the result was still the same. 😭
Sorry, I left out one critical piece of information: I'm not using the SDK in a browser, I'm using it via nodejs.
I suspect the issue is related to session store persistence. I'm using a module called node-local-storage to emulate browser local storage, which seems to be working fine on its own, but I notice that the matrix sdk doesn't seem to actually be saving anything to the store. 🧐
Possibly related: #437
You could take a look at the js half of github.com/matrix-org/matrix-search as that successfully uses e2e via this sdk in node js.
Area around https://github.com/matrix-org/matrix-search/blob/master/js_fetcher/index.ts#L66 looks relevant. (i too had many issues running e2e in node at the time)
Thanks for pointing me to those examples, @t3chguy ! I was able to determine that the cause of my issues were indeed related to the availability of a working LocalStorage implementation, and making sure that it's present in all the spots it needs to be.
In case anyone else happens upon this issue: feel free to take a look at the source to my project which initially caused me to open this issue in the first place. It's an example of a working nodejs Matrix client coded against matrix-js-sdk (including end-to-end encryption and all).
https://github.com/zhaytee/matrix-rpc-js
Closing this for now!
Just a follow-up on this. First, thanks for the great samples and examples @t3chguy and @zhaytee . Very helpful.
I am building a crypto-enabled Matrix chatbot here: https://github.com/guardianproject/ractive/blob/master/bot.js
It currently works sans-crypto, but when I enable it, I can't decrypt any messages, and the client exits.
Any thoughts, insights, something I missed? Thanks!
Getting saved sync token... Getting push rules... Got saved sync token Getting saved sync... Got reply from saved sync, exists? false RIVEBOT succesfully loaded directory Got push rules Checking lazy load status... Checking whether lazy loading has changed in store... Storing client options... Stored client options Getting filter... Sending first sync request... Waiting for saved sync before starting sync processing... Starting sync request processing... Storing sync data... Sync data stored Processing sync response... Crypto: initialising roomlist... Starting sync request processing... Crypto: initialising crypto object... Crypto: initialising Olm... Crypto: initialising Olm device... Crypto: loading device list... Crypto: fetching own devices... Crypto: checking for key backup... Checking key backup status... Key backup is absent or missing required data No usable key backup: not enabling key backup Storing sync data... Sync data stored Processing sync response... Starting sync request processing... Storing sync data... Sync data stored Processing sync response... Starting sync request processing... Storing sync data... Sync data stored Processing sync response... enqueueing key request for ** Error decrypting event (id=***): DecryptionError[msg: The sender's device has not sent us the keys for this message., session: **** Decryption failure: [object Object] Starting sync request processing...
@n8fr8 I think it will be easier to discuss this in a separate issue. I have created #958 for that.
I am experiencing the same issue.
matrix-js-sdk: v8.5.0 synapse: v1.21.2
I am still trying to get e2ee running. In my scenario the users are using web clients (based on the JS SDK) only.
For instance, decrypting messages in a direct 1-to-1 conversation only works if both participants are online while sending/receiving encrypted messages. In case the receiver is offline while the sender is sending a message the below error is shown:
logger.js:50 Error decrypting event DecryptionError[msg: The sender's device has not sent us the keys for this message., session:
All keys are downloaded, secret storage as well as cross-signing are bootstrapped. All involved devices are getting verified.
Do I have to explicitly upload any keys when sending a message?
By the way, I gave up and switched to https://github.com/matrix-org/pantalaimon
My life is much better now :)
@n8fr8
I have implemented a JS client. So unfortunately I can't switch and have to know the "missing link" to solve the above issue.
In case the receiver is offline while the sender is sending a message the below error is shown:
logger.js:50 Error decrypting event DecryptionError[msg: The sender's device has not sent us the keys for this message., session:
Understood. I will keep at it here, in truth, and hopefully we can figure out what the missing link in the code or our understanding is.
If there's something here you'd like the core team to examine, please open a new issue with details of your use case.
@jryans
Many thanks for your reply.
I already filed the issue here ... https://github.com/matrix-org/synapse/issues/8624. The solution (device dehydration/rehydration) is obviously already in progress.
Hi folks, encountering an issue which may be similar to #731
Unencrypted rooms work perfectly fine with the sdk, but as soon as encryption is turned on, things stop working.
Encryption is, as far as I can tell, set up properly in my program. Olm 3.0.0 is being used with sdk 0.14.2, everything is being require()'d and initialized in the correct order, and the library never complains about crypto being unavailable or anything like that.
Below is some relevant logging output. Earlier in the log, device keys were coming in fine, but it seems that the sdk is not getting the room keys it's looking for? Not sure. Happy to provide more detail to assist in debugging this issue.
The homeserver being used is the latest synapse as of this writing.
Thank you!