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
Handle non-strings in the event_search
table in synapse_port_db
#12037
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7b9d806
Handle non-strings in the `event_search` table in `synapse_port_db`
5889d87
Add test for message received over federation with non-string body
c6d0534
Reword newsfile
c7b6710
Revert fix to `scripts/synapse_port_db` in favour of a background update
b6aff6e
Add a background update to clear out bad rows from `event_search` whe…
76d88af
Merge branch 'develop' into squah/no_integers_in_event_search
f045019
Use `.get_datastores().main` instead of `.get_datastore()` in tests
a895049
Run test on both sqlite and postgres
37c1798
Make schema delta sqlite only
02d8fe4
Reword changelog, again
4b5ec98
Sprinkle some type hints around
b7ad0a9
Fix test for postgres schema
75bc1bf
Remove redundant sqlite guard
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 @@ | ||
Fix a long-standing bug where integers could get into the `event_search` table when using sqlite and prevent migration to PostgreSQL. |
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.
I'm not sure how actually.
#441 from 6 years ago addresses half of the code paths. Events with non-string name/topic/bodies can't reach the code paths fixed in this PR because we validate incoming events from clients. Perhaps it can happen when receiving events over federation?
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.
Coming in over federation sounds like something that's worth trying?
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 scraped together a test and the issue can indeed be triggered by receiving malformed events over federation.
Or it would if Synapse didn't error out in the null-cleaner introduced in 1.44.0 (#10820).
As suggested, I'm going to revert the change to
scripts/synapse_port_db
and create a background update to clean up the database.