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

fix(utd_hook): Fix regression causing retry to report false late decrypt #4252

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions crates/matrix-sdk-ui/src/timeline/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1064,16 +1064,22 @@ impl<P: RoomDataProvider> TimelineController<P> {

match decryptor.decrypt_event_impl(original_json).await {
Ok(event) => {
trace!(
"Successfully decrypted event that previously failed to decrypt"
);

// Notify observers that we managed to eventually decrypt an event.
if let Some(hook) = unable_to_decrypt_hook {
hook.on_late_decrypt(&remote_event.event_id, *utd_cause).await;
if let matrix_sdk::deserialized_responses::TimelineEventKind::UnableToDecrypt { utd_info, ..} = event.kind {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use use, not the fully qualified name here

info!("Failed to decrypt event after receiving room key: {:?}", utd_info.reason);
None
} else {
trace!(
kind = ?event.kind,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably a bit verbose?

Copy link
Member Author

@BillCarsonFr BillCarsonFr Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changed by this PR. Any other reason to remove it? is it spamming the RS?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contains most of the event's data that's not privacy-sensitive, so it will be spammy. This line can be reached multiple times for each undecrypted event that failed to re-decrypt again, so it will be super spammy, please remove it.

"Successfully decrypted event that previously failed to decrypt"
);

// Notify observers that we managed to eventually decrypt an event.
if let Some(hook) = unable_to_decrypt_hook {
hook.on_late_decrypt(&remote_event.event_id, *utd_cause).await;
}

Some(event)
}

Some(event)
}
Err(e) => {
info!("Failed to decrypt event after receiving room key: {e}");
Expand Down
Loading