Skip to content

Commit

Permalink
fix: fix walking invalidated dependencies
Browse files Browse the repository at this point in the history
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 😞
  • Loading branch information
tivac committed Mar 28, 2019
1 parent 6d6620c commit 1573de6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/processor/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,17 @@ class Processor {

// Walk this node's dependencies, reading new files from disk as necessary
await Promise.all(
this._graph.dependenciesOf(name).map((dependency) => (
dependency in this._files ?
this._files[dependency].walked :
this.file(dependency)
))
this._graph.dependenciesOf(name).map((dependency) => {
const { valid, walked : complete } = this._files[dependency] || false;

// If the file hasn't been invalidated wait for it to be done processing
if(valid) {
return complete;
}

// Otherwise add it to the queue
return this.file(dependency);
})
);

// Mark the walk of this file & its dependencies complete
Expand Down

0 comments on commit 1573de6

Please sign in to comment.