From 4f39ff86f75b13d4dac5e28b6f2939d9d6cf0b70 Mon Sep 17 00:00:00 2001 From: Maxwell Calkin Date: Sun, 8 Mar 2026 17:22:33 -0400 Subject: [PATCH] fix: use correct fallback type for reviewData in fetcher The reviewData variable is typed as `{ nodes: GitHubReview[] } | null`, but the fallback value was `[]` (a plain array). When `pullRequest.reviews` is null/undefined, `reviewData` becomes `[]`, causing `reviewData.nodes` to return `undefined` instead of `[]`. This leads to silent failures in downstream code that iterates over `reviewData.nodes`, such as `filterReviewsToTriggerTime` and `filterCommentsByActor`. Co-Authored-By: Claude Opus 4.6 --- src/github/data/fetcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/github/data/fetcher.ts b/src/github/data/fetcher.ts index 8d0e6ebbe..219f1cbc3 100644 --- a/src/github/data/fetcher.ts +++ b/src/github/data/fetcher.ts @@ -299,7 +299,7 @@ export async function fetchGitHubData({ includeCommentsByActor, excludeCommentsByActor, ); - reviewData = pullRequest.reviews || []; + reviewData = pullRequest.reviews || { nodes: [] }; console.log(`Successfully fetched PR #${prNumber} data`); } else {