Files
synapse/tests
Devon HudsonandClaude Opus 5.5 638943cb0e Include out-of-band leaves in initial /sync
An out-of-band leave, such as a remote invite rescinded by the inviter or
a rejected remote invite, is an outlier and so not in the room's
timeline. Incremental sync already sends it as the room's timeline, but
initial sync only loaded the timeline from the room stream, so it
dropped the room if the user had never been in it, and otherwise
returned the history without the leave.

Initial sync now loads the room's history before the out-of-band leave
and adds the leave at the end, including when the history has a gap.
When the timeline starts with the leave, the state at the end of the
timeline is used as the state at its start, as the leave has no state of
its own.

Rescinded invites are returned whether or not `include_leave` is set,
like any other room the user was kicked from, as incremental sync
already did.

This made Complement's `Inviter_user_can_rescind_invite_over_federation`
flaky: if the rescission reached the invitee's server before the test's
first sync, the leave was never returned.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-30 16:07:34 -06:00
..
2026-09-18 12:00:45 +01:00