Repository navigation
Support one account across multiple devices - #51
Merged
Merged
Conversation
Presence tracked one socket per user, so a second tab or device silently replaced the first: it stole presence and became the only recipient of DMs, offers, and invites. The server now keeps the full socket set per user — presence flips on the first connection and off only when the last one drops, and text DMs, file offers, party invites, group messages and notifications fan out to every device. 1:1 P2P file signaling (which carries no transferId on the signal frame) is pinned per user-pair to the sockets that started the handshake, so multi-device doesn't misroute a transfer. Limitation: one active transfer per peer pair per device. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a real limitation: the server tracked one socket per user, so opening Beacon in a second tab or on a second device silently replaced the first — it stole presence and became the only place DMs, file offers, and invites arrived.
The server now keeps the full set of sockets per user:
user-online/user-offline) flips on the first device connecting and off only when the last one disconnects.dm-file-signalcarries no transferId to route by. So the server pins, per user-pair, which socket of each side is engaged (set as each reveals itself via offer/request/signal). Documented limitation: one active transfer per peer-pair per device.Added a server-level integration test (
tests/integration/multi-device.spec.ts): same account on two sockets, a DM reaches both, and presence stays online until the last socket drops.Note: reading the same message history on two devices still needs the DM key backup feature (separate PR) — keys are per-device, so a second device has its own key. This PR fixes delivery and presence; decryption on a second device is the backup feature's job.
Verified: server typecheck clean; the new integration test passes; full Playwright suite green (36 passed).
🤖 Generated with Claude Code