Skip to content

Add server-synced roster so the phone remote reconnects across sessions#81

Merged
starbrightlab merged 2 commits into
mainfrom
claude/phone-remote-persistence-u3tltd
Jun 25, 2026
Merged

Add server-synced roster so the phone remote reconnects across sessions#81
starbrightlab merged 2 commits into
mainfrom
claude/phone-remote-persistence-u3tltd

Conversation

@starbrightlab

Copy link
Copy Markdown
Owner

The phone keeps its paired-device roster ({name, base, token}) only in the
browser's localStorage. That gets evicted (Safari's ~7-day cap on an
un-installed site), starts empty in a new browser/origin, and looks brand-new
after a DHCP IP change -- so a multi-device setup has to be re-paired from
scratch every time, which is poor UX.

Back the roster up on each paired Portal: the phone pushes its full roster to
every device whenever it changes, and pulls-and-merges when it pairs one. After
a storage wipe you pair a single Portal with its PIN and the rest come back
automatically ("pair one, restore all"), instead of re-pairing the fleet.

  • RemoteRoster: SharedPreferences-backed store + a pure, unit-tested sanitiser
    (validate/dedupe-by-base/clamp/cap) so a malformed upload can't wedge it.
  • RemoteRoutes: auth-gated GET/POST /remote/roster. The on-screen PIN that mints
    a session is the same gate that releases the roster -- reading it is no more
    powerful than pairing each Portal in person.
  • RemoteHtml: push on pair/add/forget/rename; pull-and-merge on pair and on
    startup; local token always wins on conflict so a fresh session isn't clobbered.
  • Docs: reconnecting + security trade-off (tokens now also live on each Portal),
    with the home-screen-install tip as the durable-storage path.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_0163p2xPMLPceBaiNLHk2soK

claude added 2 commits June 25, 2026 05:33
The phone keeps its paired-device roster ({name, base, token}) only in the
browser's localStorage. That gets evicted (Safari's ~7-day cap on an
un-installed site), starts empty in a new browser/origin, and looks brand-new
after a DHCP IP change -- so a multi-device setup has to be re-paired from
scratch every time, which is poor UX.

Back the roster up on each paired Portal: the phone pushes its full roster to
every device whenever it changes, and pulls-and-merges when it pairs one. After
a storage wipe you pair a single Portal with its PIN and the rest come back
automatically ("pair one, restore all"), instead of re-pairing the fleet.

- RemoteRoster: SharedPreferences-backed store + a pure, unit-tested sanitiser
  (validate/dedupe-by-base/clamp/cap) so a malformed upload can't wedge it.
- RemoteRoutes: auth-gated GET/POST /remote/roster. The on-screen PIN that mints
  a session is the same gate that releases the roster -- reading it is no more
  powerful than pairing each Portal in person.
- RemoteHtml: push on pair/add/forget/rename; pull-and-merge on pair and on
  startup; local token always wins on conflict so a fresh session isn't clobbered.
- Docs: reconnecting + security trade-off (tokens now also live on each Portal),
  with the home-screen-install tip as the durable-storage path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0163p2xPMLPceBaiNLHk2soK
Installing the remote to the home screen is the durable-storage path that
complements the synced roster: an installed app's storage isn't evicted the way
a browser tab's is, so the paired roster simply persists.

- RemoteRoutes: public GET /remote/manifest.webmanifest (standalone display,
  Immortal name/colours) and GET /remote/app-icon?size= which renders the app's
  own adaptive launcher icon to PNG at the requested size -- the installed remote
  wears the same face as the app, with no new binary assets.
- RemoteHtml: link the manifest + apple-touch-icon, theme-color and iOS web-app
  meta; request navigator.storage.persist() on load; add a dismissible "Add to
  Home Screen" tip in the Devices tab (hidden once installed/standalone).
- Docs: installable-PWA note in the reconnect section + API rows.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0163p2xPMLPceBaiNLHk2soK
@starbrightlab starbrightlab merged commit 3496f6e into main Jun 25, 2026
3 checks passed
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.

2 participants