From b03a2852fb6a0d9f6a9be5f58b8401cafafb7fd2 Mon Sep 17 00:00:00 2001 From: William Quintal Date: Tue, 7 Jul 2026 20:00:52 -0400 Subject: [PATCH] fix(gitlab): route Checks job fetches through the worktree runtime Address review feedback: handleLoadCheckDetails passed the globally-active `settings` to loadGitLabCheckRunDetails, so the trace fetch could route to the wrong runtime when the viewed worktree's environment differs from the global one. Use `ownerSettings` (worktree-scoped), matching every other runtime-routed call in this component and the editor-slice sibling. Also switch the sibling MR-details/job-list fetch to `ownerSettings` so the job list and the trace keyed off it resolve against the same GitLab host. Co-Authored-By: Claude Opus 4.8 --- .../src/components/right-sidebar/ChecksPanel.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/ChecksPanel.tsx b/src/renderer/src/components/right-sidebar/ChecksPanel.tsx index 248b34dcd74..2c6192eadd6 100644 --- a/src/renderer/src/components/right-sidebar/ChecksPanel.tsx +++ b/src/renderer/src/components/right-sidebar/ChecksPanel.tsx @@ -1815,7 +1815,9 @@ export default function ChecksPanel(): React.JSX.Element { const details = await fetchGitLabMRDetailsForChecks({ repoPath: repo.path, repoId: repo.id, - settings, + // Why: route to the active worktree's runtime so the job list (and the + // trace fetch keyed off it) resolve against the same GitLab host. + settings: ownerSettings, iid: targetMRNumber }) if (!isCurrentAsyncResult(requestKey)) { @@ -1851,7 +1853,7 @@ export default function ChecksPanel(): React.JSX.Element { hostedReviewCacheKey, isCurrentAsyncResult, repo, - settings + ownerSettings ] ) @@ -1965,7 +1967,9 @@ export default function ChecksPanel(): React.JSX.Element { return loadGitLabCheckRunDetails({ repoPath: repo.path, repoId: repo.id, - settings, + // Why: route to the active worktree's runtime, not the globally-active + // one, matching the other runtime-routed calls in this component. + settings: ownerSettings, check }) } @@ -1981,7 +1985,7 @@ export default function ChecksPanel(): React.JSX.Element { { repoId: repo.id } ) }, - [fetchPRCheckDetails, pr?.prRepo, repo, settings] + [fetchPRCheckDetails, ownerSettings, pr?.prRepo, repo] ) useEffect(() => {