gui: Danger Zone in the Updates tab — forget-all / factory reset#106
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: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_runningpath, or the supervising service).Changes
Daemon control protocol (
crates/myownmesh/src/control.rs)Request::ForgetAllNetworks— bulkNetworkRemove{purge:true}over every network in the registry.Request::FactoryReset— quiesce each network (so nothing re-persists mid-wipe), thenremove_dir_allthe 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_appTauri commands (restart_appwaits out the daemon's exit, thenapp.restart()).meshClient.forgetAllNetworksAndRestart/factoryResetAndRestart.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/fmtclean (pinned 1.88.0). Frontend:svelte-checkclean (0 errors).🤖 Generated with Claude Code
https://claude.ai/code/session_018x1RV6ppUdMDTHxScVo26L
Generated by Claude Code