Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Order of PreKey and Encrypted message #10

Open
EbnerAndreas opened this issue Mar 8, 2019 · 0 comments
Open

Order of PreKey and Encrypted message #10

EbnerAndreas opened this issue Mar 8, 2019 · 0 comments

Comments

@EbnerAndreas
Copy link
Contributor

The partner sends us the prekey and the m.room.enrypted message of the first room message almost at the same time.
The sync() reads both events in one HTTP response and puts both into the corresponding event loops.
Due to the fact that we have an asynchronous behavior it can happen that we are trying to decrypt the message before the prekey message is handled. Therefore, at the moment, we have this workaround:

        if not meg_ses:
            await asyncio.sleep(5)
            meg_ses = self.room_keys.get((message[1], sender_device_id, session_id))

Maybe a better solution can be found to synchronize the events.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant