Skip to content

Support one account across multiple devices - #51

Merged
Androtim merged 1 commit into
mainfrom
feat/multi-device
Jul 3, 2026
Merged

Androtim merged 1 commit into
mainfrom
feat/multi-device

Conversation

@Androtim

@Androtim Androtim commented Jul 3, 2026

Copy link
Copy Markdown
Owner

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:

  • Presence (user-online/user-offline) flips on the first device connecting and off only when the last one disconnects.
  • Text DMs, file offers, party invites, group messages, and group-created notifications fan out to every device.
  • 1:1 P2P file signaling is the one thing that can't simply broadcast — the WebRTC handshake is between two specific sockets, and dm-file-signal carries 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

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>
@Androtim
Androtim merged commit 4dec7c7 into main Jul 3, 2026
1 check passed
@Androtim
Androtim deleted the feat/multi-device branch July 3, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant