Skip to content

[Bug]: GitLab All Activity avatars do not load in merge requests #42122

Backlog

Description

@Ernest0-Production

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Sign in to a self-hosted GitLab with glab.
  2. Open a merge request whose comment authors have a custom GitLab avatar (not Gravatar/identicon).
  3. Open the merge request timeline / All activity tab in T3 Code.

Expected behavior

Comment and review authors in All Activity show their GitLab avatars, using the same GitLab login T3 already uses for the merge request.

Actual behavior

Custom avatars fail and fall back to initials. Users who never set an avatar still show, because GitLab gives a public Gravatar/identicon URL.

#39973 only resolved GraphQL avatarUrl paths in the merge request list. All Activity authors come from REST notes/discussions via toActor in packages/source-control-gitlab/src/server/gitLabMergeRequestJson.ts, then web PullRequestActorAvatar (apps/web/src/components/pullRequest/pullRequestPresentation.tsx) and mobile PullRequestAvatar render a raw <img> / Image with no Authorization / PRIVATE-TOKEN.

On GitLab 19.4.5-ee, REST author.avatar_url is already an absolute https://<host>/uploads/-/system/user/avatar/<id>/avatar.png. GraphQL author.avatarUrl for the same user is still a bare path. gitLabMediaUrl only claims /-/raw/<sha>/… committed files, so system avatars never go through fetchMedia. GitHub activity fills a missing avatar from a public CDN (withAvatar); GitLab has no counterpart.

Related, not this bug:

Impact

Minor bug or occasional failure

Version or commit

main @ d7ae1e1

Environment

Web and desktop PR timeline; also mobile All activity. Self-hosted GitLab 19.4.5-ee.

Logs or stack traces

REST notes author.avatar_url → https://<host>/uploads/-/system/user/avatar/<id>/avatar.png
GraphQL notes author.avatarUrl → /uploads/-/system/user/avatar/<id>/avatar.png
Anonymous GET of the upload URL → 200 image/png on this instance; 302 /users/sign_in or 403 when the host requires a login
Client <img src={avatarUrl}> has no GitLab token

Workaround

None for custom avatars. Initials appear after onError on web.

Activity

  1. Ernest0-Production commented on Nov 24, 2026

    @Ernest0-Production
    ContributorAuthor

    Closing: the cause described here doesn't hold, and I can't find a client-side fix.

    • GitLab does not let a token read /uploads/-/system/user/avatar/<id>/<file>. UploadsController uses only the session user, and AuthFinders accepts PAT or OAuth tokens only on /api/, feed, archive, download, raw and design paths. Sending the glab token with the request (tried in fix(gitlab): All Activity avatars load with the GitLab login #42137) can't help.
    • On a host without restricted public visibility, avatars are public, and the current <img> loads them. Checked on GitLab 19.4.5-ee: anonymous GET returns 200 image/png, with no CORP or COEP headers.
    • On a host with public visibility restricted, only a signed-in browser session can read them. GitLab has no API that returns user avatar bytes, so T3 can't fetch them for the user.

    Separately, commit rows in All Activity always show initials, because GitLab's MR commits API returns no avatar. That's a different issue and not covered here.

  2. Ernest0-Production commented on Nov 24, 2026

    @Ernest0-Production
    ContributorAuthor

    Reopening with a corrected cause. The earlier close assumed a missing GitLab token. That was wrong for this bug, and the token-based fetch in #42137 cannot work: UploadsController never sessionless-authenticates /uploads/-/system/user/avatar/…, and glab api would forward Private-Token onto an object-storage redirect.

    What actually fails: clients load the avatar URL themselves (<img> / expo-image). On a phone that is not on the GitLab network, the host is NXDOMAIN or WAF 403, so the image errors and the UI falls back to initials. The T3 server is on that network. Live on GitLab 19.4.5-ee, an anonymous GET of https://<host>/uploads/-/system/user/avatar/<id>/avatar.png returns 200 image/png from the server. The server should fetch those bytes with a plain HTTP GET (no token) and serve them as the existing source-control media asset, the same way GitHub private media already reaches the client.

    A host with restricted public visibility still cannot serve avatars without a browser session. That is out of scope. Commit rows that always have avatarUrl: null are also a separate issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions