Skip to content

Broken avatar on GHE (again) #1224

Closed
Closed

Description

@LunaticMuch

🔍 Is there already an issue for your problem?

  • I have checked older issues, open and closed

📝 Description

In a GHE situation, avatars for users are broken.
This seems similar to #564 but in fact is not.

Looking at the inspector tab, the src for the image is correctly populated and points a valid image if I open it from my browser.
Incidentally, I have an amount of warnings as

reading cookie in cross-site context will be blocked in future Chrome versions

Whether that's the real problem or not...I am yet to understand. I cannot find any other error.

🪜 Steps To Reproduce

  1. Use in a GHE context
  2. GHE is 3.11

Gitify Version

5.7.0

Operating System

macOS

GitHub Account

GitHub Enterprise

📸 Screenshots

Screenshot 2024-06-12 at 10 39 10

Activity

  1. setchy commented on Jun 12, 2024

    @setchy
    Member

    thanks for reporting @LunaticMuch

    so to confirm, the avatar url returns a valid image, but renders as broken 🤔

  2. LunaticMuch commented on Jun 12, 2024

    @LunaticMuch
    Author

    so to confirm, the avatar url returns a valid image, but renders as broken 🤔

    Yes. I checked the code, the console, but I can get my head around it. I only suspected the cookie, but also I cannot see the "relationship"

  3. setchy commented on Jun 12, 2024

    @setchy
    Member

    Puzzling indeed... together I'm sure we'll get to the bottom of it 🤝

    Any chance you are able to run gitify from the source code to see if that has the same issue? 🤞

    git clone
    pnpm i
    pnpm watch
    pnpm start
    
  4. bmulholland commented on Jun 12, 2024

    @bmulholland
    Collaborator

    I also wonder whether there's a network request for the image at all? Maybe there's a security policy that prevents the loading, for instance. Would need @LunaticMuch to check that, I don't have GHE to try to repro

  5. LunaticMuch commented on Jun 12, 2024

    @LunaticMuch
    Author

    @setchy and @bmulholland I can definitely help... give me a bit, feels more a debug I need to squeeze after work 😄

  6. setchy commented on Jun 12, 2024

    @setchy
    Member

    @setchy and @bmulholland I can definitely help... give me a bit, feels more a debug I need to squeeze after work 😄

    absolutely! thank you again @LunaticMuch 🙇

  7. LunaticMuch commented on Jun 12, 2024

    @LunaticMuch
    Author

    First debug session, following your guidance @setchy

    1. Console is empty. There's no reported error or warning. Actually nothing at all.
    2. I do not see any call for the image tracing the network... this quite interesting, but it feels weird the security policy. If the connection is not started, this should not be related to a policy. The policy might block the response, not opening a socket for the call
  8. setchy commented on Jun 12, 2024

    @setchy
    Member

    Looks like you have Detailed Notifications enabled. In that case, you'll find the logic within src/utils/subject.ts that enriches notifications with the most recent SubjectUser (logic varies by notification type ie: Issues vs PullRequests vs Discussions, etc)

  9. LunaticMuch commented on Jun 13, 2024

    @LunaticMuch
    Author

    I need to dig into that, but from my initial testing, it's all fine.
    Actually, the repo icon suffers of the same problem, but the default icon for the runners does not 🤔

    Screenshot 2024-06-13 at 12 44 03

  10. setchy commented on Jun 13, 2024

    @setchy
    Member

    The default icons used for workflows (and as a default when no avatar available) are from the primer/octicons package

  11. setchy commented on Jun 19, 2024

    @setchy
    Member

    Perhaps a fix lies in setting the crossorigin attribute on the img tags...

    https://www.geeksforgeeks.org/how-to-allow-cross-origin-use-of-images-and-canvas/

    @LunaticMuch - when you said these urls load in a new tab, was that in an incognito/private or a regular instance?

  12. setchy commented on Jul 26, 2024

    @setchy
    Member

    @LunaticMuch - just wanted to confirm if you're still experiencing this issue?

  13. 15 remaining items

  14. pddg commented on Nov 5, 2024

    @pddg
    Contributor

    The avatar image was corrupted when a problem occurred connecting to the GHE Server.
    Even if the connection is restored, it image will not be restored immediately. However, it will be displayed normally at some point.

    Open/Close window, reload manually does not help. Open settings and return to the notifications list will recover the avatar image.
    I hadn't really thought about it before, so there may be other cases where it is restored.

  15. setchy commented on Nov 5, 2024

    @setchy
    Member

    Ah ha, that's helpful insight @pddg.

  16. mislavperi commented on Nov 5, 2024

    @mislavperi

    @setchy In my case, it refuses to connect after initial configuration was defined, I'll spin up the instance locally and see why it might be happening

  17. mislavperi commented on Nov 27, 2024

    @mislavperi

    Sorry for my long absence, but I found generally that loading avatars with GHE is generally a big pain
    microsoft/vscode-pull-request-github#416
    I found other countless threads that showcase the same issue. Do you maybe want to introduce fallback icons in case there is a 302?

  18. setchy commented on Nov 27, 2024

    @setchy
    Member

    Thanks @mislavperi - that's really interesting research you found.

    I like the idea of adding some fallback logic to use a default icon. We have some similar logic for when a user profile doesn't have an avatar at all, so perhaps we can extend that for this unique use-case

  19. setchy commented on Nov 27, 2024

    @setchy
    Member

    @mislavperi - is this something you'd be interested in contributing back?

  20. mislavperi commented on Nov 27, 2024

    @mislavperi

    @setchy gladly, I'll open a feature branch and play around it, see what might be the best way to implement it

  21. mislavperi commented on Dec 3, 2024

    @mislavperi

    @setchy I believe I found the issue. I investigate the request made for the avatar and came to the conclusion the authorization header is missing
    I copied the request, added the authorization header and I got a 200 status code, I'll look into injecting the authorization header into the request for content
    image

  22. mislavperi commented on Dec 3, 2024

    @mislavperi

    @setchy another update, turns out it's not the authorization but rather the cookie header that has to be set. I'm not sure that we can get that injected but I will further explore what can be done

  23. mislavperi commented on Dec 3, 2024

    @mislavperi

    Specifically, difference in cookies in web vs gitify
    gitify
    image
    web version
    image
    my guess, is that PAT specifically doesn't get those since technically we are not logged, only using PAT. I'm not 100% sure how to work around this, I'll do a bit more research

  24. mislavperi commented on Dec 3, 2024

    @mislavperi

    @setchy do you think the app would benefit from logging into enterprise github instances directly?

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp-wantedExtra attention is neededhost:github-serverRelated to GitHub Enterprise Serverpriority:lowItems of low importance. Applicable to select few users or use-cases

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions