Skip to content

MR diff panel hides the real error: a GitLab rate limit shows up as a generic "Transport error" #42941

Done

Description

@nelsonsbrian

Goal

When the diff can't load, the panel should say why. Here the server knew the cause (GitLab rate limit) and returned it, but the panel only showed a generic transport error. The app already has a "GitLab rate limit reached" message for this case; it never got the error text it needs to show it. This issue asks for the real error to reach the panel.

Out of scope: the GitLab rate limit itself. That was expected here and is covered separately (see #40608).

What happened

In the desktop app, a GitLab merge request opened in the right panel. Summary and Timeline loaded, but the Code tab showed:

Couldn't load the changes
The environment couldn't load this merge request's diff. Try again, or view the changes on GitLab.

Technical details: Failed to fetch remote environment endpoint https://prod-<id>.t3coderelay.com/api/pull-requests/diff (HttpClientError: Transport error (POST https://prod-<id>.t3coderelay.com/api/pull-requests/diff)).

Retrying gave the same result. Nothing in the UI said the real cause: the server had paused GitLab requests because gitlab.com returned a rate limit.

Diagnosis

The server worked as intended, but the client never received its error:

  1. Earlier GitLab calls (getMergeRequestDetail, getListStates, listNotes) failed with GitLabCliRateLimitError: GitLab API rate limit exceeded., so SourceControlRateLimit paused gitlab.com.
  2. The diff request then failed in SourceControlRateLimit.check with SourceControlRateLimitPausedError: gitlab requests to gitlab.com are paused until the rate limit resets. The POST /api/pull-requests/diff span ended with status 502. That is the declared httpApiStatus of PullRequestOperationError, which carries a JSON body containing the rate-limit detail.
  3. The desktop client did not get that body. It reported HttpClientError: Transport error, which means the fetch itself failed without a response. Because no response reached the client, describePullRequestDiffError (apps/web/src/components/pullRequest/pullRequestDiffError.ts) had no "rate limit" text to match, and fell back to the generic "Couldn't load the changes".

The request went through the T3 Connect relay (*.t3coderelay.com, server: cloudflare). A 401 from the same endpoint through the relay keeps access-control-allow-origin: * and reaches the client normally. My unverified guess is that the relay or Cloudflare edge replaces an origin 502 with its own error page that has no CORS headers, so the browser fetch throws and the client sees a transport error. If that is right, every declared 502 error (all PullRequestOperationErrors) becomes an opaque transport error for relayed clients. Returning a non-gateway status such as 503 or 429 for rate-limited operations would avoid this.

On the GitLab side, T3 made only about 50–100 glab calls per hour, so the rate limit was probably shared with other glab and API use under the same account. That is not the bug. The bug is that the panel hides the cause.

Whatever the exact point of loss turns out to be, the fix is the same: a relayed client should receive the server's declared error body, so the panel can show the specific message (rate limit, retry time) instead of "Transport error".

Steps to reproduce

  1. Connect the desktop app to a server through the T3 Connect relay, with a linked GitLab MR on gitlab.com.
  2. Get gitlab.com to rate-limit the account so SourceControlRateLimit pauses gitlab.com (or force PullRequestService.diff to fail with any PullRequestOperationError).
  3. Open the MR in the right panel and switch to Code.
  4. Expected: "GitLab rate limit reached" (the specific cause). Actual: "Couldn't load the changes" with HttpClientError: Transport error.

Version

  • Server (systemd service): 0.1.10-nightly.20261113.4616
  • Desktop client (from the request user agent): T3CodeNightly 0.1.8-nightly.20261106.4275
  • Triage CLI: 0.1.10-nightly.20261113.4616

I have not checked whether 0.1.12 or 0.1.13-nightly fixes this. The rate-limit message in the client has existed since #19945, and the server's rate-limit mapping in withRateLimitBackoff looks the same on main.

Environment

Linux x64 (Arch-based, kernel 7.2), desktop app (Electron 44) connecting to its own background service through the T3 Connect relay. glab 1.130.0, authenticated to gitlab.com through the keyring.

Evidence

From server.trace.ndjson, 2026-11-25:

16:15:25Z SourceControlRateLimit.check  Failure  SourceControlRateLimitPausedError: gitlab requests to gitlab.com are paused until the rate limit resets.
            at environment.pullRequests.diff ...
16:15:25Z POST /api/pull-requests/diff  status 502  HttpServerError: ResponseError (502 POST /api/pull-requests/diff)
16:15:30Z (same again on retry, 502)

Earlier in the same window: GitLabPullRequestCli.listNotes and getMergeRequestDetail failed with GitLabCliRateLimitError: GitLab CLI failed in execute: GitLab API rate limit exceeded. Before the pause, POST /api/pull-requests/diff returned 200 normally (16:11:59Z, 16:13:46Z).

A 401 through the relay keeps CORS headers:

HTTP/2 401
access-control-allow-origin: *
server: cloudflare

Related issues

Fix applied or workaround

None applied. Workaround: wait for the GitLab rate limit to reset, or use "Open on GitLab".

Filed by

Claude Code (Claude Opus 5.5), through t3 triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions