You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
latest-tag-button sometimes fails getting the "ahead-by count" #2927
constgetAheadByCount=cache.function(async(latestTag: string,defaultBranch: string): Promise<number>=>{letaheadCount=awaitfetchDom(`/${getRepoURL()}/releases/tag/${latestTag}`,'.release-header relative-time + a[href*="/compare/"]');if(!aheadCount){aheadCount=awaitfetchDom(`/${getRepoURL()}/compare/${latestTag}...${defaultBranch}`,'#js-repo-pjax-container div.overall-summary > ul span');}// This text is "4 commits to master since this tag or 4 Commits"returnlooseParseInt(aheadCount!.textContent!);},{maxAge: 1/24,// One hourstaleWhileRevalidate: 2,cacheKey: ([latestTag])=>`tag-ahead-by:${getRepoURL()}/${latestTag}`});
For the time being it would be good to just avoid that empty tooltip, for example by adding the tooltipped classes together with aria-label attribute, not before.
For the time being it would be good to just avoid that empty tooltip, for example by adding the tooltipped classes together with aria-label attribute, not before.
If found, use its position; if not, just use a number-less <sup>+</sup> in the latest-tag-button
After all, the point of this information is to know whether we're on the latest commit. Anything above +20 (or missing/incorrect information) isn't particularly useful.
Activity
yakov116 commentedon Jun 3, 2020
What about something like this?
fregante commentedon Jun 3, 2020
Can't. Compare pages can be pretty heavy and slow as well though, just like the API.
This page takes a few seconds to load: 1.9.1...master
For the time being it would be good to just avoid that empty tooltip, for example by adding the
tooltippedclasses together witharia-labelattribute, not before.fregante commentedon Jun 3, 2020
Done: e422c8c
yakov116 commentedon Jun 3, 2020
Could we make it a silent error?
fregante commentedon Jun 6, 2020
I looked again into GraphQL but, while it has a
beforequery, it appears to be completely ignored 🤷♂️{ repository(owner: "sindresorhus", name: "refined-github") { ref(qualifiedName: "master") { target { ... on Commit { id history(first: 100, before: "e422c8c7fe3f531816d0e0a7867c09b9acc7b266 1") { totalCount /* Also useless: it always includes ALL the commits */ edges { node { message } } } } } } } }So instead I'm thinking we could:
Get the latest tag’s
shaLook for it in the latest 20 commits on
defaultBranchRef{ repository(owner: "sindresorhus", name: "refined-github") { defaultBranchRef { target { ... on Commit { history(first: 20) { edges { node { oid }}}}}}}}If found, use its position; if not, just use a number-less
<sup>+</sup>in thelatest-tag-buttonAfter all, the point of this information is to know whether we're on the latest commit. Anything above
+20(or missing/incorrect information) isn't particularly useful.yakov116 commentedon Jun 7, 2020
TADAIt was a nice try, but commits can be out of order.