From 1573de63d43e45256d97c6143d6bb5de22338579 Mon Sep 17 00:00:00 2001 From: Pat Cavit Date: Wed, 27 Mar 2019 23:16:35 -0700 Subject: [PATCH] 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 :disappointed: --- packages/processor/processor.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/processor/processor.js b/packages/processor/processor.js index 32da1b22a..15b81b049 100644 --- a/packages/processor/processor.js +++ b/packages/processor/processor.js @@ -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