sindresorhus/refined-github

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

JohnTitor posted onGitHub

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

Can you give us a direct link?

posted by yakov116 over 4 years ago

Can you give us a direct link?

image

image

It seems fine.

UPDATE: Ah, you mean the broken link? I added it to the OP.

posted by JohnTitor over 4 years ago

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

posted by yakov116 over 4 years ago

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

Hm then I think I cannot, you can go to a parent repo that you have fork repo.

posted by JohnTitor over 4 years ago

You can, this is the link: https://github.com/JohnTitor/rust-forge

posted by fregante over 4 years ago

It works correctly in my case:

<img width="347" alt="" src="https://user-images.githubusercontent.com/1402241/88309765-adf16e00-cd06-11ea-8153-cfdaa4ffc197.png">

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

posted by fregante over 4 years ago

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

posted by kidonng over 4 years ago

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

It is still using master

posted by kidonng over 4 years ago

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.

posted by JohnTitor over 4 years ago

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

posted by kidonng over 4 years ago

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.
posted by fregante over 4 years ago

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)?

posted by JohnTitor over 4 years ago

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

Confirmed

image

posted by kidonng over 4 years ago

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

posted by JohnTitor over 4 years ago

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

posted by kidonng over 4 years ago

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

posted by yakov116 over 4 years ago

how did you get it to error? What link?

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

posted by kidonng over 4 years ago

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.

posted by fregante over 4 years ago

šŸ‘† 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 šŸ˜‚

posted by kidonng over 4 years ago

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

posted by kidonng over 4 years ago
posted by yakov116 over 4 years ago
posted by fregante over 4 years ago

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

posted by yakov116 over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests