From 44e88712f34c3a4155a61b7767c8171454dea7c5 Mon Sep 17 00:00:00 2001 From: Thorarinn Sigurdsson Date: Mon, 4 Mar 2019 11:31:03 +0100 Subject: [PATCH] fix: ensure module is up to date in watch handler Before this fix, the module provided to the change handlers of watch-mode commands didn't have an up-to-date version, reflecting the latest dirty timestamp of the changed module. This resulted in errors due to version discrepancies between e.g. build and deploy tasks in watch mode commands. --- garden-service/src/process.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/garden-service/src/process.ts b/garden-service/src/process.ts index 907aaf269b..3ebb2d6230 100644 --- a/garden-service/src/process.ts +++ b/garden-service/src/process.ts @@ -161,7 +161,11 @@ export async function processModules( // Update the config graph graph = await garden.getConfigGraph() - await Bluebird.map(changeHandler!(graph, changedModule), (task) => garden.addTask(task)) + // Make sure the module's version is up to date. + const refreshedModule = await graph.getModule(changedModule.name) + modulesByName[event.name] = refreshedModule + + await Bluebird.map(changeHandler!(graph, refreshedModule), (task) => garden.addTask(task)) await garden.processTasks() }) })