Skip to content

gui: Danger Zone in the Updates tab — forget-all / factory reset#106

Merged
mrjeeves merged 1 commit into
mainfrom
claude/node-eviction-role-downgrade-k54mhp
Jul 23, 2026
Merged

gui: Danger Zone in the Updates tab — forget-all / factory reset#106
mrjeeves merged 1 commit into
mainfrom
claude/node-eviction-role-downgrade-k54mhp

Conversation

@mrjeeves

Copy link
Copy Markdown
Owner

What

Adds an in-app way to reset a node, so recovering a wedged install doesn't mean hand-deleting files under ~/.myownmesh. A Danger Zone card at the bottom of Settings → Updates with two graduated, two-click-armed actions:

  • Forget all meshes — leave and purge every network (rosters + signed governance state), keeping the device identity.
  • Factory reset — wipe the entire state directory (identity, config, all networks); the device becomes brand-new to every peer.

Why the reboot

Both actions reboot the whole stack when they fire. The daemon is the real datastore, so a reset that only deletes files gets undone by in-memory caches re-persisting on the next write — the classic "I deleted it but it came back." So each command wipes on disk, then the daemon exits; the GUI relaunches the app, and a fresh daemon comes up on clean state (via the existing ensure_daemon_running path, or the supervising service).

Changes

Daemon control protocol (crates/myownmesh/src/control.rs)

  • Request::ForgetAllNetworks — bulk NetworkRemove{purge:true} over every network in the registry.
  • Request::FactoryReset — quiesce each network (so nothing re-persists mid-wipe), then remove_dir_all the state dir.
  • schedule_daemon_exit() — both exit ~400 ms after the response flushes, so a fresh daemon reloads clean.

GUI (gui/src-tauri, gui/src)

  • mesh_forget_all_networks / mesh_factory_reset / restart_app Tauri commands (restart_app waits out the daemon's exit, then app.restart()).
  • meshClient.forgetAllNetworksAndRestart / factoryResetAndRestart.
  • The Danger Zone UI in UpdatesSection.svelte (confirm-armed buttons, always shown so it's reachable even if update status fails to load).

Testing

Daemon + Tauri crates: cargo build / clippy --all-targets -D warnings / fmt clean (pinned 1.88.0). Frontend: svelte-check clean (0 errors).

⚠️ The wipe and backend are compile-verified, but the reboot lifecycle (daemon self-exit → app relaunch → fresh daemon) can't be exercised in CI — it wants a smoke test on a real desktop install. The AllMyStuff side (its node supervises the daemon and also owns the ownership file + the fleet-leave level) will follow as a separate PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_018x1RV6ppUdMDTHxScVo26L


Generated by Claude Code

Adds an in-app way to reset a node, so recovering a wedged install doesn't
mean hand-deleting files under ~/.myownmesh. A "Danger Zone" card at the
bottom of Settings → Updates offers two graduated, two-click-armed actions:

  - **Forget all meshes** — leave and purge every network (rosters + signed
    governance state), keeping the device identity.
  - **Factory reset** — wipe the entire state directory (identity, config, all
    networks); the device becomes brand-new to every peer.

Both reboot the whole stack when they fire. The daemon is the real datastore,
so a reset that only deletes files would be undone by in-memory caches
re-persisting on the next write — the classic "I deleted it but it came
back". So each command wipes on disk, then the daemon exits; the GUI relaunches
the app, and a fresh daemon comes up on clean state (via the existing
ensure_daemon_running path, or the supervising service).

Backend (daemon control protocol):
  - `Request::ForgetAllNetworks` — bulk `NetworkRemove{purge:true}` over every
    network in the registry.
  - `Request::FactoryReset` — quiesce each network, then `remove_dir_all` the
    state dir.
  - `schedule_daemon_exit()` — both exit shortly after the response flushes.

GUI: `mesh_forget_all_networks` / `mesh_factory_reset` / `restart_app` Tauri
commands (the last waits out the daemon's exit, then `app.restart()`),
`meshClient.forgetAllNetworksAndRestart` / `factoryResetAndRestart`, and the
Danger Zone UI.

Note: the wipe + backend compile/clippy/type-check clean, but the reboot
lifecycle (daemon self-exit → app relaunch → fresh daemon) can't be exercised
in CI and wants a smoke test on a real desktop install.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018x1RV6ppUdMDTHxScVo26L
@mrjeeves
mrjeeves merged commit f394f04 into main Jul 23, 2026
10 checks passed
@mrjeeves
mrjeeves deleted the claude/node-eviction-role-downgrade-k54mhp branch July 23, 2026 17:51
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