Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 7b4e228

Browse files
authored
Fix using MSC2716 batch sending with event persistence workers (#11220)
Signed-off-by: Tulir Asokan <[email protected]>
1 parent dc0a3cd commit 7b4e228

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Diff for: changelog.d/11220.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix using MSC2716 batch sending in combination with event persistence workers. Contributed by @tulir at Beeper.

Diff for: synapse/app/generic_worker.py

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
)
114114
from synapse.storage.databases.main.presence import PresenceStore
115115
from synapse.storage.databases.main.room import RoomWorkerStore
116+
from synapse.storage.databases.main.room_batch import RoomBatchStore
116117
from synapse.storage.databases.main.search import SearchStore
117118
from synapse.storage.databases.main.session import SessionStore
118119
from synapse.storage.databases.main.stats import StatsStore
@@ -240,6 +241,7 @@ class GenericWorkerSlavedStore(
240241
SlavedEventStore,
241242
SlavedKeyStore,
242243
RoomWorkerStore,
244+
RoomBatchStore,
243245
DirectoryStore,
244246
SlavedApplicationServiceStore,
245247
SlavedRegistrationStore,

Diff for: synapse/events/snapshot.py

+5
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ async def _fill_out_state(self) -> None:
322322
attributes by loading from the database.
323323
"""
324324
if self.state_group is None:
325+
# No state group means the event is an outlier. Usually the state_ids dicts are also
326+
# pre-set to empty dicts, but they get reset when the context is serialized, so set
327+
# them to empty dicts again here.
328+
self._current_state_ids = {}
329+
self._prev_state_ids = {}
325330
return
326331

327332
current_state_ids = await self._storage.state.get_state_ids_for_group(

0 commit comments

Comments
 (0)