Skip to content

feat: forget registered machines from HOSTS - #304

Merged
chareice merged 1 commit into
mainfrom
feat-forget-machine
Aug 30, 2026
Merged

feat: forget registered machines from HOSTS#304
chareice merged 1 commit into
mainfrom
feat-forget-machine

Conversation

@chareice

Copy link
Copy Markdown
Collaborator

What

HOSTS accumulated stale machines (localhost.localdomain, old hostnames) with no way to drop them. Disconnect only marked a machine offline; the DB row lived forever, and the UI had add but not remove.

  • API: DELETE /api/machines/:id forgets a machine you own. Drops a live connection if any, deletes the DB row (CASCADE tabs / sessions / bookmarks), and broadcasts machine_removed.
  • Bootstrap: every registered machine is listed, including never-connected / empty offline hosts, so they can be forgotten after reload.
  • Desktop: right-click a host in the sidebar → Remove host → confirm.
  • Mobile: X on the host sheet row, same confirmation.
  • CLI: webmux machines --all lists offline hosts; webmux machines rm <id|name> [--yes] forgets one (unique name, otherwise id).

Online hosts can be forgotten too; the confirm copy warns they will not reconnect until re-registered.

Verification

  • cargo test -p tc-hub 107 passed
  • cargo test -p tc-cli 52 passed
  • pnpm test 351 passed
  • pnpm typecheck clean
  • pnpm e2e:test 91/91, including new forget-host.spec.ts (register a throwaway host, cancel, then remove)

Stale hosts stayed in the sidebar forever: disconnect only marked them
offline, and there was no API, CLI, or UI to drop the hub record.

Add DELETE /api/machines/:id (cascades tabs/sessions/bookmarks), a
machine_removed event, sidebar/mobile Remove host with confirmation,
and `webmux machines rm`. Bootstrap now lists every registered host so
empty offline machines can be forgotten after reload.
@chareice
chareice merged commit 9efcd33 into main Aug 30, 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.

1 participant