mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-25 15:56:28 -05:00
Attempt to delete more duplicate rows in receipts_linearized table. (#14915)
The previous assumption was that the stream_id column was unique (for a room ID, receipt type, user ID tuple), but this turned out to be incorrect. Now find the max stream ID, then map this back to a database-specific row identifier and delete other rows which match the (room ID, receipt type, user ID) tuple, but *not* the row ID.
This commit is contained in:
parent
bb675913f0
commit
230a831c73
3 changed files with 30 additions and 9 deletions
|
|
@ -168,7 +168,9 @@ class ReceiptsBackgroundUpdateStoreTestCase(HomeserverTestCase):
|
|||
{"stream_id": 6, "event_id": "$some_event"},
|
||||
],
|
||||
(self.other_room_id, "m.read", self.user_id): [
|
||||
{"stream_id": 7, "event_id": "$some_event"}
|
||||
# It is possible for stream IDs to be duplicated.
|
||||
{"stream_id": 7, "event_id": "$some_event"},
|
||||
{"stream_id": 7, "event_id": "$some_event"},
|
||||
],
|
||||
},
|
||||
expected_unique_receipts={
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue