Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

Merge remote-tracking branch 'origin/main' into feat/task-hierarchy-takeover

Tin1adc000d4606
diff --cc apps/web/src/hooks/use-project-websocket.ts
index bf7a93da3,754dbabb9..5137ac70c
--- a/apps/web/src/hooks/use-project-websocket.ts
+++ b/apps/web/src/hooks/use-project-websocket.ts
@@@ -591,25 -577,24 +608,27 @@@ export function useProjectWebSocket(pro
return;
}
- if (retries < MAX_RETRIES) {
- const delay = BASE_DELAY * 2 ** retries; // 1s, 2s, 4s, 8s, 16s
- retries += 1;
- retryTimeout = setTimeout(connect, delay);
- } else if (fallbackInterval === null) {
- // Refresh only when realtime delivery could not reconnect.
- fallbackInterval = setInterval(() => {
- void queryClient.invalidateQueries({
- queryKey: ["tasks", projectId],
- });
- // The hierarchy has no message to refresh it while polling.
- void queryClient.invalidateQueries({
- queryKey: ["task-relations", "project", projectId],
- });
- }, 30_000);
- flushPending();
- }
+ scheduleReconnect();
};
}
+ function scheduleReconnect() {
+ if (retries < MAX_RETRIES) {
+ const delay = BASE_DELAY * 2 ** retries; // 1s, 2s, 4s, 8s, 16s
+ retries += 1;
+ retryTimeout = setTimeout(connect, delay);
+ } else if (fallbackInterval === null) {
+ // Refresh only when realtime delivery could not reconnect.
+ fallbackInterval = setInterval(() => {
+ void queryClient.invalidateQueries({
+ queryKey: ["tasks", projectId],
+ });
++ void queryClient.invalidateQueries({
++ queryKey: ["task-relations", "project", projectId],
++ });
+ }, 30_000);
+ flushPending();
+ }
+ }
connect();
function flushPending() {
if (