Skip to content

fork-source-link-same-view: The forked from link will be broken if the case doesn't match #3393

Closed
refined-github/github-url-detection
#25

Description

@JohnTitor

If you set your personal token and visit https://github.com/johntitor/rust-forge (note that the capitalization!), the forked from link will be broken.

The link will be:

image

The link causes 404 instead of moving to parent repo (e.g.: https://github.com/rust-lang/rust-forge/undefined/master).
But if you don't set the token or visit with the correct capitalization, the issue doesn't happen.

Steps to reproduce

  1. Set your personal token.
  2. Find any fork repo that username has an upper case.
  3. Visit there ignoring capitalization.

Expected behavior

The link should be such as https://github.com/owner/repo

Actual behavior

It points to https://github.com/owner/repo/undefined/master

Environment

  • Browser: Firefox 78.0.2
  • Extension version: 20.7.19
  • OS: Windows 10

Activity

  1. yakov116 commented on Jul 23, 2020

    @yakov116
  2. JohnTitor commented on Jul 23, 2020

    @JohnTitor
    Author
  3. yakov116 commented on Jul 23, 2020

    @yakov116
    Member

    No i mean what page were you on the I can try to reproduce the issue?

  4. JohnTitor commented on Jul 23, 2020

    @JohnTitor
    Author
  5. fregante commented on Jul 23, 2020

    @fregante
    Member

    It works correctly in my case:

    Did the repo change the name of the main branch recently?

  6. kidonng commented on Jul 23, 2020

    @kidonng
    Member

    I can't reproduce. Also, this doesn't seem to have relationship with forked-to.

  7. kidonng commented on Jul 23, 2020

    @kidonng
    Member

    Did the repo change the name of the main branch recently?

    It is still using master

  8. JohnTitor commented on Jul 23, 2020

    @JohnTitor
    Author

    You can, this is the link

    Nah, this issue occurs only when you go to the repo using the shortcut link.

    I can't reproduce. Also, this doesn't seem to have relationship with forked-to.

    Hmm, it's weird.

  9. kidonng commented on Jul 23, 2020

    @kidonng
    Member

    Nah, this issue occurs only when you go to the repo using the shortcut link.

    We don't have special logic for that button, it's just a normal link. It should make no difference if you directly visit https://github.com/JohnTitor/rust-forge

  10. fregante commented on Jul 23, 2020

    @fregante
    Member

    We don't have special logic for that button

    We kind of have logic, but only if you're in a file or folder. Following these steps doesn't trigger that logic however:

    Steps to reproduce

    1. Visit a repo that you have fork repo.
    2. Click the shortcut and go to (your) fork repo.
    3. See forked from owner/repo link.
  11. JohnTitor commented on Jul 23, 2020

    @JohnTitor
    Author

    Ahh, yep this isn't the shortcut issue but still extension issue, I guess.

    Could someone confirm the issue happens if you set your personal token and visit my fork repo e.g. johntitor/rust-forge (note that the capitalization, it should be johntitor, not JohnTitor)?

  12. kidonng commented on Jul 23, 2020

    @kidonng
    Member

    note that the capitalization, it should be johntitor, not JohnTitor

    Confirmed

    image

  13. JohnTitor commented on Jul 23, 2020

    @JohnTitor
    Author

    Thanks! Sorry for confusing, now we could say it's extension issue?

  14. kidonng commented on Jul 23, 2020

    @kidonng
    Member

    it's extension issue?

    We know that it's caused by Refined GitHub, but it's not due to forked-to (the fork button) but fork-source-link-same-view

  15. yakov116 commented on Jul 23, 2020

    @yakov116
    Member

    @kidonng how did you get it to error? What link?

  16. changed the title [-]"shortcut to fork repos" makes "forked from owner/repo" link not work properly[/-] [+]fork-source-link-same-view: The `forked from` link will be broken if the personal token is set[/+] on Jul 23, 2020
  17. kidonng commented on Jul 23, 2020

    @kidonng
    Member
  18. fregante commented on Jul 23, 2020

    @fregante
    Member

    how did you get it to error? What link?

    https://github.com/johntitor/rust-forge

    👆 this is why we ask for the exact link when opening an issue.

  19. kidonng commented on Jul 23, 2020

    @kidonng
    Member

    👆 this is why we ask for the exact link when opening an issue.

    They did give us the right link in the image, but we ignored the case difference 😂

  20. kidonng commented on Jul 23, 2020

    @kidonng
    Member

    So the fork button will give you all lowercase link, and when you visit it, boom, getDefaultBranch gives wrong info

  21. yakov116 commented on Jul 23, 2020

    @yakov116
    Member
  22. changed the title [-]fork-source-link-same-view: The `forked from` link will be broken if the personal token is set[/-] [+]`fork-source-link-same-view`: The `forked from` link will be broken if the case doesn't match[/+] on Jul 23, 2020
  23. fregante commented on Jul 23, 2020

    @fregante
    Member
  24. yakov116 commented on Jul 23, 2020

    @yakov116
    Member

    I think so (I did not have time to test the PR)

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions