Skip to content

Store SlidingSyncPositionMarkers in EventCacheStore#6541

Open
mgoldenberg wants to merge 15 commits intomatrix-org:mainfrom
mgoldenberg:sliding-sync-pos-in-event-cache-store
Open

Store SlidingSyncPositionMarkers in EventCacheStore#6541
mgoldenberg wants to merge 15 commits intomatrix-org:mainfrom
mgoldenberg:sliding-sync-pos-in-event-cache-store

Conversation

@mgoldenberg
Copy link
Copy Markdown
Contributor

@mgoldenberg mgoldenberg commented May 5, 2026

Currently, the SlidingSyncPositionMarkers are stored in the CryptoStore. This store was chosen, as the position markers needed to be accessible in a way that could be synchronized across processes - i.e., a store protected by a cross-process lock.

Originally, the only store to provide this functionality was the CryptoStore, but this means that when end-to-end encryption is not enabled, there is no way to store the position markers. So, now that the EventCacheStore is protected by a cross-process lock and is always accessible, it is a more reasonable option.

Changes

  • Add functions to the EventCacheStore trait for getting, setting, and removing custom values
    • This mimics the CryptoStore, which makes this pull request simpler - but we could use more tailored functions for this behavior, if that is preferable.
  • Implement the above functions for in-memory, SQLite, and IndexedDB implementations of EventCacheStore

Closes #6401.

  • I've documented the public API Changes in the appropriate CHANGELOG.md files.
  • This PR was made with the help of AI.

Signed-off-by: Michael Goldenberg m@mgoldenberg.net

mgoldenberg added 12 commits May 5, 2026 12:35
Initial implementations for SQLite, IndexedDB, and in-memory stores
do nothing.

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
…store

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
… store

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 76.59574% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.93%. Comparing base (2ec031b) to head (2f95082).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/event_cache/redecryptor.rs 0.00% 6 Missing ⚠️
crates/matrix-sdk/src/sliding_sync/cache.rs 77.77% 0 Missing and 4 partials ⚠️
crates/matrix-sdk-common/src/cross_process_lock.rs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6541   +/-   ##
=======================================
  Coverage   89.92%   89.93%           
=======================================
  Files         381      381           
  Lines      105914   105942   +28     
  Branches   105914   105942   +28     
=======================================
+ Hits        95243    95274   +31     
+ Misses       7029     7022    -7     
- Partials     3642     3646    +4     

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

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
@mgoldenberg mgoldenberg marked this pull request as ready for review May 5, 2026 17:10
@mgoldenberg mgoldenberg requested a review from a team as a code owner May 5, 2026 17:10
@mgoldenberg mgoldenberg requested review from poljar and removed request for a team May 5, 2026 17:10
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 5, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing mgoldenberg:sliding-sync-pos-in-event-cache-store (2f95082) with main (2ec031b)

Open in CodSpeed

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.

Find a better place for the pos persistance

1 participant