Repository navigation
feat(app): join a hub, leave it and pair again from the app (G1) - #111
Merged
Merged
Conversation
The vault manager's "Join a vault on a hub" gets a Join panel: the hub's URL and vault name, this device's name, and a location for the new vault. It pairs where needed (shows the code to approve on the hub and waits), makes the vault, and joins; a failed join forgets the new vault. Settings, Sync, joins the window's vault, leaves (after asking), and pairs again where the hub refused the token. The flow (data/sync.ts) is notesctl hub join's, with its single re-pairing on revoked (#101). The mock notesd pairs, joins and leaves for the tests. Plan 0008: G1 built; Phase 3's item 6 in the app is still to run.
…es, cleanup and sync (cross-review, CI) - Cancel and unmount stop only the pairing wait; from vault.add on, the flow runs to its end, with errors as notices once the panel is gone (the session opens a first vault as notesd adds it). - A new vault's name follows vaultNameError, so it cannot leave the chosen location. - A failed join's cleanup says when vault.remove fails, and the list drops the vault only when notesd removed it. - The vault manager offers Join only where sync.hubs answers. - Biome's import order.
…eans up (cross-review) - A hold (holdVaultOpen) keeps the session from opening a first vault on vault.added while a join runs, so the panel, and a revoked retry's new code, stay on screen. - Back, Cancel and an unmount take one stop path: a vault the flow made and did not join is removed; a joined vault stays. Back and Cancel show only in the form and the approve phases, never while a call runs. - The vault manager's sync availability is unknown, yes or no, per client; Join shows only for yes.
…n (cross-review) holdVaultOpen returns a one-shot release, and the session opens no first vault while any hold stands, so a cancelled flow that ends late no longer clears the hold of the flow that replaced it.
…ates B's join (cross-review) Flow A's removal keeps its folder, so flow B makes its vault under another parent. The mock's holdJoins and releaseJoins hold B's sync.join until the test has checked that B's panel stays.
…-app # Conflicts: # app/src/app/Settings.tsx # docs/specs/ui.md
bketelsen
approved these changes
Oct 28, 2026
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.
Plan 0008, gap G1 (Brian's day line 7, T377a): sync with a hub with no terminal. Today a Flatpak user must type
flatpak run --command=notesctl org.frostyard.Frostnotes hub join ….What.
vaultNameError, so it cannot leave the location), this device's name (optional), and a location (Browse, or a typed path where there is no picker). It pairs where needed, shows the code andnotesctl hub approve CODEfor the hub's machine, and waits; then it makes<location>/<hub vault>(vault.addwithcreate) and joins. Join shows only wheresync.hubsanswers (unknown, yes, no per client), and never inside lodge.revoked.app/src/data/sync.ts) isnotesctl hub join's (cmd/notesctl/hub.go): pair only with a hub not paired before; onrevokedfromsync.joinfor a paired hub, pair again once and join again (fix(sync): hub join pairs again when the hub revoked the device's token #101). Pair again alone replaces the token and wakes every vault on that hub.app/src/app/JoinHub.tsx): the panel stays while its flow runs. A counted hold (holdVaultOpen, one release per flow) keeps the session from opening a first vault onvault.added, so a revoked retry's new code stays on screen. Back, Cancel and closing the panel take one stop path: a vault the flow made and did not join is removed (a removal failure is shown); a joined vault stays. Back and Cancel show only in the form and approve phases, never while a call runs.revoked, expire or hold a pairing, and hold a join, for the tests.No API change:
sync.hubs,sync.pair,sync.paired,sync.join,sync.leaveexist.Tests (Vitest).
data/sync.test.ts(new hub; paired hub; revoked → 1 re-pair; revoked twice; expired; cancel; pair again);features/sync/JoinHubForm.test.tsx; Settings' Sync rows; the vault manager's Join, availability states, the first-vault revoked retry, Back, Cancel and close with cleanup, the late-cancel hold race; the session hold.Docs.
docs/specs/ui.md(Vault manager, Settings),docs/design/sync.md(Pairing and sessions), plan 0008 (G1 built; Phase 3 item 6 in the app is still to run).Note. #110 (G2) also adds a last argument to
settingsSections; whichever merges second needs a small rebase.Review. Cross-review by openai/gpt-6.1-sol: 1 review, 3 re-reviews and 1 extra re-review authorized by Brian (T394b); Ready at
ac77d82, blocking: none.Coder: deepseek/deepseek-flash (subagent); parent: Irulan.