From 2666def93331e002ec52e1792a776d941566a6b0 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Thu, 2 Apr 2026 13:27:10 -0400 Subject: [PATCH] fix(app): poll session.diff instead of summary.files, revert sanitizeProject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit summary.files is computed asynchronously and never resolves in CI. Poll session.diff() directly — matches the pattern used by the snapshot-tool-race integration test. Also revert the unrelated sanitizeProject changes to event-reducer and utils that were accidentally included in this PR. --- packages/app/e2e/session/session-review.spec.ts | 10 +++++++--- packages/app/src/context/global-sync/event-reducer.ts | 5 ++--- packages/app/src/context/global-sync/utils.ts | 10 +--------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/packages/app/e2e/session/session-review.spec.ts b/packages/app/e2e/session/session-review.spec.ts index 8693f1c30e..c0a98cb2e3 100644 --- a/packages/app/e2e/session/session-review.spec.ts +++ b/packages/app/e2e/session/session-review.spec.ts @@ -67,9 +67,13 @@ async function patchWithMock( await expect.poll(() => llm.calls().then((c) => c > callsBefore), { timeout: 30_000 }).toBe(true) await expect - .poll(async () => (await sdk.session.get({ sessionID }).then((res) => res.data?.summary?.files)) ?? 0, { - timeout: 120_000, - }) + .poll( + async () => { + const diff = await sdk.session.diff({ sessionID }).then((res) => res.data ?? []) + return diff.length + }, + { timeout: 120_000 }, + ) .toBeGreaterThan(0) } diff --git a/packages/app/src/context/global-sync/event-reducer.ts b/packages/app/src/context/global-sync/event-reducer.ts index 4b93997805..5d8b7c4e3d 100644 --- a/packages/app/src/context/global-sync/event-reducer.ts +++ b/packages/app/src/context/global-sync/event-reducer.ts @@ -14,7 +14,6 @@ import type { import type { State, VcsCache } from "./types" import { trimSessions } from "./session-trim" import { dropSessionCaches } from "./session-cache" -import { sanitizeProject } from "./utils" const SKIP_PARTS = new Set(["patch", "step-start", "step-finish"]) @@ -34,12 +33,12 @@ export function applyGlobalEvent(input: { const result = Binary.search(input.project, properties.id, (s) => s.id) if (result.found) { input.setGlobalProject((draft) => { - draft[result.index] = sanitizeProject({ ...draft[result.index], ...properties }) + draft[result.index] = { ...draft[result.index], ...properties } }) return } input.setGlobalProject((draft) => { - draft.splice(result.index, 0, sanitizeProject(properties)) + draft.splice(result.index, 0, properties) }) } diff --git a/packages/app/src/context/global-sync/utils.ts b/packages/app/src/context/global-sync/utils.ts index 82f797945a..cac58f3174 100644 --- a/packages/app/src/context/global-sync/utils.ts +++ b/packages/app/src/context/global-sync/utils.ts @@ -27,21 +27,13 @@ export function normalizeProviderList(input: ProviderListResponse): ProviderList } export function sanitizeProject(project: Project) { + if (!project.icon?.url && !project.icon?.override) return project return { ...project, - commands: project.commands - ? { - ...project.commands, - } - : undefined, icon: { ...project.icon, url: undefined, override: undefined, }, - sandboxes: [...(project.sandboxes ?? [])], - time: { - ...project.time, - }, } }