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

feat(timeline): introduce the TimelineUniqueId #4111

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Oct 10, 2024

See commit by commit description.

Extracted from #4100.

@bnjbvr bnjbvr requested a review from a team as a code owner October 10, 2024 13:37
@bnjbvr bnjbvr requested review from stefanceriu and removed request for a team October 10, 2024 13:37
@bnjbvr bnjbvr force-pushed the bnjbvr/typed-timeline-unique-id branch from f0af335 to cf8b97b Compare October 10, 2024 13:43
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.72%. Comparing base (30f3a3c) to head (6f3d880).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4111      +/-   ##
==========================================
- Coverage   84.72%   84.72%   -0.01%     
==========================================
  Files         269      269              
  Lines       28779    28776       -3     
==========================================
- Hits        24384    24381       -3     
  Misses       4395     4395              

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

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.

This looks good to me. There's a bunch of changes we will need to make on the iOS side but I think it's about time, they're welcome.

crates/matrix-sdk-ui/src/timeline/controller/state.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-ui/src/timeline/controller/state.rs Outdated Show resolved Hide resolved
bindings/matrix-sdk-ffi/src/timeline/mod.rs Outdated Show resolved Hide resolved
@bnjbvr
Copy link
Member Author

bnjbvr commented Oct 15, 2024

See #4100 (comment). From this PR we can keep the first commit (don't try to reuse unique IDs) + the opaque type, and we'll get rid of the third one likely. It might be better to not use the transaction unique id in the react function first.

@bnjbvr bnjbvr force-pushed the bnjbvr/typed-timeline-unique-id branch 2 times, most recently from aca7286 to fa489bb Compare October 15, 2024 14:06
@bnjbvr
Copy link
Member Author

bnjbvr commented Oct 15, 2024

Ready for another round of review, after/on-top-of #4127 (but since you're the reviewer, you choose to decide how you review all this :)). Thanks!

…r the unique identifier

We can now use this type instead of passing a string, which means
there's no way to confuse oneself in methods like
`toggle_reaction_local`.

Changelog: Introduced `TimelineUniqueId`, returned by
`TimelineItem::unique_id()` and serving as an opaque identifier to use
in other methods modifying the timeline item (e.g. `toggle_reaction`).
@bnjbvr bnjbvr force-pushed the bnjbvr/typed-timeline-unique-id branch from fa489bb to 6f3d880 Compare October 16, 2024 13:08
stefanceriu added a commit to element-hq/element-x-ios that referenced this pull request Oct 16, 2024
… use the new `TimelineUniqueId` type instead of `String` for unique timeline identifiers.
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.

Just tried it out in on this branch and on top of 4127 and everything looks good to me. Nicely done 👍

@bnjbvr bnjbvr merged commit 4f49b23 into main Oct 16, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/typed-timeline-unique-id branch October 16, 2024 14:21
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.

2 participants