fix(@angular/build): deduplicate spurious chokidar polling change events - #34188
Closed
alan-agius4 wants to merge 3 commits into
Closed
alan-agius4 wants to merge 3 commits into
alan-agius4 wants to merge 3 commits into
Conversation
alan-agius4
marked this pull request as ready for review
September 28, 2026 11:01
There was a problem hiding this comment.
Code Review
This pull request introduces a fileStats map to track the modification times and sizes of watched files, helping to prevent redundant change events when no actual modifications have occurred. The review feedback highlights a performance concern where synchronous file system operations (fs.statSync) are used inside the asynchronous next() method, which could block the Node.js event loop when processing many files. It is recommended to use asynchronous operations with Promise.all instead.
alan-agius4
force-pushed
the
fix/inline-style-language-flaky
branch
from
September 28, 2026 11:42
d040364 to
217669f
Compare
When using Chokidar in polling mode, non-atomic file writes (such as open with O_TRUNC followed by write) can span across poll intervals and cause Chokidar to emit two 'change' events for a single file modification. If the initial rebuild completes quickly (e.g. in JIT mode), the trailing poll event can flush a second rebuild batch with the same file state. Track the last known mtimeMs and size of watched files in createChokidarWatcher and ignore 'modified' events when the file's mtimeMs and size have not changed since the previous queued or flushed event.
alan-agius4
force-pushed
the
fix/inline-style-language-flaky
branch
from
September 28, 2026 11:47
217669f to
ae097a0
Compare
clydin
approved these changes
Sep 28, 2026
Member
clydin
pushed a commit
that referenced
this pull request
Sep 28, 2026
…nts (#34188) When using Chokidar in polling mode, non-atomic file writes (such as open with O_TRUNC followed by write) can span across poll intervals and cause Chokidar to emit two 'change' events for a single file modification. If the initial rebuild completes quickly (e.g. in JIT mode), the trailing poll event can flush a second rebuild batch with the same file state. Track the last known mtimeMs and size of watched files in createChokidarWatcher and ignore 'modified' events when the file's mtimeMs and size have not changed since the previous queued or flushed event. PR Close #34188
clydin
pushed a commit
that referenced
this pull request
Sep 28, 2026
angular-robot
pushed a commit
to angular-robot/angular-cli
that referenced
this pull request
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using Chokidar in polling mode, non-atomic file writes (such as open with O_TRUNC followed by write) can span across poll intervals and cause Chokidar to emit two 'change' events for a single file modification. If the initial rebuild completes quickly (e.g. in JIT mode), the trailing poll event can flush a second rebuild batch with the same file state.
Track the last known mtimeMs and size of watched files in createChokidarWatcher and ignore 'modified' events when the file's mtimeMs and size have not changed since the previous queued or flushed event.