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

Don't suggest token reuse for double-puppeting #6

Merged
merged 1 commit into from
Aug 23, 2021
Merged

Don't suggest token reuse for double-puppeting #6

merged 1 commit into from
Aug 23, 2021

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Aug 23, 2021

While this mostly works, it means that there are now two clients A and B acting
as the same logical device. The two clients are indistinguishable to a
homeserver. Since to_device messages are delivered exactly once to each
device, this means that there's a race between A and B to receive and
acknowledge to_device messages. In the worst case, this can mean that one
client can "miss" to_device messages. (See matrix-org/synapse#9533), and
in particular this comment.

Instead, each client should register a unique (private) access token so that it
appears as a unique device to the homeserver. See also client authentication
in the spec.

While this mostly works, it means that there are now two clients A and B acting
as the same logical [device]. The two clients are indistinguishable to a
homeserver.  Since to_device messages are delivered [exactly once] to each
device, this means that there's a race between A and B to receive and
acknowledge to_device messages. In the worst case, this can mean that one
client can "miss" to_device messages.

Instead, each client should register a unique (private) access token so that it
appears as a unique device to the homeserver. See also [client authentication]
in the spec.

[device]: https://matrix.org/docs/spec/index#devices
[exactly once]: https://matrix.org/docs/spec/client_server/r0.6.1#id70
[client authentication]: https://matrix.org/docs/spec/client_server/r0.6.1#client-authentication
Copy link
Member

@tulir tulir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would be nicer if there was a way to ignore to-device events for specific sync streams, but not suggesting token reuse is fine too

@tulir tulir merged commit 6f83e2d into mautrix:master Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants