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

Fix rejecting invites over federation #12409

Merged
merged 3 commits into from
Apr 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix rejecting invites over federation
Currently causes future incremental syncs to fail.

Broke by #12191
  • Loading branch information
erikjohnston committed Apr 7, 2022
commit 07e1af1c5b1f50d8d170b63121ce866ba060e5c9
25 changes: 17 additions & 8 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,7 @@ async def _get_rooms_changed(
full_state=False,
since_token=since_token,
upto_token=leave_token,
out_of_band=leave_event.internal_metadata.is_out_of_band_membership(),
)
)

Expand Down Expand Up @@ -2116,14 +2117,18 @@ async def _generate_room_entry(
):
return

state = await self.compute_state_delta(
room_id,
batch,
sync_config,
since_token,
now_token,
full_state=full_state,
)
if not room_builder.out_of_band:
state = await self.compute_state_delta(
room_id,
batch,
sync_config,
since_token,
now_token,
full_state=full_state,
)
else:
# An out of band room won't have any state changes.
state = {}

summary: Optional[JsonDict] = {}

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

room_id: str
Expand All @@ -2395,3 +2402,5 @@ class RoomSyncResultBuilder:
full_state: bool
since_token: Optional[StreamToken]
upto_token: StreamToken

out_of_band: bool = False