@devries-cameron20 / t3code Mirror · read-only / commits / 2d2299aaaf
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 07:00 UTC

fix(web): file save session browser test no longer hangs on the discovery poll (#29813)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 2, 2026 at 17:31 UTC 2d2299aaaf76fc56cf0d1f5a1e13ec7194c76ec3
1 file changed +13 -5
apps/web/src/components/files/fileSaveSessions.browser.test.tsx
+13 -5
@@ -1,5 +1,5 @@
1 import { render, fakeTimers } from "../../../test/render";
2 -import { EnvironmentId } from "@t3tools/contracts";
2 +import { type AuthSessionState, EnvironmentId } from "@t3tools/contracts";
3 import { AsyncResult } from "effect/reactivity";
4 import { StrictMode } from "react";
5 import { describe, expect, it, vi } from "vite-plus/test";
@@ -12,10 +12,18 @@ vi.mock(import("@t3tools/client-runtime/state/runtime"), async (original) => ({
12 ...(await original()),
13 runAtomCommand: runAtomCommand as never,
14 }));
15 -vi.mock(import("~/state/session"), async (original) => ({
16 - ...(await original()),
17 - readEnvironmentScope: () => true,
18 -}));
15 +// The real session atom boots the connection runtime, whose endless discovery poll
16 +// would keep vi.runAllTimersAsync from ever draining once its timers are faked.
17 +vi.mock(import("~/state/session"), async (original) => {
18 + const actual = await original();
19 + const reactivity = await import("effect/reactivity");
20 + const signedOut = reactivity.Atom.make(reactivity.AsyncResult.initial<AuthSessionState>());
21 + return {
22 + ...actual,
23 + environmentSession: { ...actual.environmentSession, sessionStateAtom: () => signedOut },
24 + readEnvironmentScope: () => true,
25 + };
26 +});
27 vi.mock(import("./projectFilesQueryState"), async (original) => ({
28 ...(await original()),
29 confirmProjectFileQueryData: () => true,