element-hq / element-hq/synapse

Faster room joins: Outgoing device list updates not sent if we leave the room before join completes

Open
#13,894 0 comments 0 reactions 0 assignees View on GitHub
A-Device-List-Tracking A-Federated-Join O-Uncommon S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#13894](https://github.com/matrix-org/synapse/issues/13894).

---

When a local user updates their device list while in a partial state room, their device list updates are buffered up, since it's not known for sure which servers are in the room and expecting device list updates. #13891 ensures that buffered device list updates are sent once the room transitions to full state.

However, if the room is left before then, there is no transition to full state and some remote homeservers will miss updates.

eg.
1. `@alice:local` partial state joins a room
2. The local homeserver thinks `@elsie:remote` is not in the room and does not send them device list updates, either because the `/send_join` `servers_in_room` response was incorrect or it has calculated incorrect state.
3. `@elsie:remote` queries `@alice:local`'s device list and caches it.
4. `@alice:local` updates their device list.
5. `@elsie:remote` joins another room shared with `@alice:local`.
6. `@alice:local` leaves the partial state room.
7. (bad) `@elsie:remote` thinks their cached device list for `@alice:local` is up to date when it's actually stale.

We're missing complement tests for this too.

related:
* #12993
* #12802
* #13891

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.