From d08b0902f81bac6bf3a3e94c2aa6d7508d5ece99 Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Fri, 26 Jan 2024 09:32:28 -0700 Subject: [PATCH] fix(#497): set validty before using it when updating interaction call --- src/core/modules/impl/DefaultStateEvaluator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/modules/impl/DefaultStateEvaluator.ts b/src/core/modules/impl/DefaultStateEvaluator.ts index 51c98b6..2ce4062 100644 --- a/src/core/modules/impl/DefaultStateEvaluator.ts +++ b/src/core/modules/impl/DefaultStateEvaluator.ts @@ -252,6 +252,8 @@ export abstract class DefaultStateEvaluator implements StateEvaluator { if (result.type !== 'ok') { errorMessages[missingInteraction.id] = errorMessage; } + const isValidInteraction = result.type === 'ok'; + validity[missingInteraction.id] = isValidInteraction; this.logResult(result, missingInteraction, executionContext); @@ -270,8 +272,6 @@ export abstract class DefaultStateEvaluator implements StateEvaluator { throw new Error(`Exception while processing ${JSON.stringify(interaction)}:\n${result.errorMessage}`); } - const isValidInteraction = result.type === 'ok'; - validity[missingInteraction.id] = isValidInteraction; currentState = result.state; const toCache = new EvalStateResult(currentState, validity, errorMessages);