From 2c59eeb75035abf3c0fe8b1237c5b48ccb65bc7c Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 22 Aug 2023 21:53:44 +0200 Subject: [PATCH] fix request armageddon on flow status update for inner flows --- frontend/src/lib/components/FlowStatusViewer.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/FlowStatusViewer.svelte b/frontend/src/lib/components/FlowStatusViewer.svelte index 6a470d00d4..1ef9b9ee18 100644 --- a/frontend/src/lib/components/FlowStatusViewer.svelte +++ b/frontend/src/lib/components/FlowStatusViewer.svelte @@ -17,6 +17,7 @@ import JobArgs from './JobArgs.svelte' import { Loader2 } from 'lucide-svelte' import FlowStatusWaitingForEvents from './FlowStatusWaitingForEvents.svelte' + import { deepEqual } from 'fast-equals' const dispatch = createEventDispatcher() @@ -101,17 +102,21 @@ mod.type === FlowStatusModule.type.WAITING_FOR_EXECUTOR && localFlowModuleStates[mod.id ?? '']?.scheduled_for == undefined ) { + console.debug('updating', mod.job) JobService.getJob({ workspace: workspaceId ?? $workspaceStore ?? '', id: mod.job ?? '' }).then((job) => { - localFlowModuleStates[mod.id ?? ''] = { + const newState = { type: mod.type, scheduled_for: job?.['scheduled_for'], job_id: job?.id, parent_module: mod['parent_module'], args: job?.args } + if (!deepEqual(newState, localFlowModuleStates[mod.id ?? ''])) { + localFlowModuleStates[mod.id ?? ''] = newState + } }) } })