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(sdk): LinkedChunk can hold a value for Gaps #3227

Merged

Conversation

Hywan
Copy link
Member

@Hywan Hywan commented Mar 18, 2024

This patch updates ChunkContent::Gap to hold a content U. Thus, Chunk and LinkedChunk both get a new generic parameter U. Some methods like new_gap or insert_gap_at take a new content: U parameter.

This type RoomEvents (that uses LinkedChunk) is also updated accordingly.

And because @bnjbvr asked me to do it with Beatbox, I delegate this task to the king of Beatbox: Rythmind.


@Hywan Hywan requested a review from bnjbvr March 18, 2024 09:47
@Hywan Hywan requested a review from a team as a code owner March 18, 2024 09:47
@Hywan Hywan removed the request for review from a team March 18, 2024 09:47
This patch updates `ChunkContent::Gap` to hold a content `U`. Thus,
`Chunk` and LinkedChunk` both get a new generic parameter `U`. Some
methods like `new_gap` or `insert_gap_at` take a new `content: U`
parameter.

This type `RoomEvents` (that uses `LinkedChunk`) is also updated
accordingly.
@Hywan Hywan force-pushed the feat-sdk-event-cache-linked-chunk-with-gap-content branch from 976b1b2 to 5591be9 Compare March 18, 2024 09:52
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 83.70%. Comparing base (0a7e28f) to head (7f7d9b8).
Report is 23 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk/src/event_cache/linked_chunk.rs 80.76% 5 Missing ⚠️
crates/matrix-sdk/src/event_cache/store.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3227   +/-   ##
=======================================
  Coverage   83.70%   83.70%           
=======================================
  Files         236      236           
  Lines       24516    24517    +1     
=======================================
+ Hits        20520    20521    +1     
  Misses       3996     3996           

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

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

Sounds good! Should we also add a way to read a gap value, one way or another?

crates/matrix-sdk/src/event_cache/linked_chunk.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/event_cache/linked_chunk.rs Outdated Show resolved Hide resolved
@Hywan
Copy link
Member Author

Hywan commented Mar 18, 2024

It's possible to read the Gap content with the new Chunk::content method introduced in #3230.

I'm going to rename the generic parameter and merge this PR.

This patch renames the generic parameters `T` and `U` to `Item` and
`Gap` for the `LinkedChunk` type and siblings.
@Hywan Hywan enabled auto-merge March 18, 2024 11:37
@Hywan Hywan merged commit 555dfe0 into matrix-org:main Mar 18, 2024
34 checks passed
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