Skip to content

feat: delete machines + hide offline from settings#1073

Merged
bra1nDump merged 1 commit intomainfrom
claude/determined-nash
Apr 15, 2026
Merged

feat: delete machines + hide offline from settings#1073
bra1nDump merged 1 commit intomainfrom
claude/determined-nash

Conversation

@bra1nDump
Copy link
Copy Markdown
Contributor

Summary

Users had dead/zombie machines cluttering their machine list after daemon reauthentications (reported on Discord by ratio [CLAW]). This adds a way to clean them up without affecting session history.

  • Settings → Machines: offline machines hidden by default, with a toggle to reveal them (shows count)
  • Machine detail screen: new Danger Zone with a delete button, confirmation modal, navigates back on success
  • Server DELETE /v1/machines/:id: removes the machine + its access keys, preserves sessions, broadcasts a new delete-machine event to all the user's connected clients
  • Client sync: handles delete-machine event → removes machine from storage, drops encryption keys and machineDataKeys, guarded on local presence so stale events are no-ops

Backwards compatibility

Old clients (pre-upgrade) on the same account will receive the new delete-machine event but will safely ignore it — handleUpdate uses safeParse and drops unknown discriminants. They'll see the deleted machine disappear on next full fetch / reconnect. No hard break.

Notes for reviewer

  • Machine deletion intentionally preserves past sessions — the server has no FK from Session to Machine (machineId lives in encrypted session metadata), so nothing cascades.
  • AccessKeys must be deleted first because they have a composite FK to Machine — handled inside a single inTx block.
  • All 10 locale files updated (en, ru, it, ja, zh-Hans, zh-Hant, ca, pl, es, pt). Polish uses proper plural rules (1, 2-4, 5+, with 11-14 special case).
  • CHANGELOG bumped to v9 and changelog.json regenerated.

Test plan

  • App builds and pnpm typecheck passes in both happy-app and happy-server
  • Settings → machine list shows only online machines by default; toggle reveals offline ones with correct count
  • Delete machine from detail screen → confirmation modal → machine vanishes from list → navigation back works
  • Delete event propagates to a second device on same account (machine disappears without restart)
  • Session history for deleted machine is still viewable
  • Translations render correctly in at least one non-English locale (plural count)

🤖 Generated with Claude Code

Users had dead/zombie machines cluttering their machine list after
daemon reauthentications. Add a way to clean them up:

- Settings machine list hides offline machines by default with a
  toggle to reveal them (shows count)
- Machine detail screen has a Danger Zone with a delete button
- Server DELETE /v1/machines/:id removes the machine and its access
  keys, preserves session history, broadcasts delete-machine event
- Client sync handler removes the machine from storage and drops
  encryption keys on receipt (only if machine was in local state)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bra1nDump bra1nDump merged commit d1a22d2 into main Apr 15, 2026
1 check 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.

1 participant