Skip to content

connection-state: write the host state record atomically (temp + rename) #808

Closed

Description

@tps-flint

Follow-up from the #794 review (non-blocking, pre-existing):

writeHostState (packages/cli/src/utils/connection-state.ts) writes the host state record in place. Write it to a temp file in the same directory and rename it over the record, so a failed write leaves the previous record intact rather than a partial one. Keep the 0600 mode on the temp file before the rename. Test: a write that fails after the temp is created leaves the old record byte-identical and no temp file behind.

Refs #794.

Activity

  1. moved this to Triage in Office queueon Nov 7, 2026
  2. self-assigned this
    on Nov 7, 2026
  3. moved this from Triage to In review in Office queueon Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions