Repository navigation
fix(desktop): tell of a vault a cancelled join leaves on the list - #199
Merged
Merged
Conversation
Since #182 a join drops every answer from a run that is no longer current, and every cancel makes it so. A cleanup failure after a cancel, and vault.add's lost answer, were dropped with it, so a vault could stay on the list unannounced (X56 again, and X54's rest). Those two failures are now a vaultLeft, which shows as a notice when its run is stale; any other stale answer is still dropped (#164). A run is now a ticket, not a count: the vault manager's reset zeroes the flow, and a count started again at a number an older run held, so that run's answer could finish the new one. Fixes #194.
frostyard-machines
approved these changes
Nov 11, 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.
Summary
Fixes #194.
The bug: since #182 (
9b369da, for #164), the join flow drops any answer whose run is no longer current. Every cancel makes the run stale. So when a join was cancelled and its vault couldn't be removed from the list, the warning was dropped, and so wasvault.add's lost-answer warning (#176). The vault stayed on the list and the user wasn't told. That is X56 again, and the part of X54 that #176 left (review of #145).This PR:
vaultLeft) now shows as a notice when its run was cancelled or replaced. The two such failures arecleanupFailedand the lost answer ofvault.add. Any other stale answer is still dropped, so a stale join still can't finish the new run (desktop: a finished join isn't checked against the current one #164). The cleanup message now says "the join was cancelled" instead of "context canceled".reset()zeroes the join flow when the manager closes. So a count restarted at 1 for the next run, a number an older run still held, and that run's answer could finish the new one. Each run now gets its own*joinTicket.docs/specs/ui.md(the join panel) says what a stopped flow shows: nothing, except a vault that may stay on the list. It already required a notice "where the panel is gone".desktoptest.StartNotesdWithpasses rpctest's options, so a test can swap in a fake domain of a real notesd.Not changed: if a join succeeds just before the cancel lands, its answer is still dropped. The vault it joined shows up in the list through notesd's
vault.addedevent.Risk tier
Risk tier: 2. This changes behavior in the desktop window. No changed path is in
.github/risk-paths.json, so it gets the default L3.Verification
make checkgreen (host)Race detector on
./internal/desktop/window/and./internal/desktop/desktoptest/;make desktop-buildRevert test. With
main'sinternal/desktop/window/vaults.go(812bc59) under the new tests:TestACancelledJoinStillTellsOfTheVaultItLeftfails withtimed out waiting for the warning.TestAnAnswerFromBeforeTheDialogClosedIsStalefails withthe answer from before the dialog closed finished the new join: "invalidParams: \":invalid\" is not a hub URL".With the fix but no notice, the first test still fails. Command:
go test -count=1 -run 'TestACancelledJoinStillTellsOfTheVaultItLeft|TestAnAnswerFromBeforeTheDialogClosedIsStale' ./internal/desktop/window/Guard and 1
.memory/corrections.jsonlline addedThe tests:
TestACancelledJoinStillTellsOfTheVaultItLefttakes the real path. It runs a real notesd with two fake domains: sync is paired with one hub, and itssync.joinholds. Vault refusesvault.remove. The test opens Manage vaults, clicks Join, fills the panel and clicks Join again. While notesd is joining, it presses Escape. Then it checks for a notice naming "Shared", saying the join was cancelled, and pointing to Manage vaults.TestAnAnswerFromBeforeTheDialogClosedIsStalecloses the manager between two joins and replays the older run's answer.TestLostAddAnswerExplainsPossibleVaultnow also checks that the lost answer is avaultLeft.