fix: session tab leak, PR icon crash, and PR review prompt scope (#897)

This commit is contained in:
Carlos Florêncio
2026-05-13 18:39:01 +01:00
committed by GitHub
parent 5b23478323
commit 7011bbcbc4
10 changed files with 482 additions and 46 deletions
@@ -44,7 +44,8 @@ function createTaskPRActions(set: ImmerSet): Pick<GitHubSlice, "setTaskPRs" | "s
// Upsert by repository_id so multi-repo PRs coexist for the same task.
// For legacy rows without a repository_id, match on the empty key (one
// such row per task max), preserving prior single-PR semantics.
const existing = draft.taskPRs.byTaskId[taskId] ?? [];
const current = draft.taskPRs.byTaskId[taskId];
const existing = Array.isArray(current) ? current : [];
const repoKey = pr.repository_id ?? "";
const idx = existing.findIndex((p) => (p.repository_id ?? "") === repoKey);
if (idx >= 0) existing[idx] = pr;