matrix-spec: /sync API does not tell clients when the server's view of state changes outside the timeline
If the state graph forks and then merges again, some state events may be reset if they are in conflict. For instance:
alice sets topic1
|
|---------------------------.
| |
v v
alice sets topic2 bob kicks alice
| |
| .---------------------'
v v
bob says something
The fact the bob kicked alice on one branch of the DAG may arrive late, causing alice’s topic2 to be considered as reverted for the room’s state going forwards. We currently do not tell clients via /sync that this has happened however, so the client’s view of the room state will drift until they entirely resync (e.g. by flushing your cache in Riot).
Instead, we need a way of re-issuing the ‘topic1’ event into the state block in the /sync response to tell clients about the reset. This is potentially problematic as state changes like this may happen at any point in the timeline, whereas we only snapshot state at the beginning of a sync response. (However, if we include inlined state changes in the timeline at the ‘right’ point, perhaps this is enough?)
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 2
- Comments: 17 (15 by maintainers)
This is overall pretty catastrophic from a UX perspective when this happens, and makes me feel Matrix is super flakey.
I encountered this from a state reset in a v1 room, which meant I was kicked but it was still present as joined in riot-web, and I couldn’t leave it because I wasn’t in the room 😕 but this issue is applicable for any kind of fork in room state and so we will likely keep hitting edge cases manifesting as crap UX until we fix this.
the proposal sounds reasonable, but it’s obscure enough that I think if we’re going to do it, it needs to end up in the spec.