Repository navigation
Fix watch mode ignoring a file saved right after a rebuild started - #9403
Conversation
After a build, the native watcher took one snapshot of the sources to find what changed and then a second as the baseline for the next round. A file saved between the two was in the baseline but was never reported to a build, so watch mode ignored it until the file changed again. That is the flaky "watch-retained-graph" test on macOS: B.res, saved right after C.res, never got recompiled. The changes now come from the snapshot that becomes the baseline, as the polling watcher already does. A unit test injects the watcher's source discovery, which runs between the two snapshots, to edit a file exactly there, and checks that the next build reports it. It fails with the old snapshot order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QchYQ7itFLVLUmZ368okjH Signed-off-by: Christoph Knittel <ck@cca.io>
|
@codex review |
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. |
Changelog🐛 Bug fix
Semantic Diff1 commit · Full page Rebuild edits made between the watcher's two snapshots074a99c · cknitt + Claude · Nov 24, 2026, 07:47 UTC After a build, the native watcher took one snapshot of the sources to find what changed and then a second as the baseline for the next round. A file saved between the two was in the baseline but was never reported to a build, so watch mode ignored it until the file changed again. That is the flaky "watch-retained-graph" test on macOS: B.res, saved right after C.res, never got recompiled. The changes now come from the snapshot that becomes the baseline, as the polling watcher already does. A unit test injects the watcher's source discovery, which runs between the two snapshots, to edit a file exactly there, and checks that the next build reports it. It fails with the old snapshot order. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
✅ Compiler benchmarksAllocated wordsIn total: 637,411,500 → 637,411,236 (±0.00%). Generated projects: 629,041,985 → 629,041,568 (±0.00%). None of the 265 benchmarks changed by 0.1% or more. InstructionsIn total: 9,221,420,412 → 9,221,420,412 (±0.00%). None of the 33 benchmarks changed by 0.1% or more. Output sizeIn total: 25,987,723 → 25,987,723 (±0.00%). None of the 13 benchmarks changed by 0.1% or more. Pull request 074a99c compared with base 45dba2c in this run. |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-9403 |
Watch mode could ignore a saved file until it changed again. This is what made the "watch-retained-graph" test flaky on macOS CI:
B.reswas saved right afterC.res, andB.jswas never recompiled.After a build, the native watcher took one snapshot of the sources to find what changed, then a second one as the baseline for the next round. A file saved between the two was already in the baseline, but no build was told about it. The changes now come from the snapshot that becomes the baseline, which is what the polling watcher already does.
New test:
tests/rewatch_ounit_tests/watcher_tests.mlinjects the watcher's source discovery, which runs between the two snapshots, so it can edit a file exactly in that window. It checks that the next build reports the edit. It fails every time with the old snapshot order. Injectingdiscoverworks the same way as the existingnative_createinjection.🤖 Generated with Claude Code
https://claude.ai/code/session_01QchYQ7itFLVLUmZ368okjH