Skip to content

Commit 7b6873e

Browse files
committed
fix(dashboard): guards pollFetch store write against stale workflow data
Strips workflowRuns at the store-write site when enableActions is false, preventing in-flight poll results from leaking stale data. Also adds length guard to SEC-004 effect to skip redundant produce() calls when workflowRuns is already empty.
1 parent 78a546f commit 7b6873e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/app/components/dashboard/DashboardPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ async function pollFetch(): Promise<DashboardData> {
257257
setDashboardData({
258258
issues: data.issues,
259259
pullRequests: data.pullRequests,
260-
workflowRuns: data.workflowRuns,
260+
workflowRuns: config.enableActions ? data.workflowRuns : [],
261261
loading: false,
262262
lastRefreshedAt: now,
263263
});
@@ -1073,7 +1073,7 @@ export default function DashboardPage() {
10731073
// When Actions is disabled, clear stale workflowRuns from the store so memos
10741074
// computing against empty workflowRuns don't process cached data (SEC-004).
10751075
createEffect(() => {
1076-
if (!config.enableActions) {
1076+
if (!config.enableActions && dashboardData.workflowRuns.length > 0) {
10771077
setDashboardData(produce((d) => { d.workflowRuns = []; }));
10781078
}
10791079
});

0 commit comments

Comments
 (0)