From e64cf8a7ee18fe216923829a5da9e68da3f83c84 Mon Sep 17 00:00:00 2001 From: orca-bug-scan-bot Date: Tue, 5 May 2026 14:09:46 -0700 Subject: [PATCH] fix: address pr-bug-scan findings from #1424 Flip parentFieldRetried inside the probe IIFE before resolveProbe() runs, eliminating the race where siblings wake between resolve and flag flip and issue duplicate with-parent probes. --- src/main/github/project-view.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/github/project-view.ts b/src/main/github/project-view.ts index 549bc989741..ee91e40202e 100644 --- a/src/main/github/project-view.ts +++ b/src/main/github/project-view.ts @@ -842,7 +842,7 @@ async function fetchAllItems(args: { }) probePromise = (async () => { try { - return await fetchItemsPageWithRaw({ + const result = await fetchItemsPageWithRaw({ owner: args.owner, ownerType: args.ownerType, projectNumber: args.projectNumber, @@ -851,6 +851,17 @@ async function fetchAllItems(args: { after: null, includeParent: true }) + // Why: flip parentFieldRetried BEFORE resolving the probe so siblings + // awaiting parentFieldProbeInFlight observe the updated flag. Doing + // this in the outer block (after `await probePromise`) leaves a gap + // between resolveProbe()/clearing parentFieldProbeInFlight and the + // flag flip — sibling callers wake up in that gap, see + // parentFieldRetried=false and parentFieldProbeInFlight=null, and + // issue their own duplicate with-parent probe. + if (!result.ok && errorsIndicateParentField(result.rawErrors, result.stderr)) { + parentFieldRetried = true + } + return result } finally { resolveProbe() parentFieldProbeInFlight = null