sindresorhus/refined-github

Duplicate forks in `forked-to` #2759

Kinrany posted onGitHub

Screenshot_2020-02-04 Kinrany cargo

The dropdown that shows my forks next to the "Fork" button contains two links to the same repo: one with username in lowercase and one in Uppercase.

Browser: Firefox


Aaand it's gone.

But now the link-to-my-fork button sometimes shows up in my own repo, and sometimes does not show up in the upstream repo. Sometimes it goes away when I reload the page, sometimes it doesn't.

I'm assuming someone is working on this feature right now :D

posted by Kinrany about 5 years ago

I'm assuming someone is working on this feature right now :D

That's not how it works, the extension takes days to be published, we don't push code updates in real time like the website owner could 😅

posted by fregante about 5 years ago

My guess is maybe show-names is interfering with the repo name and due to the username capitalization it doesn't think that the repo is the same.

Can you look into it if happens again? We copy that list from the overlay that appears when clicking on "Fork"; show-name shouldn't apply there.

posted by fregante about 5 years ago

Happened again with https://github.com/rust-lang/cargo

The dropdown contains kinrany/cargo and Kinrany/cargo, but the overlay list only shows Kinrany/cargo.

posted by Kinrany about 5 years ago

I found a problem, I don't know if it's related but:

  • when we're on a fork, the Forks list doesn't include the current fork and forked-to things there are no other forks available:

<img width="770" alt="" src="https://user-images.githubusercontent.com/1402241/73844690-a2db7c00-4853-11ea-98c3-fb80553ef6a2.png">

When forked-to loads this, the list of forks is reset and the button disappears.

cc @jerone

posted by fregante about 5 years ago

I wonder if the list of your forks can be reliably retrieved via API, that would solve a lot of issues.

posted by fregante about 5 years ago

Can you just get the intersection of the list of all forks with the list of your repos?

posted by Kinrany about 5 years ago

I found a problem, I don't know if it's related but:

* when we're on a fork, the Forks list doesn't include the current fork and `forked-to` things there are no other forks available:

I have noticed this too. In early version of the code, the cache was extended with forks. Currently, the whole cache is replaced with new forks, which when you are on a fork, doesn't contain all forks.

We need to extend saveAllForks with this check.


Back to the original issue; interference with show-names is my only thought too.

posted by jerone about 5 years ago

We need to extend saveAllForks with this check.

Sounds good, it can probably be moved to save

I think the next line is exactly the issue in this case and show-names might not be the culprit after all. That piece of code uses the current page URL… which could be aNyThInG/repo so it won’t match the filters ('aNyThInG/repo' !== 'anything/repo') and will be added twice.

https://github.com/sindresorhus/refined-github/blob/e1c37007f0be92b76a608c0de4476aec70ae65e5/source/features/forked-to.tsx#L47-L52

posted by fregante about 5 years ago

Makes sense :+1:

posted by jerone about 5 years ago

Fund this Issue

$0.00
Funded

Pull requests