-
Notifications
You must be signed in to change notification settings - Fork 268
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
bindings/crypto-nodejs: first message sent by OlmMachine has wrong message index #802
Comments
Can you provide a minimal working example please? Or at least a source code where I can understand what's happening? Thanks. |
Let me chime in here, since I suspect I know what's going on. The step called It's only marking the member's devices to be tracked. Next time By the time the second message from the image has been received There are nowadays ways to wait for a Marking users as tracked should be done as part of the sync response processing. |
Actually looking at the sequence diagram a bit more, this step seems to be a bit misguided:
Processing If you reverse this step, first process Also, if you do end up calling |
but it also doesn't give enough information to mark those requests as sent, so the client ends up sending them out as part of the next There's very little documentation around when and how to call |
It does not give you enough information? What is missing? You need three things to mark a request as sent:
As for those requests ending up as part of
Only So the way other implementations use
You can bundle 4 and 5 into a method and call the bundle once or twice per sync. A couple more rules:
The same rule applies to If you have more questions like these please feel free to ask them, I'll try to update the relevant docs with this information. |
this part definitely wasn't clear :p I was seeing the requests show up in I'll rework my code to use the approach mentioned in your comment as best as I can and report back. For clarity: |
I think the Rust side has a
So the way device tracking works in Matrix land is that the server is supposed to give you the list of users you share encrypted rooms with which have new or changed devices. Synapse doesn't really respect the whole "users you share an encrypted room with", instead it seems to do so for any user you share a room with. It also doesn't give you any users in this list when you initially sync. To avoid fetching devices of users you don't care about, and to initially populate the list of devices you do care about, we'll need to tell the Rust side which users we are sharing an encrypted room with. This is what If you fail to mark users for tracking we won't have the list of devices for this user and the user won't in return receive any room keys. |
sorry, I'm still unclear with how I'm supposed to use |
having re-read your comment a few times though, it sounds like the client needs to keep track itself and somehow make it work. This is a bit harder for the bot-sdk, but not impossible. |
You need to inspect If the Once a user has been marked for tracking you don't need to mark it again, though if you do, it'll be a noop. Users who have their devices changed are passed to the Rust side with the In other words you only need to call this method with:
|
right, using the library correctly seems to fix it - thanks :) A worked example would cover a lot of the traps I fell into, I think. At least something to denote how to handle the combination of |
in a test to see if all the bits of encryption are working:
![image](https://user-images.githubusercontent.com/1190097/176547541-8b626ecc-03d1-4483-b05b-f8c0c64af8b0.png)
The sequence diagram for this would be the following (roughly). ExampleUser is a bot and TravisR is a human using Element Web.
The text was updated successfully, but these errors were encountered: