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.

fix(ci): failing test and code review recommendations

justin1de814630626
diff --git a/apps/web/src/query-client/index.ts b/apps/web/src/query-client/index.ts
index 6793016c5..9178eb9c6 100644
--- a/apps/web/src/query-client/index.ts
+++ b/apps/web/src/query-client/index.ts
@@ -43,6 +43,10 @@ function captureCacheError(error: unknown, context: "query" | "mutation") {
return;
}
networkErrorCooldowns.set(dedupeKey, now);
+ // ponytail: hard cap with full clear; entries older than the cooldown are
+ // useless to keep, and `error.message` can vary across fetchers/CORS
+ // failures so the keyspace is unbounded in practice.
+ if (networkErrorCooldowns.size > 50) networkErrorCooldowns.clear();
}
Sentry.captureException(error, { tags: { area } });
diff --git a/apps/web/src/routes/auth/verify-otp.test.tsx b/apps/web/src/routes/auth/verify-otp.test.tsx
index 7b7b17db2..13e272ed4 100644
--- a/apps/web/src/routes/auth/verify-otp.test.tsx
+++ b/apps/web/src/routes/auth/verify-otp.test.tsx
@@ -78,14 +78,14 @@ beforeEach(() => {
});
afterEach(async () => {
- // input-otp schedules internal timers (0ms, 2s, 5s, 6s) for password
- // manager detection when the input focuses. The 0ms timer can fire after
- // vitest tears down the jsdom environment, which surfaces as an
- // unhandled "window is not defined" error. Drain pending timers inside
- // act() so React's pending updates flush and the timer calls complete
- // before cleanup runs.
+ // input-otp schedules internal timers (0/10/50ms in password manager
+ // detection; 0/2/5/6s in autofill checks) when the input focuses. The
+ // short ones can fire after vitest tears down jsdom on a slow worker,
+ // surfacing as an unhandled "window is not defined" error from a stale
+ // setState. Drain inside act() so React flushes too. The 2/5/6s timers
+ // are still cleared by the component's effect cleanup when it unmounts.
await act(async () => {
- await new Promise((resolve) => setTimeout(resolve, 0));
+ await new Promise((resolve) => setTimeout(resolve, 100));
});
cleanup();
emailOtp.mockReset();