From 21b0f0f9aa329dd98d3b82e15fa71d2f34e5ceee Mon Sep 17 00:00:00 2001 From: Maxwell Calkin <101308415+MaxwellCalkin@users.noreply.github.com> Date: Sat, 4 Apr 2026 23:12:05 -0400 Subject: [PATCH] fix: use correct fallback type for reviewData in fetcher (#1034) 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 8d0e6eb..219f1cb 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 {