sindresorhus/refined-github

`GetCurrentBranch` Stopped working on issues #3641

yakov116 posted onGitHub

This is a major problem

Test on https://github.com/sindresorhus/refined-github/issues/3638 or even this issue.


???

There's no branch on issues.

posted by fregante over 4 years ago

But the more-dropdown...

posted by yakov116 over 4 years ago

Then the more dropdown… stopped working 😉 not the function itself

posted by fregante over 4 years ago

We should either ensure that more-dropdown doesn’t call the function where it doesn’t make sense, or that the function returns undefined when it doesn’t find the expected URL format

posted by fregante over 4 years ago

I think https://github.com/sindresorhus/refined-github/blob/d7d700a20befb552f9f64e15504b845dbe04e699/source/github-helpers/get-default-branch.ts can be used if getCurrentBranch() fails (combined with returning undefined if it can not find expected URL?

const reference = getCurrentBranch() || getDefaultBranch();

OR... should it be the other way, getCurrentBranch() returning getDefaultBranch() as a fallback?

posted by notlmn over 4 years ago

getCurrentBranch() returning getDefaultBranch() as a fallback?

☝️

posted by yakov116 over 4 years ago

I think getCurrentBranch does not make sense outside of code pages, it’s best to make it explicit like in your first example, only where necessary.

posted by fregante over 4 years ago

On this issue:

$('[type="application/atom+xml"]').href
// -> "https://github.com/sindresorhus/refined-github/commits/master.atom"

So what's the error? It exists and it's already the default branch

posted by fregante over 4 years ago
$('[type="application/atom+xml"]').href
// Uncaught TypeError: Cannot read property 'href' of null

not for me

posted by yakov116 over 4 years ago
$('[type="application/atom+xml"]').href
// Uncaught TypeError: $(...) is null

Me neither (on Firefox)

posted by notlmn over 4 years ago

I think I encountered the same issue that caused https://github.com/sindresorhus/refined-github/issues/2799 (i.e. GitHub doesn't cleanup the links after AJAX navigation)

posted by fregante over 4 years ago

I think we should send a ticket into github. We really depend on it, (the whole GithubURL will not work). I hope they are not removing it.

posted by yakov116 over 4 years ago

This is not a bug. Issues don’t have a branch.

GitHubURL should not depend on it.

posted by fregante over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests