mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-04 06:57:20 +00:00
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>