fix(jira): fix connection check timeout (#12742)

Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com>
This commit is contained in:
Pedro Martín
2026-09-04 15:51:09 +02:00
committed by GitHub
co-authored by alejandrobailo
parent 8bdb597921
commit 1edcf6e5de
20 changed files with 681 additions and 206 deletions
@@ -0,0 +1,42 @@
"use client";
import { revalidateIntegrationConnectionPages } from "@/actions/integrations";
import { toast } from "@/components/shadcn/toast";
import { evaluateIntegrationConnectionTask } from "@/lib/integrations/test-connection-result";
import type { TaskKindHandler } from "@/store/task-watcher/store";
import type { IntegrationConnectionTaskResult } from "@/types/integrations";
const refreshIntegrationPages = (): void => {
void revalidateIntegrationConnectionPages().catch(() => undefined);
};
export const integrationConnectionTaskHandler: TaskKindHandler = {
onReady: (task) => {
refreshIntegrationPages();
const result = evaluateIntegrationConnectionTask(
task.result as IntegrationConnectionTaskResult | undefined,
);
if (result.success) {
toast({
title: "Connection test successful!",
description: result.message,
});
return;
}
toast({
variant: "destructive",
title: "Connection test failed",
description: result.error,
});
},
onError: (task) => {
refreshIntegrationPages();
toast({
variant: "destructive",
title: "Connection test failed",
description: task.error || "The connection test failed unexpectedly.",
});
},
};