-
Notifications
You must be signed in to change notification settings - Fork 218
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
ui: Redact replied-to event inside in_reply_to in timeline #2307
Conversation
862c1b0
to
194e1ba
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2307 +/- ##
==========================================
- Coverage 77.26% 76.75% -0.51%
==========================================
Files 171 171
Lines 18207 18237 +30
==========================================
- Hits 14067 13998 -69
- Misses 4140 4239 +99
☔ View full report in Codecov by Sentry. |
194e1ba
to
b6240d0
Compare
Tests have been written, this is ready for review now. |
@@ -1042,7 +1042,7 @@ impl From<&matrix_sdk_ui::timeline::InReplyToDetails> for InReplyToDetails { | |||
pub enum RepliedToEventDetails { | |||
Unavailable, | |||
Pending, | |||
Ready { message: Arc<Message>, sender: String, sender_profile: ProfileDetails }, | |||
Ready { content: Arc<TimelineItemContent>, sender: String, sender_profile: ProfileDetails }, |
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.
Could we store some sort of id or index that uniquely and permanently references the actual item, that would allow to not duplicate the item in the timeline? Then we get rid of a whole range of state duplication bugs (like the one fixed by the first commit of that PR, IIUC).
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.
It sounds like you want more fine-grained reactivity? As long as the API consumer expects ObservableVector<Arc<TimelineItem>>
level updates for every affected timeline item, we'll fundamentally have to walk the list to find out which items need to be updated. Let's discuss this on Matrix.
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.
We chatted about this, and there might be a solution where we (at least internally) have some reactive mapping of timeline internal id -> timeline item. Without changing the external API, this would allow to avoid iterating over all the timeline items to propagate edits/redactions. But this would require something like an ObservableIndexMap
or similar, which doesn't exist yet. So let's take this PR in the meanwhile.
1c8017a
to
d8631a4
Compare
… and more in-reply-to / redaction improvements.
Ready for testing in EX, needs one or two tests before merging.