Skip to content

Corrupt local state is silently reset and can destroy provisional recipient keys - #18

Open
dipeshbabu wants to merge 3 commits into
subconscious-systems:mainfrom
dipeshbabu:fix/state-preservation
Open

dipeshbabu wants to merge 3 commits into
subconscious-systems:mainfrom
dipeshbabu:fix/state-preservation

Conversation

@dipeshbabu

Copy link
Copy Markdown

readState catches every error and returns empty state. A subsequent upload writes over the damaged file, discarding provisional private keys and passphrases; direct writes can also leave a truncated state file after interruption.

Fail clearly while preserving invalid state and replace validated state through a private temporary file and rename. Tests prove corrupt and unsupported state cannot be overwritten and successful writes leave no temporary files.

Validation: frozen-lockfile dependencies, typecheck, full tests, npm build, and bundled CLI version/help smoke checks. Ubuntu/Windows Node 20/22 CI passed before PR creation on this exact head commit (491a2b6): https://github.com/dipeshbabu/vibi-cli/actions/runs/37263133739

This branch includes the CI foundation from #2; merging that PR first removes the common CI changes from this diff.

Closes #17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Corrupt local state is silently reset and can destroy provisional recipient keys

1 participant