mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 10:35:46 +03:00
Ignore leave events for bg updates
This commit is contained in:
parent
596b96411b
commit
b03dc0a997
1 changed files with 4 additions and 2 deletions
|
@ -1927,10 +1927,11 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
|
|||
LEFT JOIN rooms AS r ON (c.room_id = r.room_id)
|
||||
WHERE (c.room_id, c.user_id) > (?, ?)
|
||||
AND (m.user_id IS NULL OR c.event_id != m.membership_event_id)
|
||||
AND (c.membership != ? OR c.user_id != e.sender)
|
||||
ORDER BY c.room_id ASC, c.user_id ASC
|
||||
LIMIT ?
|
||||
""",
|
||||
(last_room_id, last_user_id, batch_size),
|
||||
(last_room_id, last_user_id, Membership.LEAVE, batch_size),
|
||||
)
|
||||
elif last_event_stream_ordering is not None:
|
||||
# It's important to sort by `event_stream_ordering` *ascending* (oldest to
|
||||
|
@ -1961,10 +1962,11 @@ class EventsBackgroundUpdatesStore(StreamWorkerStore, StateDeltasStore, SQLBaseS
|
|||
LEFT JOIN rooms AS r ON (c.room_id = r.room_id)
|
||||
WHERE c.event_stream_ordering > ?
|
||||
AND (m.user_id IS NULL OR c.event_id != m.membership_event_id)
|
||||
AND (c.membership != ? OR c.user_id != e.sender)
|
||||
ORDER BY c.event_stream_ordering ASC
|
||||
LIMIT ?
|
||||
""",
|
||||
(last_event_stream_ordering, batch_size),
|
||||
(last_event_stream_ordering, Membership.LEAVE, batch_size),
|
||||
)
|
||||
else:
|
||||
raise Exception("last_event_stream_ordering should not be None")
|
||||
|
|
Loading…
Reference in a new issue