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

ui: Redact replied-to event inside in_reply_to in timeline #2307

Merged
merged 4 commits into from
Jul 25, 2023

Conversation

jplatte
Copy link
Collaborator

@jplatte jplatte commented Jul 19, 2023

… and more in-reply-to / redaction improvements.

Ready for testing in EX, needs one or two tests before merging.

@jplatte jplatte requested a review from a team as a code owner July 19, 2023 16:30
@jplatte jplatte requested review from poljar and removed request for a team July 19, 2023 16:30
@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Patch coverage: 53.21% and project coverage change: -0.51% ⚠️

Comparison is base (0a361ef) 77.26% compared to head (1c8017a) 76.75%.

❗ Current head 1c8017a differs from pull request most recent head d8631a4. Consider uploading reports for the commit d8631a4 to get more accurate results

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     
Files Changed Coverage Δ
...s/matrix-sdk-ui/src/timeline/event_item/content.rs 54.12% <30.30%> (-7.49%) ⬇️
crates/matrix-sdk-ui/src/timeline/inner.rs 74.59% <69.23%> (+1.34%) ⬆️
...rates/matrix-sdk-ui/src/timeline/event_item/mod.rs 73.64% <88.88%> (+1.14%) ⬆️
crates/matrix-sdk-ui/src/timeline/event_handler.rs 78.14% <100.00%> (+0.50%) ⬆️
crates/matrix-sdk-ui/src/timeline/traits.rs 53.19% <100.00%> (+4.35%) ⬆️

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jplatte
Copy link
Collaborator Author

jplatte commented Jul 20, 2023

Tests have been written, this is ready for review now.

@jplatte jplatte requested review from bnjbvr and removed request for poljar July 21, 2023 11:30
crates/matrix-sdk-ui/src/timeline/tests/redaction.rs Outdated Show resolved Hide resolved
@@ -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 },
Copy link
Member

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).

Copy link
Collaborator Author

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.

Copy link
Member

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.

@jplatte jplatte enabled auto-merge (rebase) July 25, 2023 13:21
@jplatte jplatte merged commit 04aac7b into main Jul 25, 2023
38 checks passed
@jplatte jplatte deleted the jplatte/redact-replied-to branch July 25, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants