Repository navigation
fix(extensions): keep Windows settings saves atomic while a reader is active - #995
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Merged, thanks @mouzhi! This is the same EPERM rename failure that has been showing up on main's Windows CI in desktop-extension-data.test.ts, and the PR head's Windows job passed that file. |
Summary
Saving Desktop extension settings can fail on Windows while a reader still has
settings.jsonopen. Keep the complete replacement file beside its destination and retry the atomic rename on Windows sharing errors. Five bounded delays allow 560 ms for a reader to finish. A persistent failure reaches the caller and the temporary file is cleaned up.Related issues
Observed in the Windows check on #948 after the Desktop extensions merge in #992. The same failure reproduced locally against
mainwith a real open file handle.Test plan
EPERMbefore the change and passed after it.git diff --checkpassed.The change is confined to saving Desktop extension settings and can be reverted without a data migration.
The branch inherits the nine TypeScript errors on
maintracked in #994. As an integration check, I combined #994, this change, and the heads of #948, #978, and #990 in a disposable worktree.npm run typecheck,npm run lint, andnpm run format:checkall passed.