Skip to content

/sync API does not tell clients when the server's view of state changes outside the timeline #1209

@ara4n

Description

@ara4n

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Client-ServerIssues affecting the CS APIfeatureSuggestion for a significant extension which needs considerable consideration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions