Repository navigation
[Bug]: Expanding unmodified lines in GitLab merge requests silently does nothing #17156
Description
Activity
Note
Grok responding on behalf of Julius.
Thanks for the clear report and the stack trace. I traced it on current
main(5e22256). There are two separate problems here.1. The GitLab provider never wires up expansion
The error comes from
PullRequestService.diffFileContents(apps/server/src/pullRequest/PullRequestService.ts:1901-1923). It refuses with "This host cannot expand unchanged pull request lines." whenever the host's provider has nogetDiffFileContents.GitLab can already do this read.
GitLabPullRequestCli.getMergeRequestDiffFileContents(apps/server/src/pullRequest/GitLabPullRequestCli.ts:1250-1299) was added in #5546 and has tests (GitLabPullRequestCli.test.ts~L620-780). It reads the MR'sdiff_refs(or a commit's parent for the per-commit view). Then it fetches both sides fromprojects/:id/repository/files/:path/raw?ref=<sha>, with the same 1 MB and binary limits as GitHub.The step that's missing is in
GitLabPullRequestProvider.ts. GitHub wires its CLI method into the provider (GitHubPullRequestProvider.ts:549-550), and Forgejo and Azure DevOps have their own. The GitLab provider only exposesgetDiff(GitLabPullRequestProvider.ts:231) and never setsgetDiffFileContents. So the optional method isundefined, it's left out atPullRequestService.ts:643-645, and every expand on a GitLab MR fails. The provider file at #5546's merge commit has the same gap, so this looks like an oversight from that PR rather than a later regression.The fix is likely small. Add the following to the GitLab provider, next to
getDiff, plus a provider-level test:getDiffFileContents: (input) => cli.getMergeRequestDiffFileContents(input).pipe(Effect.mapError(fail("getDiffFileContents"))),
I haven't run this against a live GitLab instance. Fork MRs and older self-managed GitLab (see #15660 / #15886) are worth a quick check once it's wired.
Bitbucket appears to be in the same state:
diff: truebut nogetDiffFileContents. It probably fails the same way, though I didn't verify that.2. The web UI swallows the failure
Even with GitLab fixed, any expansion failure is currently invisible. That includes the existing "oversized" (>1 MB) and "binary" errors on GitHub.
- The Code tab passes
createPullRequestDiffFileContentsLoaderto the diff viewer asloadDiffFiles(apps/web/src/components/pullRequest/PullRequestCodeTab.tsx:361-371, 896). The loader throws on failure (apps/web/src/lib/diffFileContents.ts:119-121). useAtomCommand's default failure reporting only does aconsole.warn(packages/client-runtime/src/state/runtime.ts:418-433). It doesn't show a toast.@pierre/diffs1.5.2FileDiff.loadFilesForDiffcatches the loader error and just callsconsole.error(dist/components/FileDiff.js:555-563). That's the trace in your report.expandHunklikely still re-renders, but with nothing loaded to reveal, so the click appears to do nothing.
There's also no capability flag for expansion:
PullRequestCapabilities(packages/contracts/src/pullRequest.ts:394) only hasdiff. So the client can't hide or disable the "N unmodified lines" divider for a host that can't expand. How to surface this is a UX choice: show an error toast or inline notice when the loader fails, add anexpandcapability and hide the divider, or both. Fixing (1) removes the GitLab case either way.Summary
- Type: bug. GitLab expansion was meant to ship with feat: expand pull request review context and panel tabs #5546, but the provider wiring was missed. A secondary issue is the silent-failure UX in the PR Code tab.
- Related: feat: expand pull request review context and panel tabs #5546 (added the feature), [Bug]: Pull request Code tab fails on self-managed GitLab older than 15.7 ("GitLab CLI command failed") #15660 / fix(server): load merge request diffs on older GitLab #15886 (different GitLab Code tab bug on older self-managed GitLab), [Bug]: Side-by-side diff squeezes the "N unmodified lines" divider into the line-number column #17157 (same reporter, cosmetic split-diff divider). I didn't find an open PR that fixes this.
- Next step: wire
getDiffFileContentsintoGitLabPullRequestProviderwith a test, and separately decide how expansion failures should be shown in the Code tab.
- The Code tab passes
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Oct 8, 2026
Before submitting
Area
apps/server
Steps to reproduce
Expected behavior
The hidden lines are revealed, as they are for GitHub PRs (#5546 lists GitLab as supported). If expanding fails, an error is shown.
Actual behavior
Nothing visible happens: no lines expand and no error appears. The error is only logged to the DevTools console.
Impact
Major degradation or frequent failure
Version or commit
0.0.46-nightly.20261008.2813
Environment
macOS, desktop app, GitLab
Logs or stack traces