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

timeline: use a TimelineEventItemId for reacting to something #4127

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Oct 15, 2024

New preamble to #4111.

@bnjbvr bnjbvr requested a review from a team as a code owner October 15, 2024 13:56
@bnjbvr bnjbvr requested review from stefanceriu and removed request for a team October 15, 2024 13:56
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 84.58%. Comparing base (2eca727) to head (6c7b816).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk-ui/src/timeline/util.rs 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4127      +/-   ##
==========================================
- Coverage   84.68%   84.58%   -0.11%     
==========================================
  Files         269      269              
  Lines       28818    28812       -6     
==========================================
- Hits        24405    24370      -35     
- Misses       4413     4442      +29     

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

stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 16, 2024
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

Seems to be working well but I'm seeing some weird logs

2024-10-16T07:26:31.678706Z  INFO elementx: Toggling reaction 🔥 for event: eventId(eventId: "$AxqLT7Nc04dpRe80RUQJilCeNjS6GFTXIvW8IGVmG20") | TimelineProxy.swift:430 | spans: root

2024-10-16T07:26:31.679124Z  INFO elementx: Finished toggling reaction for event: eventId(eventId: "$AxqLT7Nc04dpRe80RUQJilCeNjS6GFTXIvW8IGVmG20") | TimelineProxy.swift:434 | spans: root

2024-10-16T07:26:31.679613Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:55 | spans: root > send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8, V1_9, V1_10, V1_11] config=RequestConfig { timeout: 30s, retry_limit: 3 } request_id="REQ-114" method=PUT uri="https://matrix-client.matrix.org/_matrix/client/v3/rooms/!POTexKBdzTfplmDWTc:matrix.org/send/m.reaction/04a110a49c3a49c5b2e632a9e1c543ba" request_size="115 B"}

2024-10-16T07:26:31.681012Z ERROR matrix_sdk_ui::timeline::event_handler: Adding local reaction echo to event absent from the timeline | crates/matrix-sdk-ui/src/timeline/event_handler.rs:703 | spans: local_echo_handler{room_id="!POTexKBdzTfplmDWTc:matrix.org"} > handle_local_event > handle_local_event > handle_event{txn_id="04a110a49c3a49c5b2e632a9e1c543ba"} > handle_reaction{relates_to_event_id="$AxqLT7Nc04dpRe80RUQJilCeNjS6GFTXIvW8IGVmG20"}

L.E. those warnings were coming from a second instance of the timeline, the pinnned messages one. Handled here #4138

Changelog: `Timeline::toggle_reaction` now identifies the item that's
reacted to with a `TimelineEventItemId`.
I suppose these were useful at the FFI layer at some point, but they
aren't anymore, so they could be removed.

Changelog: Got rid of `From<String/&str>` for `TimelineEventItemId`.
This would not report the `txn_id` field because of the `skip_all`. It's
actually interesting to also get the error, so I'm only skipping self
from now on.
@bnjbvr bnjbvr force-pushed the bnjbvr/react-with-timeline-item-id branch from 57437e4 to 6c7b816 Compare October 16, 2024 12:48
@bnjbvr bnjbvr enabled auto-merge (rebase) October 16, 2024 12:49
@bnjbvr bnjbvr merged commit 30f3a3c into main Oct 16, 2024
39 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/react-with-timeline-item-id branch October 16, 2024 13:03
stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 16, 2024
stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 16, 2024
* Adopt new reaction toggling API introduced in matrix-org/matrix-rust-sdk/pull/4127

* Adopt the changes introduced in matrix-org/matrix-rust-sdk/pull/4111: use the new `TimelineUniqueId` type instead of `String` for unique timeline identifiers.

* Bump the RustSDK to v1.0.58.

* Fix unit tests
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.

3 participants