fix(vault): open pre-v0.4.0 external vaults - #420
Merged
Conversation
…l not An external vault created before the link registry existed has no storage_path in its saved config, and NewExternalVaultProvider now requires one. The default was only applied when creating a vault, not when opening one, so every such vault failed to open after upgrading. Worse, `vault list` called Fatalf on the first vault it could not open, so a single bad vault produced no output at all. In the desktop that surfaced as an empty, disabled vault dropdown with no indication why. A vault that cannot be opened is now listed with an `error` field and the rest still load. Verified against a real config carrying an old external vault, and against a vault broken in a way defaults cannot repair. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Follow-up to #419. Two bugs that together made the desktop's vault dropdown come up empty and disabled.
An external vault created before v0.4.0 cannot be opened
Those configs have no
storage_path, andNewExternalVaultProvidernow requires one. The default was applied when creating a vault but not when opening one, so every pre-existing external vault broke on upgrade:applyExternalDefaultsnow runs on both paths.One unopenable vault hid every other one
PrintVaultListcalledFatalfon the first vault it could not open, so a single bad vault produced no output at all rather than one bad row. The TUI list view did the same viaNewErrorView.A vault that will not open is now listed with an
errorfield, and the rest still load. This matters beyond the bug above — a missing key env var or a revoked age identity would have blanked the whole list the same way.Verified
Against a real config carrying a pre-v0.4.0 external vault: it opens cleanly once the default applies, and all four vaults list.
Against an isolated config with a vault broken in a way defaults cannot repair: it shows as
type=unknownwith its error while the healthy vault still lists.0 issuesfrom golangci-lint v2.5.0; tests pass.🤖 Generated with Claude Code