matrix-org / matrix-org/matrix-spec

sync v2 implicit todevice acks considered incredibly harmful.

Open
#7 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

I think we’ve tracked the main final reliability problem on matrix-video-chat to the fact that people leave instances lying around in bg tabs, which sit there running a sync loop which races to consume msc matrix-org/matrix-spec-proposals#3401 todevice messages.

I think the race is that if one sync loop calls /sync before the other tab’s /sync returns, it can “steal” the todevice messages out from the other loop by acknowledging and thus deleting them. As a result, half your todevice messages go missing (hence all my accusations in https://github.com/matrix-org/synapse/issues/9533 about unreliable todevice msgs).

@kegsay - any suggestions on a backwards compatible change to v2 sync to fix this so we’re not blocked waiting for sliding sync to land?

See also https://github.com/matrix-org/synapse/issues/6450 as another instance of this wreaking havoc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the v2 sync and to-device message behavior described in this issue, then read MSC3401 and the linked Synapse issues #9533 and #6450. A useful outcome would be an agreed, backwards-compatible change that prevents concurrent sync loops from losing to-device messages; the issue does not name implementation files or tests.

Written by the indexing model from the issue text.

Assessment

Domain
backend-api-design, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.