-
Notifications
You must be signed in to change notification settings - Fork 454
Description
Tracking issue for MSC4354 Sticky Events as an experimental feature in Synapse
Context
Or instead see the first section of the MSC which has a good bit of context.
Our immediate motivation is supporting Element Call. From memory, it's something along the following lines:
- they want something like state for tracking call membership
- but call membership changes frequently, resulting in 'state bloat' (the frequent changes in state bog down call rooms)
- Since call membership is short-lived, something like 'ephemeral state' would be beneficial — as in, something like a key-value map where entries have a finite and short lifetime
- Sticky events provide short-term (1 hour max) reliable(ish?) delivery for what are 'regular' (non-state/timeline[?]) events.
- They can be used as a primitive for building ephemeral state maps.
Current design in Synapse
There is a sticky_events stream table, which stores the metadata of sticky events and can be used to look at the current sticky events, paginated by stream IDs.
When events' stickinesses expire, they are removed from the table in a regular cleanup.
This way, the table remains small and roughly only contains currently-sticky events, making it efficient to paginate through them.
Caveats to be aware of
- Note that sticky events persisted before the feature is enabled will not be considered sticky by the local homeserver.
How do we know when to remove this
TODO but this is currently (2026-01) being trialled by Element Call team to see whether this works for them.
Currently that seems like the most likely deciding factor on whether we will decide to go for stabilisation or removal.