-
Notifications
You must be signed in to change notification settings - Fork 269
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: Add MediaRetentionPolicy to the EventCacheStore, take 2 #4571
Conversation
ff37e93
to
504a9d4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4571 +/- ##
==========================================
+ Coverage 85.44% 85.69% +0.24%
==========================================
Files 286 289 +3
Lines 32285 33208 +923
==========================================
+ Hits 27587 28458 +871
- Misses 4698 4750 +52 ☔ View full report in Codecov by Sentry. |
6835778
to
7c4c359
Compare
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.
Excellent work 👏. It's definitely an improvement over #3918. I like the new design. Thank you!
I've left a couple of comments, but nothing big.
crates/matrix-sdk-base/src/event_cache/store/media/media_retention_policy.rs
Show resolved
Hide resolved
crates/matrix-sdk-base/src/event_cache/store/media/media_retention_policy.rs
Outdated
Show resolved
Hide resolved
crates/matrix-sdk-base/src/event_cache/store/media/media_retention_policy.rs
Outdated
Show resolved
Hide resolved
crates/matrix-sdk-base/src/event_cache/store/media/media_retention_policy.rs
Outdated
Show resolved
Hide resolved
crates/matrix-sdk-base/src/event_cache/store/media/media_retention_policy.rs
Show resolved
Hide resolved
@@ -12,10 +12,16 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
//! Configuration to decide whether or not to keep media in the cache, allowing | |||
//! to do periodic cleanups to avoid to have the size of the media cache grow | |||
//! indefinitely. |
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.
Explanation how to run a clean up, or when it is done if done automatically, would be particularly helpful!
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.
I added instructions for this and a sentence about automatic periodic cleanups.
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.
All good to me! Please, consider my last comment about the documentation, and we are good.
Can you rebase your patches (not into a single patch, but fixup commits into their respective patches)? After that, I'll merge your PR.
This will be used as a configuration to decide whether or not to keep media in the cache, allowing to do periodic cleanups to avoid to have the size of the media cache grow indefinitely. Signed-off-by: Kévin Commaille <[email protected]>
This is an API to handle the MediaRetentionPolicy with a lower level EventCacheStoreMedia trait. Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
It is already a 3-tuple and we want to add more data so it will be clearer to use a stuct with named fields. Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
…ted changes Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
Signed-off-by: Kévin Commaille <[email protected]>
309520b
to
0334ff3
Compare
Signed-off-by: Kévin Commaille <[email protected]>
I merged main in this branch to solve a conflict. Maybe you would prefer a rebase? |
Github tells me:
Can you try resolve these conflicts please? |
It didn't say anything to me, but I merged main again just to be sure. I didn't encounter any conflict. |
The new UI was disturbing me. Thanks! |
Supercedes #3918. Since I needed to rework everything, I used a new branch.
I believe that I addressed all the comments on #3918. The API around
MediaService
was not clear to me so I came up with something that works.It is now split into several commits that can be reviewed individually, in order.