Skip to content

fix(include): serialize config writes - #47

Open
t8y2 wants to merge 1 commit into
cordiverse:mainfrom
t8y2:dev/fix-include-write-queue
Open

fix(include): serialize config writes#47
t8y2 wants to merge 1 commit into
cordiverse:mainfrom
t8y2:dev/fix-include-write-queue

Conversation

@t8y2

@t8y2 t8y2 commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • serialize debounced Include config writes
  • keep later writes progressing after an earlier failure
  • flush the latest pending write during Include teardown
  • log asynchronous write failures and surface them from teardown

Why

Include writes use a shared <config>.tmp path. Once one debounced write has started, another write() call can start a second _writeFile() concurrently. The two operations can race on the temporary file, causing one rename to fail with ENOENT and leaving the rejection unobserved. Teardown also returned without waiting for the last pending write.

Validation

  • yarn lint
  • yarn build core
  • yarn build
  • yarn test:json — 20 files, 167 tests passed
  • real-file reproduction with overlapping public write() calls

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