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

base: Add media retention policy to EventCacheStore #3918

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zecakeh
Copy link
Collaborator

@zecakeh zecakeh commented Aug 30, 2024

Allows to prevent the media cache from growing indefinitely by setting different limitations like size or last access time. I tried to select sensible defaults for those values.

Currently cleanups must be triggered manually, a future PR will add the possibility to run a regular cleanup task so they happen automatically.

@zecakeh zecakeh requested a review from a team as a code owner August 30, 2024 09:54
@zecakeh zecakeh requested review from stefanceriu and removed request for a team August 30, 2024 09:54
@zecakeh zecakeh force-pushed the event-cache-retention-policy branch from 1ff7a2a to b3b61fe Compare August 30, 2024 10:01
@stefanceriu stefanceriu requested review from bnjbvr and removed request for stefanceriu August 30, 2024 10:05
@stefanceriu
Copy link
Member

Sounds awesome but it's a biggie so I think it's safer to pass it over to somebody more familiar with the SDK, congrats Benji! 😁

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 95.87629% with 20 lines in your changes missing coverage. Please review.

Project coverage is 84.33%. Comparing base (7f4e79e) to head (02a3630).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk-sqlite/src/event_cache_store.rs 90.32% 6 Missing ⚠️
...rix-sdk-base/src/event_cache_store/memory_store.rs 91.37% 5 Missing ⚠️
...s/matrix-sdk-base/src/event_cache_store/wrapper.rs 75.00% 5 Missing ⚠️
...rates/matrix-sdk-base/src/event_cache_store/mod.rs 88.57% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3918      +/-   ##
==========================================
+ Coverage   84.18%   84.33%   +0.15%     
==========================================
  Files         267      268       +1     
  Lines       28036    28554     +518     
==========================================
+ Hits        23601    24082     +481     
- Misses       4435     4472      +37     

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

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@zecakeh
Copy link
Collaborator Author

zecakeh commented Sep 3, 2024

Rebased on main to solve a conflict.

@bnjbvr
Copy link
Member

bnjbvr commented Sep 4, 2024

Hi, thanks for the PR, since this is a large commit it might take a bit of time to get to review it. I'll try my best.

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.

3 participants