-
Notifications
You must be signed in to change notification settings - Fork 246
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(timeline): update responses after a UTD has been decrypted #4210
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,17 +91,17 @@ async fn test_redact_replied_to_event() { | |
|
||
timeline.handle_live_event(f.redaction(first_item.event_id().unwrap()).sender(&ALICE)).await; | ||
|
||
let first_item_again = | ||
assert_next_matches!(stream, VectorDiff::Set { index: 0, value } => value); | ||
assert_matches!(first_item_again.content(), TimelineItemContent::RedactedMessage); | ||
assert_matches!(first_item_again.original_json(), None); | ||
|
||
let second_item_again = | ||
assert_next_matches!(stream, VectorDiff::Set { index: 1, value } => value); | ||
let message = second_item_again.content().as_message().unwrap(); | ||
let in_reply_to = message.in_reply_to().unwrap(); | ||
assert_let!(TimelineDetails::Ready(replied_to_event) = &in_reply_to.event); | ||
assert_matches!(replied_to_event.content(), TimelineItemContent::RedactedMessage); | ||
|
||
let first_item_again = | ||
assert_next_matches!(stream, VectorDiff::Set { index: 0, value } => value); | ||
assert_matches!(first_item_again.content(), TimelineItemContent::RedactedMessage); | ||
assert_matches!(first_item_again.original_json(), None); | ||
Comment on lines
+100
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of the assertion is changed here, because now we update the responses before the original event. This avoids a copy in the timeline code 👀 . You would be right calling this a code smell and asking for a change here, as I didn't bother too much (observers wouldn't notice a big difference). |
||
} | ||
|
||
#[async_test] | ||
|
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.
Not really part of this PR but, oh boy, I feel like this could express that this is an UTD -> Decrypted transition a bit better.
Flow::Remote
is generally for remote echoes andTimlineItemPosition::Update
does not sound UTD specific at all.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.
Good idea to rename this
Update
; will do in a follow-up, thanks!