Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element Web makes request to /_matrix/client/unstable/org.matrix.msc3575/sync on startup, causing lost to-device-messages #27426

Closed
richvdh opened this issue May 2, 2024 · 2 comments · Fixed by matrix-org/matrix-react-sdk#12492
Labels
A-Sliding-Sync Also known as Sync v3 - https://github.com/matrix-org/sliding-sync O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Critical Prevents work, causes data loss and/or has no workaround T-Defect X-Upcoming-Release-Blocker This does not affect the current release cycle but will affect the next one

Comments

@richvdh
Copy link
Member

richvdh commented May 2, 2024

Introduced by matrix-org/matrix-react-sdk#12307.

Calling /_matrix/client/unstable/org.matrix.msc3575/sync causes the SS proxy to start polling synapse with our access token, which means that it will receive (some of) our to-device messages instead of us, which means we will get decryption errors.

@richvdh richvdh added T-Defect S-Critical Prevents work, causes data loss and/or has no workaround O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience labels May 2, 2024
@dosubot dosubot bot added the A-Sliding-Sync Also known as Sync v3 - https://github.com/matrix-org/sliding-sync label May 2, 2024
@t3chguy
Copy link
Member

t3chguy commented May 2, 2024

Calling /_matrix/client/unstable/org.matrix.msc3575/sync causes the SS proxy to start polling synapse with our access token, which means that it will receive (some of) our to-device messages instead of us

This sounds like a deployment issue. Nothing in MSC3575 or MSC3885 says /_matrix/client/unstable/org.matrix.msc3575/sync will prevent to_device message delivery via normal sync so using the proxy in place of the native endpoint causes this mishap.

@t3chguy t3chguy added the X-Upcoming-Release-Blocker This does not affect the current release cycle but will affect the next one label May 2, 2024
turt2live added a commit to matrix-org/matrix-react-sdk that referenced this issue May 2, 2024
This avoids unintended consequences, including high resource usage, which would accompany a "full" sync request. Instead, we just grab headers and enough information for CORS to pass, revealing likely support.

Fixes element-hq/element-web#27426
@turt2live
Copy link
Member

Calling /_matrix/client/unstable/org.matrix.msc3575/sync causes the SS proxy to start polling synapse with our access token, which means that it will receive (some of) our to-device messages instead of us

This sounds like a deployment issue. Nothing in MSC3575 or MSC3885 says /_matrix/client/unstable/org.matrix.msc3575/sync will prevent to_device message delivery via normal sync so using the proxy in place of the native endpoint causes this mishap.

Using POST can also have unintended consequences generally, like high resource utilization while the server calculates an initial response (in this case). If we don't expect things to happen, we shouldn't be using verbs which make things happen.

It just happens that a byproduct of the proxy is that it starts syncing for you, which was requested by the caller using an action-capable verb.

github-merge-queue bot pushed a commit to matrix-org/matrix-react-sdk that referenced this issue May 3, 2024
* Use OPTIONS for sliding sync detection poke

This avoids unintended consequences, including high resource usage, which would accompany a "full" sync request. Instead, we just grab headers and enough information for CORS to pass, revealing likely support.

Fixes element-hq/element-web#27426

* Appease the linter

* Reset for each test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Sliding-Sync Also known as Sync v3 - https://github.com/matrix-org/sliding-sync O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Critical Prevents work, causes data loss and/or has no workaround T-Defect X-Upcoming-Release-Blocker This does not affect the current release cycle but will affect the next one
Projects
None yet
3 participants