-
Couldn't load subscription status.
- Fork 405
Add support for MSC4293 - Redact on Kick/Ban #18540
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0766119
add support for MSC4293
H-Shay ce555e7
tests
H-Shay 8c606cd
fix msc number typo
H-Shay e8d328f
add indexes in background
H-Shay b6aa6c0
newsfragment + run indexes in background
H-Shay e4a1014
lint
H-Shay 5ad9e66
ensure redact flag is respected when using /kick and /ban
H-Shay 656b648
remove debugging artifact
H-Shay 5a53b93
requested changes
H-Shay 80e0979
Merge branch 'develop' into shay/redact_on_ban
anoadragon453 4323879
requested changes
H-Shay 65d7b41
change table architecture
H-Shay 8d7eddd
update code to reflect new table architecture
H-Shay 17ce194
fix column type
H-Shay af6ca26
fix other column type
H-Shay bf8d9c2
invalidate cache by room id
H-Shay c06ab2e
requested changes
H-Shay 7c1cac6
Merge branch 'develop' into shay/redact_on_ban
H-Shay c43a5a3
requested changes
H-Shay 47de415
requested changes
H-Shay 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 hidden or 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 hidden or 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 hidden or 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
7 changes: 7 additions & 0 deletions
7
synapse/storage/schema/main/delta/92/06_redactions_multitarget.sql.postgres
This file contains hidden or 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,7 @@ | ||
| ALTER TABLE ONLY redactions ADD CONSTRAINT redactions_event_id_redacts_key UNIQUE (event_id, redacts); | ||
|
|
||
| -- Replace the index we're about to drop | ||
| CREATE INDEX redactions_event_id ON redactions USING btree (event_id); | ||
|
|
||
| -- Drop the old constraint | ||
| ALTER TABLE ONLY redactions DROP CONSTRAINT redactions_event_id_key; |
23 changes: 23 additions & 0 deletions
23
synapse/storage/schema/main/delta/92/06_redactions_multitarget.sql.sqlite
This file contains hidden or 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,23 @@ | ||
| -- recreate table to drop UNIQUE(event_id) constraint and add a new unique constraint on (event_id, redacts) | ||
| CREATE TABLE redactions2 ( | ||
| event_id TEXT NOT NULL, | ||
| redacts TEXT NOT NULL, | ||
| have_censored BOOL NOT NULL DEFAULT false, | ||
| received_ts BIGINT, | ||
| UNIQUE(event_id, redacts) | ||
| ); | ||
|
|
||
| INSERT INTO redactions2 ( | ||
| event_id, | ||
| redacts, | ||
| have_censored, | ||
| received_ts | ||
| ) SELECT r.event_id, r.redacts, r.have_censored, r.received_ts FROM redactions AS r; | ||
|
|
||
| DROP INDEX redactions_redacts; | ||
| DROP TABLE redactions; | ||
| ALTER TABLE redactions2 RENAME TO redactions; | ||
|
|
||
| CREATE INDEX redactions_redacts ON redactions(redacts); | ||
| CREATE INDEX redactions_event_id ON redactions(event_id); -- replace the index we dropped | ||
| CREATE INDEX redactions_have_censored_ts ON redactions(received_ts) WHERE NOT have_censored; |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.