diff --git a/lerna.json b/lerna.json index 4192189369..afd0db6374 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "3.2.25", + "version": "3.2.26", "npmClient": "yarn", "concurrency": 20, "command": { diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte index 5ec66870a8..eebd977e6c 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/TestDataModal.svelte @@ -46,7 +46,7 @@ } } else { // Leave the core data as it is - return testData + return cloneDeep(testData) } } @@ -63,7 +63,10 @@ return true } - $: testData = testData || parseTestData($selectedAutomation.data.testData) + $: currentTestData = $selectedAutomation.data.testData + + // Can be updated locally to avoid race condition when testing + $: testData = parseTestData(currentTestData) $: { // clone the trigger so we're not mutating the reference @@ -85,7 +88,7 @@ required => testData?.[required] || required !== "row" ) - function parseTestJSON(e) { + async function parseTestJSON(e) { let jsonUpdate try { @@ -105,7 +108,9 @@ } } - automationStore.actions.addTestDataToAutomation(jsonUpdate) + const updatedAuto = + automationStore.actions.addTestDataToAutomation(jsonUpdate) + await automationStore.actions.save(updatedAuto) } const testAutomation = async () => { @@ -150,10 +155,14 @@ {#if selectedValues}