element-hq / element-hq/synapse

Synapse sends unnecessary device list change entries

Open
#6,162 1 comment 0 reactions 0 assignees View on GitHub
A-Device-List-Tracking A-Lazy-Loading A-Performance T-Enhancement z-bug z-p2
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

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

---

With the lazy loading sync options enabled, synapse includes the current state events it thinks the client will need in order to render the events in the timeline section. The device list sync computation code includes these state events when working out what users have joined a room, so every time this happens, it generates a device change entry for that user too.

This will also presumably have happened when a user changed their profile information, so perhaps the most sensible fix here is for the sync code to look at the prev content for join events (it already looks at `prev_content` for `leave` events: [`synapse/handlers/sync.py#L1382`](https://github.com/matrix-org/synapse/blob/faf72a4c403000f7815d171feb8bf1a83b353584/synapse/handlers/sync.py#L1382-L1398)).

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.