From 62335f88146afe4a20a1d08bdf599a420778e4c3 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Sun, 14 Jun 2026 15:56:26 -0700 Subject: [PATCH] fix: repair two post-merge Full Suite failures The non-blocking Full Suite tier on main was red on shards 2 and 4: - roadmap-store schema assertion lagged core's SCHEMA_VERSION bump to 117 (landed in FN-6277), so it still expected 116. - useCeSessions "cancel surfaces a transport error" failed deterministically: a session with an in-flight status keeps the poll fallback running, and a successful background list refresh called setError(undefined), wiping the cancel error before it could be observed. Background refreshes (poll + push) now leave action errors intact; only user-initiated/initial refreshes clear. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../fix-full-suite-schema-and-cancel-error.md | 5 +++ .../src/dashboard/hooks/useCeSessions.ts | 36 +++++++++++-------- .../src/store/__tests__/roadmap-store.test.ts | 4 +-- 3 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 .changeset/fix-full-suite-schema-and-cancel-error.md diff --git a/.changeset/fix-full-suite-schema-and-cancel-error.md b/.changeset/fix-full-suite-schema-and-cancel-error.md new file mode 100644 index 0000000000..4088778146 --- /dev/null +++ b/.changeset/fix-full-suite-schema-and-cancel-error.md @@ -0,0 +1,5 @@ +--- +"@runfusion/fusion": patch +--- + +Fix two post-merge Full Suite test failures. Sync the roadmap store's schema-version assertion to core's `SCHEMA_VERSION` (116 → 117). Stop `useCeSessions` background refreshes (poll fallback and push events) from clearing an error a `cancel`/`remove` just surfaced — an in-flight session kept the poll running, which silently erased the action error before the user could see it. diff --git a/plugins/fusion-plugin-compound-engineering/src/dashboard/hooks/useCeSessions.ts b/plugins/fusion-plugin-compound-engineering/src/dashboard/hooks/useCeSessions.ts index 2797a0e807..a959bf8676 100644 --- a/plugins/fusion-plugin-compound-engineering/src/dashboard/hooks/useCeSessions.ts +++ b/plugins/fusion-plugin-compound-engineering/src/dashboard/hooks/useCeSessions.ts @@ -77,19 +77,27 @@ export function useCeSessions(options: UseCeSessionsOptions = {}): UseCeSessions }; }, []); - const refresh = useCallback(async () => { - try { - const next = await transport.list(projectId); - if (mounted.current) { - setSessions(next); - setError(undefined); + // clearErrorOnSuccess: a user-initiated refresh (or the initial fetch) clears + // any prior error on success. Background refreshes (poll fallback, push + // events) pass false so a successful list fetch doesn't silently erase an + // error a cancel/remove just surfaced — an in-flight session keeps the poll + // running, which would otherwise wipe the action error before the user sees it. + const refresh = useCallback( + async (clearErrorOnSuccess = true) => { + try { + const next = await transport.list(projectId); + if (mounted.current) { + setSessions(next); + if (clearErrorOnSuccess) setError(undefined); + } + } catch (err) { + if (mounted.current) setError(err instanceof Error ? err.message : String(err)); + } finally { + if (mounted.current) setLoading(false); } - } catch (err) { - if (mounted.current) setError(err instanceof Error ? err.message : String(err)); - } finally { - if (mounted.current) setLoading(false); - } - }, [transport, projectId]); + }, + [transport, projectId], + ); // Initial fetch (and on project switch). useEffect(() => { @@ -102,7 +110,7 @@ export function useCeSessions(options: UseCeSessionsOptions = {}): UseCeSessions useEffect(() => { if (!enabled || !subscribe) return; return subscribe(() => { - void refresh(); + void refresh(false); }); }, [enabled, subscribe, refresh]); @@ -111,7 +119,7 @@ export function useCeSessions(options: UseCeSessionsOptions = {}): UseCeSessions useEffect(() => { if (!enabled || !anyInFlight) return; const timer = setInterval(() => { - void refresh(); + void refresh(false); }, pollIntervalMs); return () => clearInterval(timer); }, [enabled, anyInFlight, pollIntervalMs, refresh]); diff --git a/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts b/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts index 1872f75acd..55de7b1987 100644 --- a/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts +++ b/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts @@ -743,10 +743,10 @@ describe("RoadmapStore", () => { }); describe("schema version", () => { - it("schema version is 116 after init", () => { + it("schema version is 117 after init", () => { // Tracks @fusion/core's SCHEMA_VERSION (the roadmap store layers on core's // Database). Bump this in lockstep when core adds a migration. - expect(db.getSchemaVersion()).toBe(116); + expect(db.getSchemaVersion()).toBe(117); }); });