secret unlocker select and unlocker remove fail when another unlocker's metadata is corrupt #72

Open
opened 2026-10-03 16:58:50 +02:00 by clawbot · 0 comments
Collaborator

Found in the review of #61.

Problem

findUnlockerByID in internal/vault/unlockers.go returns an error as soon as it meets an unlocker directory whose unlocker-metadata.json is not valid JSON. When such a directory sorts before the target, secret unlocker select ID and secret unlocker remove ID fail outright, even though the target itself is fine. #61 makes secret unlocker list skip such a directory with a warning, so the user can now see the target but still cannot select or remove it, nor remove the corrupt one by its ID.

Definition of done

  • Looking up an unlocker by ID skips a directory whose metadata cannot be read or parsed, with the same secret.Warn() naming the directory that listing gives, and still finds the target.
  • A corrupt unlocker can still be removed (by its directory name, which listing shows).
  • Tests: with a corrupt unlocker sorting before the target, select and remove of the target succeed; removing the corrupt one succeeds.
  • TODO.md updated in the same commit.

Sequencing

After #61 lands (same file).

Model: opus-5-5

Found in the review of https://git.eeqj.de/sneak/secret/pulls/61. ## Problem `findUnlockerByID` in `internal/vault/unlockers.go` returns an error as soon as it meets an unlocker directory whose `unlocker-metadata.json` is not valid JSON. When such a directory sorts before the target, `secret unlocker select ID` and `secret unlocker remove ID` fail outright, even though the target itself is fine. https://git.eeqj.de/sneak/secret/pulls/61 makes `secret unlocker list` skip such a directory with a warning, so the user can now see the target but still cannot select or remove it, nor remove the corrupt one by its ID. ## Definition of done - Looking up an unlocker by ID skips a directory whose metadata cannot be read or parsed, with the same `secret.Warn()` naming the directory that listing gives, and still finds the target. - A corrupt unlocker can still be removed (by its directory name, which listing shows). - Tests: with a corrupt unlocker sorting before the target, `select` and `remove` of the target succeed; removing the corrupt one succeeds. - `TODO.md` updated in the same commit. ## Sequencing After https://git.eeqj.de/sneak/secret/pulls/61 lands (same file). Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/secret#72