Skip to content

fix(storage): atomic account and settings writes with cross-process locking - #12

Merged
Bl0ck154 merged 1 commit into
mainfrom
integrate/atomic-storage-20261027
Oct 27, 2026
Merged

Bl0ck154 merged 1 commit into
mainfrom
integrate/atomic-storage-20261027

Conversation

@Bl0ck154

Copy link
Copy Markdown
Owner

Why

The current account and settings stores use direct file writes. Concurrent clients can overwrite one another's changes, and an interrupted write can leave a partial JSON file.

Changes

Adapt upstream PR Lampese#182 to our v0.2.21 fork:

  • Cross-process locks around read-modify-write operations in the account and settings stores.
  • Atomic replacement of accounts.json, settings.json and Codex auth.json using private temporary files and fsync.
  • Keep our workspace-aware duplicate identity and healthy/stale OAuth re-login behavior, with the same preserved UUID, labels and timestamps.
  • Preserve our upstream fix: preserve active account on add with OAuth command regression tests Lampese/codex-switcher#153 inactive-on-add semantics: adding the first account also does not switch live auth.
  • Keep existing macOS settings and account management behavior.

Validation

  • All merge conflicts manually resolved, and git diff --check passed.
  • Rust builds/tests/format checks are delegated to the GitHub PR CI because this work was prepared on a production VPS that must not compile the application.
  • Do not merge until CI passes and the OAuth/workspace regression tests are reviewed.

This is a separate branch from main, independent of the remote-dashboard security PR #11.
Original work: Lampese#182

@Bl0ck154
Bl0ck154 marked this pull request as ready for review October 27, 2026 10:51
@Bl0ck154
Bl0ck154 merged commit 76fa1c4 into main Oct 27, 2026
7 checks passed
@Bl0ck154
Bl0ck154 deleted the integrate/atomic-storage-20261027 branch October 27, 2026 10:51
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