This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Prevent local quarantined media from being claimed by media retention #12972
Merged
anoadragon453
merged 11 commits into
develop
from
anoa/media_retention_quarantine_support
Jun 7, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b51107a
Prevent local quarantined media from being claimed by media retention
anoadragon453 d0d3a69
Protect remote quarantined media from media retention
anoadragon453 62b17cd
Test that media retention does not remove quarantined media
anoadragon453 2d837fc
Rename *_before methods, as they do more these days
anoadragon453 e60beb9
Remove 'local' from log line about potentially remote media
anoadragon453 e4837e6
Changelog
anoadragon453 97f0c5d
Additionally prevent protected media from being purged
anoadragon453 bfba18b
Update media retention tests to include protected media
anoadragon453 548b333
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/med…
anoadragon453 66c33bf
Add missing arg to docstring
anoadragon453 45a8d38
Use false, not 0, in SQL to check booleans
anoadragon453 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add new `media_retention` options to the homeserver config for routinely cleaning up non-recently accessed media. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this will fail on old sqlite
try
AND NOT safe_from_quarantine
And read https://matrix-org.github.io/synapse/latest/development/database_schema.html#boolean-columns
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.
Whoops. Thanks for catching! Fixed in #12977.
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.
Do we have a minimum supported sqlite version? Should CI have caught this?
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.
Our deprecation policy only mentions Python and PostgreSQL. Our unit tests look to only test different postgres versions as well.
I'm not sure if we do have a minimum supported version of SQLite, but https://matrix-org.github.io/synapse/latest/development/database_schema.html?highlight=database#boolean-columns does mention older versions, and it may be good to test an older SQLite in CI (maybe similar mistakes have slipped in already and we don't even know!).
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 thought at least one of our CI runs did old SQLite by using an old version of ubuntu? Though it does look like our CI is using latest ubuntu images everywhere...
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.
let's take this to #12983