Skip to content

Automate browser based workflows with AI

Add better cache invalidation for history (#1838)

Shuchang Zhengae9380f03f4a
diff --git a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
index aaf809c4d..1609d9d4d 100644
--- a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx
@@ -173,6 +173,9 @@ function CreateNewTaskForm({ initialValues }: Props) {
queryClient.invalidateQueries({
queryKey: ["tasks"],
});
+ queryClient.invalidateQueries({
+ queryKey: ["runs"],
+ });
},
});
diff --git a/skyvern-frontend/src/routes/tasks/create/ExampleCasePill.tsx b/skyvern-frontend/src/routes/tasks/create/ExampleCasePill.tsx
index df9b8baf0..d68169a3f 100644
--- a/skyvern-frontend/src/routes/tasks/create/ExampleCasePill.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/ExampleCasePill.tsx
@@ -40,6 +40,9 @@ function ExampleCasePill({ exampleId, version, icon, label, prompt }: Props) {
queryClient.invalidateQueries({
queryKey: ["workflows"],
});
+ queryClient.invalidateQueries({
+ queryKey: ["runs"],
+ });
navigate(
`/workflows/${response.data.workflow_permanent_id}/${response.data.workflow_run_id}`,
);
diff --git a/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx b/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx
index 0a8a018e9..6e4087553 100644
--- a/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx
+++ b/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx
@@ -184,6 +184,9 @@ function PromptBox() {
queryClient.invalidateQueries({
queryKey: ["workflows"],
});
+ queryClient.invalidateQueries({
+ queryKey: ["runs"],
+ });
navigate(
`/workflows/${response.data.workflow_permanent_id}/${response.data.workflow_run_id}`,
);
diff --git a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
index b6e0cc555..53b84be90 100644
--- a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
+++ b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
@@ -136,6 +136,9 @@ function RunWorkflowForm({
queryClient.invalidateQueries({
queryKey: ["workflowRuns"],
});
+ queryClient.invalidateQueries({
+ queryKey: ["runs"],
+ });
navigate(
`/workflows/${workflowPermanentId}/${response.data.workflow_run_id}/overview`,
);
diff --git a/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunStream.tsx b/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunStream.tsx
index 574f548e9..388a8d684 100644
--- a/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunStream.tsx
+++ b/skyvern-frontend/src/routes/workflows/workflowRun/WorkflowRunStream.tsx
@@ -69,6 +69,9 @@ function WorkflowRunStream() {
queryClient.invalidateQueries({
queryKey: ["workflowTasks", workflowRunId],
});
+ queryClient.invalidateQueries({
+ queryKey: ["runs"],
+ });
if (
message.status === "failed" ||
message.status === "terminated"