Skip to content

UTDs not retried when key arrives at almost the same time #4202

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

Open
Tracked by #245
andybalaam opened this issue Jan 27, 2025 · 6 comments
Open
Tracked by #245

UTDs not retried when key arrives at almost the same time #4202

andybalaam opened this issue Jan 27, 2025 · 6 comments
Labels
A-E2EE O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems X-Needs-Rust This issue needs a Rust SDK change. It must have a link to a Rust SDK issue

Comments

@andybalaam
Copy link
Member

andybalaam commented Jan 27, 2025

Steps to reproduce

See this rageshake: https://github.com/element-hq/element-x-android-rageshakes/issues/4076

The logs in the receiver side show a pattern like this:

2025-01-20T15:46:43.519041Z Failed to decrypt a room event
... (9 more Failed to decrypt)
2025-01-20T15:46:46.398276Z Failed to decrypt a room event
2025-01-20T15:46:46.407885Z Received a new megolm room key
2025-01-20T15:46:46.418528Z Failed to decrypt a room event
.. (2 more Failed to decrypt)

So the megolm key arrived at almost the same moment as the events.

There is no mention of "Retrying decryption" anywhere in the receiver logs.

I am wondering whether the async task pulling from room_keys_received_stream() might have retried decryption too early, before the incoming batch of events was finished processing?

@andybalaam
Copy link
Member Author

Could be caused by event cache work?

@andybalaam
Copy link
Member Author

@richvdh
Copy link
Member

richvdh commented Mar 19, 2025

I think matrix-org/matrix-rust-sdk#4715 rewrote a bunch of this logic, but unfortunately the retry task's logging is at debug, which doesn't seem to appear in the EXA logs.

@richvdh
Copy link
Member

richvdh commented Mar 19, 2025

Seems like this affects keys from backup as well as keys received from other devices

@richvdh
Copy link
Member

richvdh commented Mar 20, 2025

Hopefully this will be fixed by matrix-org/matrix-rust-sdk#3872

@jmartinesp jmartinesp added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Uncommon Most users are unlikely to come across this or unexpected workflow X-Needs-Rust This issue needs a Rust SDK change. It must have a link to a Rust SDK issue labels Mar 31, 2025
@andybalaam
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems X-Needs-Rust This issue needs a Rust SDK change. It must have a link to a Rust SDK issue
Projects
None yet
Development

No branches or pull requests

3 participants