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

Commit 07e1af1

Browse files
committed
Fix rejecting invites over federation
Currently causes future incremental syncs to fail. Broke by #12191
1 parent d1cd96c commit 07e1af1

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

synapse/handlers/sync.py

+17-8
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,7 @@ async def _get_rooms_changed(
18501850
full_state=False,
18511851
since_token=since_token,
18521852
upto_token=leave_token,
1853+
out_of_band=leave_event.internal_metadata.is_out_of_band_membership(),
18531854
)
18541855
)
18551856

@@ -2116,14 +2117,18 @@ async def _generate_room_entry(
21162117
):
21172118
return
21182119

2119-
state = await self.compute_state_delta(
2120-
room_id,
2121-
batch,
2122-
sync_config,
2123-
since_token,
2124-
now_token,
2125-
full_state=full_state,
2126-
)
2120+
if not room_builder.out_of_band:
2121+
state = await self.compute_state_delta(
2122+
room_id,
2123+
batch,
2124+
sync_config,
2125+
since_token,
2126+
now_token,
2127+
full_state=full_state,
2128+
)
2129+
else:
2130+
# An out of band room won't have any state changes.
2131+
state = {}
21272132

21282133
summary: Optional[JsonDict] = {}
21292134

@@ -2386,6 +2391,8 @@ class RoomSyncResultBuilder:
23862391
full_state: Whether the full state should be sent in result
23872392
since_token: Earliest point to return events from, or None
23882393
upto_token: Latest point to return events from.
2394+
out_of_band: whether the events in the room are "out of band" events
2395+
and the server isn't in the room.
23892396
"""
23902397

23912398
room_id: str
@@ -2395,3 +2402,5 @@ class RoomSyncResultBuilder:
23952402
full_state: bool
23962403
since_token: Optional[StreamToken]
23972404
upto_token: StreamToken
2405+
2406+
out_of_band: bool = False

0 commit comments

Comments
 (0)