Skip to content

Commit

Permalink
fix: break link between cache and context state
Browse files Browse the repository at this point in the history
Signed-off-by: James <james@union.ai>
  • Loading branch information
james-union committed Mar 30, 2023
1 parent 0c5c96b commit f3339c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ export const NodeExecutionDetailsContextProvider = (props: ProviderProps) => {
name,
version,
};
const workflow = await fetchWorkflow(queryClient, workflowId);
if (!workflow) {
const result = await fetchWorkflow(queryClient, workflowId);
if (!result) {
resetState();
return;
}

const workflow = JSON.parse(JSON.stringify(result));
const tree = createExecutionDetails(workflow);
if (isCurrent) {
setClosure(workflow.closure?.compiledWorkflow ?? null);
Expand Down
3 changes: 3 additions & 0 deletions packages/console/src/components/Workflow/workflowQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export function makeWorkflowQuery(

return workflow;
},
// `Workflow` objects (individual versions) are immutable and safe to
// cache indefinitely once retrieved in full
staleTime: Infinity,
};
}

Expand Down

0 comments on commit f3339c9

Please sign in to comment.