-
Notifications
You must be signed in to change notification settings - Fork 252
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
base: main
Are you sure you want to change the base?
Conversation
1ff7a2a
to
b3b61fe
Compare
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! 😁 |
Codecov ReportAttention: Patch coverage is
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. |
Signed-off-by: Kévin Commaille <[email protected]>
84d83d1
to
02a3630
Compare
Rebased on main to solve a conflict. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main feedback is that I wouldn't want to have external users have to deal with a EventCacheStoreWrapper
, but rather with the EventCacheStore
; so EventCacheStore
(the trait) would likely need to be renamed into something else, maybe EventCacheStoreBackend
or EventCacheStoreImpl
, or something else that makes this clear enough?
I haven't looked at the code in details, so forwarding review to somebody else.
I know this is a big commit, so for reviewers I am going to reiterate what I said in the Matrix room to help reviewing part by part: I would recommend starting in Then in any order:
|
Before reviewing this PR, I'm wondering: don't we have an MSC about media retention policy? I see there is MSC1763. I don't know the state of this MSC, but I think we should link both (a media is an event after all). I don't know if the What do you think about this? |
This is on purpose a device-specific setting. The sole goal here is for the client or the user (if the client offers a setting for it) to be allowed to limit the size of the cache on the device. This kind of setting can usually change from one device to the other, e.g. the limitations would be more strict on an phone where disk space is limited than on a computer with a lot of free space. |
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.