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(event cache): have a debug representation of a linked chunk and use it in multiverse #4411

Merged
merged 4 commits into from
Dec 16, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Dec 12, 2024

I think that this debug representation may show useful to understand issues. Just from using it a few minutes, I've identified a few issues related to storage:

  • we shouldn't have empty items chunks; they should be removed, or even better, reused.
  • we may have multiple prev-batch token that represent the same events, e.g. if we sync'd a room with timeline_limit=1, then with timeline_limit=20. Not sure if there's anything obvious to do about that.
    • edit: yes there is! do not store a prev-batch token when all the events (at least 1) returned from the backpagination are known. Should be a sufficiently good heuristic 🧠

image

@bnjbvr bnjbvr requested a review from a team as a code owner December 12, 2024 16:22
@bnjbvr bnjbvr requested review from stefanceriu and removed request for a team December 12, 2024 16:22
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 55.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 85.29%. Comparing base (05d46e6) to head (43632c5).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/event_cache/room/events.rs 0.00% 7 Missing ⚠️
crates/matrix-sdk/src/event_cache/room/mod.rs 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4411      +/-   ##
==========================================
- Coverage   85.31%   85.29%   -0.03%     
==========================================
  Files         283      283              
  Lines       31424    31435      +11     
==========================================
+ Hits        26810    26812       +2     
- Misses       4614     4623       +9     

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

Super nice! Any chance we can expose this through FFI? We could dump the contents into a separate screen like we do for message sources.

@bnjbvr bnjbvr force-pushed the bnjbvr/multiverse-linked-chunk branch from 22f7e28 to 43c46e8 Compare December 16, 2024 15:03
@bnjbvr bnjbvr force-pushed the bnjbvr/multiverse-linked-chunk branch from 43c46e8 to 43632c5 Compare December 16, 2024 15:15
@bnjbvr
Copy link
Member Author

bnjbvr commented Dec 16, 2024

@stefanceriu Done in the last commit; this is a simple change, so not re-requesting a review just for this :) Thanks for the review!

@bnjbvr bnjbvr enabled auto-merge (rebase) December 16, 2024 15:15
@bnjbvr bnjbvr merged commit 34ea42a into main Dec 16, 2024
40 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/multiverse-linked-chunk branch December 16, 2024 15:41
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