Repository navigation
fix(team-vault): a failed secret save never passes for a saved one - #611
Merged
Merged
Conversation
A team secret whose upload failed stayed in the in-memory cache as if the server held it, then vanished at the next vault load. #609 fixed that only for a server too old for the secret's type. The cache now keeps two layers: what the server holds, and over it the values whose upload has not landed. A write shows its value from the second layer and moves it to the first only once the server has accepted it. - Refused (any 4xx except 401, 408 and 429): the value is dropped at once and the editor shows what the server holds again. - Not reached (offline, timeout, 5xx, expired session): the value stays usable, survives vault reloads, and is uploaded again after every load of the team, foreground or background, until it lands or the app closes. Nothing is written to disk, so the memory-only rule of #402 holds. Clearing the secret drops the unsent value, so a later retry cannot bring it back. Connect prompts, import, paste, duplicate, copy to vault, undo and plugin key creation only logged these failures; they now raise one toast per distinct failure. The opportunistic public-key backfill stays log-only. Keys queued by a move into a team keep their on-device copy and their sweep retry, as before. Refs #608
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 #609, for the two cases it left open (refs #608).
Problem
A team secret (password, key, passphrase, knock sequence) whose upload failed stayed in the in-memory cache as if the server held it. Reopening the editor showed it as saved, and the next vault load silently removed it. #609 fixed that only when the server is too old for the secret's type.
Change
The team secret cache now has two layers: what the server holds, and over it the values whose upload has not landed. A write shows its value from the second layer and moves it to the first only when the server has accepted it.
Server refused (any 4xx except 401, 408, 429 — so 400, 402, 403, 404, 413, 426...): the value is dropped immediately and the editor shows what the server holds again. The error reads "The team vault did not accept this, so it was not saved: …".
Server not reached (offline, timeout, 5xx, expired session, rate limit): the value stays usable for the session, survives vault reloads, and is uploaded again after every load of the team — foreground or background — until it lands or the app closes. The warning reads "Not uploaded to the team vault yet. It is kept until Voltius closes and retried the next time the vault loads: …".
Nothing is written to disk: the memory-only rule of #402 is untouched. Keys queued by a move into a team keep their existing on-device copy and sweep retry.
Also:
keepCachedOnUploadFailure→reportUploadFailure). The opportunistic public-key backfill stays log-only.Declared trade-offs
Tests
secretRouting.test.ts(refused vs unreachable by status, reload keeps the unsent value, retry, retry stops/drops, cleared-while-unsent),teamSecretCache.test.ts(layering),teamVaultSync.credentials.test.ts(foreground and background loads both retry). Full vitest suite andtscpass locally. No live run against a server; toast text only, no screenshots.