Refined-github: Wrong avatars on reactions

Created on 21 May 2020  Â·  31Comments  Â·  Source: sindresorhus/refined-github

This bug happens in any PR or issue reactions when it shows the people who react to something, it always keeps showing the same accounts

image

Starting from user https://github.com/1 and increases the id as the count of the people reacted to the issue increased

image

bug help wanted

Most helpful comment

I'm not EAP and it happens to me, too. It started happening few hours ago and in that time, nothing changed to my account that I know of. So GH must be rolling out some DOM changes (maybe we're part of an A/B test).

All 31 comments

Link?

I'm facing it in everywhere
@yakov116
image

image

How? I disabled the extension and it worked fine

Maybe its another github extension interfering. Can you try to disable all other extensions?

I'm facing it in everywhere
image

You added both reactions so the same avatar appears on both. What do you expect if not this?

Something weird is going on for sure though, this can't happen:

image

It shows that you clicked on the second reaction, but it also shows 1 avatar.

image

Here it shows your avatar… that should never happen. Could it be that your username is causing problems (since it has an uppercase letter)?

I can confirm this happening. Couldn't figure out what extension is interfering (tried disabling each one in turn). Reinstall doesn't work.

Doesn't happen in chrome canary clean install, though, so some interference indeed must be happening.

Ok, I thought this was a crazy idea, but signing out makes it work correctly. Signing in to my account again breaks it. I'm not using any token at the moment, so rate limits shouldn't be it (?).

@fregante That isn't my avatar it belongs to the user https://github.com/1 and the avatar changes same as the number of the reactions as you see in the snip there are 2 rocket reaction so the avatar is for user https://github.com/2 same as for the thumps up https://github.com/7

I tried to only enable refined-github in incognito and the bug occurred there

I was just about to report the same issue (visible @ https://github.com/dephell/dephell/issues/440 for me).

I copied this from devtools:

<div class="comment-reactions-options rgh-reactions">
          <button class="btn-link reaction-summary-item js-reaction-summary-item tooltipped tooltipped-se tooltipped-multiline user-has-reacted" name="input[content]" type="submit" value="THUMBS_UP unreact" aria-label="webknjaz reacted with thumbs up emoji">
            <g-emoji alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png" class="emoji mr-1"><img class="emoji" alt="+1" height="20" width="20" src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png"></g-emoji>
            1
          <a href="/1"><img src="/1.png?size=20"></a></button>
      </div>

So it's both avatar and the link that point to /1.

Here's some interesting entries logged in the console:

rf_gh_1
rf_gh_2

Just confirmed that in Incognito mode (with only Adblock and Ghostery enabled additionally to Refined GitHub) it points to my profile (and avatar), as expected. Also, I'm logged out in Incognito.

When I logged in, in Incognito mode, it became broken again. (Disabling adblockers doesn't help too).

By the way, it's Version 81.0.4044.122 (Official Build) (64-bit) @ Gentoo Linux.

I must admit that I'm a member of EAP so GitHub may have enabled some extra code on my profile.

So I asked my wife to log in in my browser and in her account, my (and other people's) reactions are visible. I liked https://github.com/sindresorhus/refined-github/issues/3120#issuecomment-632089299 using her account and now that I'm under my account I see weird avatars/profiles shown.

By the way, the tooltip (on mouseover) on those reactions, mentions the correct usernames.

So I'm inclined to believe that Refined GitHub may rely on some DOM node that is not available for some GitHub accounts in EAP based on the feature flags or something... That's why some people can reproduce it while others can't.

I'm not EAP and it happens to me, too. It started happening few hours ago and in that time, nothing changed to my account that I know of. So GH must be rolling out some DOM changes (maybe we're part of an A/B test).

Okay, but the root cause is still the same. You're right that A/B may have hit us. And yes, it only started happening to me a few hours ago too.

Can one of you two add some breakpoints to see where this 1 is coming from?

Maybe this line is using the wrong aria-label, but I don't understand why

https://github.com/sindresorhus/refined-github/blob/59ac9213f867b567de219d38564442623add3ba9/source/features/reactions-avatars.tsx#L22

@fregante I have the same bug. Here's what happened when I set a breakpoint on that line and checked what that code was doing:
image

Maybe the container.getAttribute('aria-label') no longer returns the user ID starting some A/B test / staged rollout?

EDIT: I don't see anything that could be used to get the user ID in container:
image

Happens by me too. Looks like they are rolling it out

Did some debugging.
Github no longer loads who reacted in the aria-label until you hover 😞

the request looks like

fetch("https://github.com/sindresorhus/refined-github/reactions/tooltips?subject_id=MDU6SXNzdWU2MjI0NDM5OTU=", {
  "headers": {
    "accept": "application/json",
    "accept-language": "en-US,en;q=0.9,he-IL;q=0.8,he;q=0.7",
    "if-none-match": "W/\"5b402c91e5f5cf9565be79e1f562eb67\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin"
  },
  "referrer": "https://github.com/sindresorhus/refined-github/issues/3120",
  "referrerPolicy": "no-referrer-when-downgrade",
  "body": null,
  "method": "GET",
  "mode": "cors",
  "credentials": "include"
});

This kills the feature.

The alternative is to query the API. The response will not be super light.

PR welcome to detect situations where the names haven’t yet loaded and ignore them for the time being. This will avoid loading the wrong avatar

This feature requires a rewrite and it doesn't work as is, possibly doesn't work at all. I'll open a new issue and create a new version.

For now I just made sure that it never loads unrelated avatars.

"Fixed" in 20.5.21


I'm not receiving any avatar now :cry:

image

Or at least it's intermittent... Might have to do with GitHub API requests going down.

Refer to https://github.com/sindresorhus/refined-github/issues/3122

The feature is essentially broken by GitHub now and needs to be changed.

Was this page helpful?
0 / 5 - 0 ratings