Skip to content

feat: store the thread subscription status in the database #5455

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Jul 28, 2025

Some implementation notes:

  • instead of using kvdata (StateStoreDataKey et al.), I've added a new table for the thread subscriptions, so we can later do queries like "where status is subscribed".
  • I've made it so that unsubscribing is remembered on the local device, so the next attempt to fetch a thread subscription may return unsubscribed. The MSC should soon evolve in that direction, in such a way that a thread status can be unsubscribed on the server as well, so I'm just being a bit early here.

@bnjbvr bnjbvr requested a review from a team as a code owner July 28, 2025 14:53
@bnjbvr bnjbvr requested review from stefanceriu and removed request for a team July 28, 2025 14:53
Copy link

codspeed-hq bot commented Jul 28, 2025

CodSpeed Performance Report

Merging #5455 will not alter performance

Comparing bnjbvr/store-thread-subs (d2d9b9c) with main (8091094)

Summary

✅ 6 untouched benchmarks

Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 90.13158% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.90%. Comparing base (8091094) to head (d2d9b9c).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-sqlite/src/state_store.rs 77.55% 2 Missing and 9 partials ⚠️
crates/matrix-sdk/src/room/mod.rs 88.46% 0 Missing and 3 partials ⚠️
crates/matrix-sdk-base/src/store/mod.rs 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5455      +/-   ##
==========================================
+ Coverage   88.88%   88.90%   +0.01%     
==========================================
  Files         333      333              
  Lines       92082    92228     +146     
  Branches    92082    92228     +146     
==========================================
+ Hits        81850    81993     +143     
+ Misses       6403     6393      -10     
- Partials     3829     3842      +13     

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

Nice, lgtm 👍

@bnjbvr bnjbvr force-pushed the bnjbvr/store-thread-subs branch from 59dbf89 to d2d9b9c Compare July 29, 2025 13:56
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