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) <noreply@anthropic.com>
This commit is contained in:
5
.changeset/fix-full-suite-schema-and-cancel-error.md
Normal file
5
.changeset/fix-full-suite-schema-and-cancel-error.md
Normal file
@@ -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.
|
||||||
@@ -77,19 +77,27 @@ export function useCeSessions(options: UseCeSessionsOptions = {}): UseCeSessions
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const refresh = useCallback(async () => {
|
// clearErrorOnSuccess: a user-initiated refresh (or the initial fetch) clears
|
||||||
try {
|
// any prior error on success. Background refreshes (poll fallback, push
|
||||||
const next = await transport.list(projectId);
|
// events) pass false so a successful list fetch doesn't silently erase an
|
||||||
if (mounted.current) {
|
// error a cancel/remove just surfaced — an in-flight session keeps the poll
|
||||||
setSessions(next);
|
// running, which would otherwise wipe the action error before the user sees it.
|
||||||
setError(undefined);
|
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));
|
[transport, projectId],
|
||||||
} finally {
|
);
|
||||||
if (mounted.current) setLoading(false);
|
|
||||||
}
|
|
||||||
}, [transport, projectId]);
|
|
||||||
|
|
||||||
// Initial fetch (and on project switch).
|
// Initial fetch (and on project switch).
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -102,7 +110,7 @@ export function useCeSessions(options: UseCeSessionsOptions = {}): UseCeSessions
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!enabled || !subscribe) return;
|
if (!enabled || !subscribe) return;
|
||||||
return subscribe(() => {
|
return subscribe(() => {
|
||||||
void refresh();
|
void refresh(false);
|
||||||
});
|
});
|
||||||
}, [enabled, subscribe, refresh]);
|
}, [enabled, subscribe, refresh]);
|
||||||
|
|
||||||
@@ -111,7 +119,7 @@ export function useCeSessions(options: UseCeSessionsOptions = {}): UseCeSessions
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!enabled || !anyInFlight) return;
|
if (!enabled || !anyInFlight) return;
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
void refresh();
|
void refresh(false);
|
||||||
}, pollIntervalMs);
|
}, pollIntervalMs);
|
||||||
return () => clearInterval(timer);
|
return () => clearInterval(timer);
|
||||||
}, [enabled, anyInFlight, pollIntervalMs, refresh]);
|
}, [enabled, anyInFlight, pollIntervalMs, refresh]);
|
||||||
|
|||||||
@@ -743,10 +743,10 @@ describe("RoadmapStore", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("schema version", () => {
|
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
|
// Tracks @fusion/core's SCHEMA_VERSION (the roadmap store layers on core's
|
||||||
// Database). Bump this in lockstep when core adds a migration.
|
// Database). Bump this in lockstep when core adds a migration.
|
||||||
expect(db.getSchemaVersion()).toBe(116);
|
expect(db.getSchemaVersion()).toBe(117);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user