Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support encryption #7

Closed
turt2live opened this issue Dec 16, 2018 · 6 comments · Fixed by #187
Closed

Support encryption #7

turt2live opened this issue Dec 16, 2018 · 6 comments · Fixed by #187
Labels
enhancement New feature or request type:client

Comments

@turt2live
Copy link
Owner

No description provided.

@turt2live turt2live added the enhancement New feature or request label Dec 16, 2018
@Half-Shot
Copy link
Contributor

This is solved by c91eb52 ?

@turt2live
Copy link
Owner Author

No? There's more to encryption than pantalaimon.

@n8fr8
Copy link

n8fr8 commented Aug 13, 2020

We've made encryption progress with matrix-js-sdk in our bot here:
https://github.com/guardianproject/ractive/blob/master/bot.js

@n8fr8
Copy link

n8fr8 commented Aug 13, 2020

that said, it has some issues... would love to get this integrated into your sdk, so we can move to using it and all improve this code together.

@DanH42
Copy link

DanH42 commented Feb 28, 2021

Could this limitation get some sort of mention in the readme, or anywhere else in the docs? I just spent over an hour trying to figure out why the echobot example wasn't working for me -- authentication and auto-joining go fine, but then the bot just doesn't receive any events whatsoever after that.

This is also an especially frustrating issue to troubleshoot when you don't know what's causing it: Turning the log level all the way up to TRACE made it clear that the library was getting something whenever I sent a message, but I added listeners for every type of event I could find in the docs and none of them ever fired. I'm not sure if there's anything else I could have done to get some sort of event or exception to let me know that a message the bot has received is encrypted and therefore can't be read, but that's probably something I'll want to be able to handle at some point.

The homeserver I'm using has E2E encryption enabled by default for private chats (which I believe is the out-of-the-box default for Synapse now), so I didn't even think about it until I found this issue. As soon as I added the bot to a new room with encryption disabled, everything started working as expected.

@n8fr8
Copy link

n8fr8 commented Mar 2, 2021

I realized something working with the new Android SDK2 and the JS SDK in a browser context... when it comes to encrypted messages, you really don't want to be handling incoming events with callbacks. It is better to query the timeline to get to your message backlog. In essence, the event callback should be thought of as a ping, and then you can check the synced timeline for messages you haven't processed yet in your bot, and see if you can decrypt them yet. At some point, once all the remote devices/keys are synced, you will be able to decrypt the message. Often, that can come after you receive the event for the encrypted message payload.

@turt2live turt2live mentioned this issue Dec 29, 2021
6 tasks
turt2live added a commit that referenced this issue Mar 28, 2023
Includes v0.6.4+patches (not yet released as v0.6.5 upstream)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request type:client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants