Skip to content

fix(cli): isolate concurrent credential temp files - #978

Open
WNZhao wants to merge 1 commit into
profullstack:masterfrom
WNZhao:fix/credentials-concurrent-writes
Open

fix(cli): isolate concurrent credential temp files#978
WNZhao wants to merge 1 commit into
profullstack:masterfrom
WNZhao:fix/credentials-concurrent-writes

Conversation

@WNZhao

@WNZhao WNZhao commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • give every credential write a unique temporary path
  • clean up the temporary file when an atomic write fails
  • add a regression test covering 20 concurrent writes

Bug

writeCredentials previously reused credentials.json.tmp. Concurrent login/session writers raced on that file: one rename succeeded while the rest failed with ENOENT. In a local reproduction, 19 of 20 writes failed.

Verification

  • pnpm exec vitest run packages/cli/src/credentials.test.ts (3 tests passed)
  • concurrent reproduction after the patch: 20 fulfilled, 0 rejected

pnpm --filter @profullstack/sh1pt typecheck remains blocked by pre-existing unresolved workspace-package build outputs (for example @profullstack/sh1pt-core); the focused test passes.

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.

1 participant