mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-14 22:11:47 +01:00
Fix background update for sliding sync (find previous membership) (#17632)
This reverts commit
ab414f2ab8
.
Introduced in https://github.com/element-hq/synapse/pull/17512
This commit is contained in:
parent
bb80894391
commit
d844afdc29
2 changed files with 6 additions and 4 deletions
1
changelog.d/17632.misc
Normal file
1
changelog.d/17632.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Pre-populate room data used in experimental [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575) Sliding Sync `/sync` endpoint for quick filtering/sorting.
|
|
@ -1967,12 +1967,13 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
|
||||||
txn.execute(
|
txn.execute(
|
||||||
"""
|
"""
|
||||||
SELECT event_id, membership
|
SELECT event_id, membership
|
||||||
FROM room_memberships
|
FROM room_memberships AS m
|
||||||
|
INNER JOIN events AS e USING (room_id, event_id)
|
||||||
WHERE
|
WHERE
|
||||||
room_id = ?
|
room_id = ?
|
||||||
AND user_id = ?
|
AND m.user_id = ?
|
||||||
AND event_stream_ordering < ?
|
AND e.stream_ordering < ?
|
||||||
ORDER BY event_stream_ordering DESC
|
ORDER BY e.stream_ordering DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
""",
|
""",
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in a new issue