-
Notifications
You must be signed in to change notification settings - Fork 274
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
fix(crypto): Redecrypt non-UTD messages to remove no-longer-relevant warning shields #4644
Conversation
9a19fcf
to
9cbfbfb
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4644 +/- ##
==========================================
+ Coverage 86.34% 86.36% +0.01%
==========================================
Files 291 291
Lines 34233 34283 +50
==========================================
+ Hits 29559 29607 +48
- Misses 4674 4676 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d83e187
to
414f03d
Compare
I swapped the Rust team reviewer to @bnjbvr since I know he has questions about including session ID in the timeline item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems generally good to me. A few comments.
crates/matrix-sdk-ui/src/timeline/controller/state_transaction.rs
Outdated
Show resolved
Hide resolved
This is ready for re-review. I think I would recommend looking at the full diff now, since the review changes reverted some of what I did in earlier commits. I will rebase into nice commits after review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few stylistic change requests below. On the one hand, thanks for not storing any extra data in the TimelineItemContent
itself, on the other… you know my opinion about adding more code to the timeline re-decryption. This all should be moved somewhere else, and tested in isolation there (could be in the crypto crate, the main SDK crate, inside or outside the event cache,… any place other than the timeline would make more sense).
crates/matrix-sdk-ui/src/timeline/controller/state_transaction.rs
Outdated
Show resolved
Hide resolved
Co-authored-by: Benjamin Bouvier <benjamin@bouvier.cc> Signed-off-by: Andy Balaam <mail@artificialworlds.net>
Co-authored-by: Benjamin Bouvier <benjamin@bouvier.cc> Signed-off-by: Andy Balaam <mail@artificialworlds.net>
Co-authored-by: Benjamin Bouvier <benjamin@bouvier.cc> Signed-off-by: Andy Balaam <mail@artificialworlds.net>
…ecure_device_if_it_is_secure
It's unusual to have the method on the parent type when the field type could also hold the method. In fact, this was the only bool getter inspecting the timeline's content, so let's move the method next to as its siblings, for consistency, and let's spell it out fully for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving, i'll address my own comments as a separate commit and will squash-merge it altogether.
crates/matrix-sdk-ui/src/timeline/controller/decryption_retry_task.rs
Outdated
Show resolved
Hide resolved
crates/matrix-sdk-ui/src/timeline/controller/decryption_retry_task.rs
Outdated
Show resolved
Hide resolved
crates/matrix-sdk-ui/src/timeline/controller/decryption_retry_task.rs
Outdated
Show resolved
Hide resolved
/// Create a replacement TimelineItem for the supplied one, with new | ||
/// [`EncryptionInfo`] from the supplied `room_data_provider`. Returns None if | ||
/// the supplied item is not a remote event, or if it doesn't have a session ID. | ||
async fn replacement_for<P: RoomDataProvider>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, let's name it make_replacement_for
.
Fixes element-hq/element-meta#2697
Fixes https://github.com/element-hq/crypto-internal/issues/398
I'm sorry it's a big change. I've tried to break it into decent commits, and I did a couple of preparatory PRs to make it less painful, but it's still a bit to get your head around.
The basic idea is that when a session is updated and we call
retry_event_decryption
, we don't only look at UTDs any more - now we also look at decrypted events, and re-request theirEncryptionInfo
, in case it has improved.