@devries-cameron20 / t3code Mirror · read-only / commits / 90074e359f
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 24, 21:30 UTC

[codex] Preserve desktop update state causes (#3473)

Co-authored-by: codex <codex@users.noreply.github.com>

Julius Marminge committed Jun 20, 2026 at 20:20 UTC 90074e359f360bd7983661757ccf995524b9dbaa
2 files changed +9 -4
apps/web/src/state/desktopUpdate.test.ts
+8 -3
@@ -3,7 +3,7 @@ import * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
3 import { AtomRegistry } from "effect/unstable/reactivity";
4 import { afterEach, describe, expect, it, vi } from "vite-plus/test";
5
6 -import { createDesktopUpdateStateAtom } from "./desktopUpdate";
6 +import { createDesktopUpdateStateAtom, DesktopUpdateStateReadError } from "./desktopUpdate";
7
8 const baseState: DesktopUpdateState = {
9 enabled: true,
@@ -117,8 +117,13 @@ describe("desktopUpdateStateAtom", () => {
117 errorTag: "DesktopUpdateStateReadError",
118 attemptCount: 3,
119 });
120 - expect(errorContext).not.toHaveProperty("error");
121 - expect(errorContext).not.toHaveProperty("cause");
120 + const loggedError = (errorContext as { readonly error: unknown }).error;
121 + expect(loggedError).toBeInstanceOf(DesktopUpdateStateReadError);
122 + expect(loggedError).toMatchObject({
123 + _tag: "DesktopUpdateStateReadError",
124 + attemptCount: 3,
125 + });
126 + expect((loggedError as DesktopUpdateStateReadError).cause).toBe(cause);
127
128 listener?.(baseState);
129 await vi.waitFor(() => {
apps/web/src/state/desktopUpdate.ts
+1 -1
@@ -59,9 +59,9 @@ export function createDesktopUpdateStateAtom(getBridge: () => DesktopUpdateBridg
59 Effect.catchTags({
60 DesktopUpdateStateReadError: (error) =>
61 Effect.logError(error.message, {
62 + error,
63 errorTag: error._tag,
64 attemptCount: error.attemptCount,
64 - stack: error.stack,
65 }).pipe(Effect.as(null)),
66 }),
67 );