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): enable persistent storage by default 😎 #4308

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Nov 21, 2024

This implements the following parts of #3280 (comment):

  • implement a sqlite backend for the event cache store
  • save events into the store as they come from sync
  • reload data from the store and use it to prefill the linked chunks for all rooms

For getting a nice demo in the multiverse client, a few shortcuts have been taken in the last commit, but these should be relatively easy to solve.

The demo shows the following:

  • open the client for the first time
  • observe the focused room is mostly empty
  • I manually back-paginate, getting some events back from the server
  • then, close the client
  • reopen it
  • observe the events are still there (they were persisted on disk).
Screencast.From.2024-11-21.18-09-05.mp4

More to come next week.

@bnjbvr
Copy link
Member Author

bnjbvr commented Nov 28, 2024

For what it's worth, to observers of this PR: this is being split, redesigned and reviewed in several smaller PRs, which all link to this one. This PR might be repurposed to represent the final step of the work done here, at some point.

@Hywan
Copy link
Member

Hywan commented Jan 10, 2025

Is it useful to keep this PR open?

@bnjbvr
Copy link
Member Author

bnjbvr commented Jan 13, 2025

Is it useful to keep this PR open?

I think I can repurpose it to become the "enable storage by default", by removing a few commits in there :-)

@bnjbvr bnjbvr changed the title feat(event cache): sqlite persistent storage for the event cache 😎 feat(event cache): enable the persistent storage for the event cache by default 😎 Jan 13, 2025
@bnjbvr bnjbvr changed the title feat(event cache): enable the persistent storage for the event cache by default 😎 feat(event cache): enable persistent storage by default 😎 Jan 13, 2025
@bnjbvr bnjbvr force-pushed the bnjbvr/sqlite-event-cache branch from 1473d60 to e9bc43a Compare January 13, 2025 13:29
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 85.33%. Comparing base (5548f38) to head (e9bc43a).

Files with missing lines Patch % Lines
crates/matrix-sdk/src/event_cache/room/mod.rs 75.00% 2 Missing ⚠️
crates/matrix-sdk/src/event_cache/mod.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4308      +/-   ##
==========================================
- Coverage   85.38%   85.33%   -0.05%     
==========================================
  Files         285      285              
  Lines       31961    31907      -54     
==========================================
- Hits        27290    27229      -61     
- Misses       4671     4678       +7     

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

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