Page MenuHomePhabricator

Gerrit 3.4 shows empty avatar next to usernames
Closed, ResolvedPublic

Description

We do not use user avatars but Gerrit 3.4 shows an empty gray disk next to our user names.

We have previously encountered an issue with avatar https://bugs.chromium.org/p/gerrit/issues/detail?id=14872 but this one is different.

Filed to Upstream as https://bugs.chromium.org/p/gerrit/issues/detail?id=15882

Event Timeline

From GET /config/server/info I get a PluginConfigInfo with:

"plugin" : {
   "js_resource_paths" : [
      "plugins/codemirror-editor/static/codemirror_editor.js",
      "plugins/delete-project/static/delete-project.js",
      "plugins/lfs/static/gr-lfs.js",
      "plugins/reviewers/static/rv-reviewers.js",
      "plugins/zuul/static/zuul.js"
   ]
},

The doc states:

has_avatars: not set if false. Whether an avatar provider is registered.

js_resource_paths: A list of relative paths (strings). Each path points to a frontend plugin that should be loaded, e.g. plugins/codemirror_editor/static/codemirror_editor.js.

Thus we do not have an avatar provider.

In polygerrit-ui/app/elements/shared/gr-avatar/gr-avatars.ts, the GrAvatar element has:

@property({type: Boolean})
_hasAvatars = false;

And:

this._hasAvatars = !!(cfg && cfg.plugin && cfg.plugin.has_avatars);

Which should hide it:

_updateAvatarURL() {
  if (!this._hasAvatars || !this.account) {
    this.hidden = true;
    return;
  }
  this.hidden = false;

And in the DOM I see: <gr-avatar image-size="32" hidden="">. Gotta file it to Upstream :)

Upstream fix has been released in Gerrit 3.4.5

hashar closed subtask T315408: Upgrade Gerrit to 3.4.5 as Resolved.

Fixed after I have upgraded Gerrit to 3.4.5 via T315408

Thank you @Paladox for the fix!