Skip to content

Commit 1573de6

Browse files
committed
fix: fix walking invalidated dependencies
When invalidation was added in #532 I apparently forgot to account for it withiin the dependency walking code, so invalidated files wouldn't ever be rewalked. This has likely been causing a variety of nasty-to-debug errors in the wild 😞
1 parent 6d6620c commit 1573de6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

packages/processor/processor.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,17 @@ class Processor {
430430

431431
// Walk this node's dependencies, reading new files from disk as necessary
432432
await Promise.all(
433-
this._graph.dependenciesOf(name).map((dependency) => (
434-
dependency in this._files ?
435-
this._files[dependency].walked :
436-
this.file(dependency)
437-
))
433+
this._graph.dependenciesOf(name).map((dependency) => {
434+
const { valid, walked : complete } = this._files[dependency] || false;
435+
436+
// If the file hasn't been invalidated wait for it to be done processing
437+
if(valid) {
438+
return complete;
439+
}
440+
441+
// Otherwise add it to the queue
442+
return this.file(dependency);
443+
})
438444
);
439445

440446
// Mark the walk of this file & its dependencies complete

0 commit comments

Comments
 (0)