feat(dweb): user kill switch to shut down all dweb networking - #14
Merged
Conversation
Symmetric to "Start the network": a new dweb/base/stop SW route persists dwebEnabled=false (so it won't auto-restart on unlock — maybeStartBaseNetwork gates on it) and tears down a live host via the existing complete offscreen teardown (closes every room, drops the mesh + lobby, clears the re-sub timer), without spawning the offscreen just to stop. A confirm-gated "Stop the network" control in the home Network section drives it. Implements docs/specs/FEATURE-FIRST-CLASS-MESSAGING.md section 2 (the kill switch / master off). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 tasks
6 tasks
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.
Implements the network kill switch from
docs/specs/FEATURE-FIRST-CLASS-MESSAGING.md§2 — turning the dweb on is a deliberate user action, so shutting it down must be one too.What
dweb/base/stopSW route (background/routes/dweb.js) — symmetric todweb/base/start:dwebEnabled = falsefirst, so it won't auto-restart on the next unlock (maybeStartBaseNetworkalready gates on the setting,service-worker.js:2639).dweb/base-host/stop,offscreen/dweb-base.js:388-397: closes every room, drops the mesh + lobby, clears the re-sub timer).getContextsfirst).DWEB_ENABLEDonly (notdwebOn()) so it can stop precisely as it flips the setting off.home/network-section.js), confirm-gated since it drops live connections.Net effect: one user action turns all dweb networking off and keeps it off until they start it again — also the master fail-closed for the §7 unattended messaging surface once that lands.
Scope
The offscreen-side teardown already existed and is complete; this PR wires it to a user-reachable route + UI. The inbound-monitor teardown referenced in spec §2 is N/A until those monitors exist (workstream B).
Verification
bun run lintandbun run typecheckclean. (Extension UI/SW — not dev-server-previewable; reload the unpacked extension to exercise.)🤖 Generated with Claude Code