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
default-branch-button sometimes generates an incorrect URL when the latest version tag has a slash #6553
Despite all previous fixes, it appears that the default-branch-button feature still generates an incorrect URL for the default branch in certain very specific scenarios when the following steps are performed exactly without reloading the page between steps (video demonstration at the end) in a repository where the latest version tag contains a slash:
Using the Switch branches/tags dropdown menu (see figure 1), switch to any tag that is not the latest version (so that the Visit latest version button appears) (switching to a branch only sometimes reproduces the issue);
Press the Visit latest version button (see figure 2);
Press the See this view on the default branch button (see figure 3);
The issue occurs.
On an unrelated note, it appears that the incorrect generated URLs are different depending on whether the user is logged in.
When the user is logged in, the generated URL is in the form https://github.com/user/repo///branch-name-after-slash (https://github.com/DanielMiao1/chess///patch-1 for the first example repository), while performing the same steps logged out yields a URL in the form of https://github.com/user/repo/tree/default-branch-name/branch-name-after-slash (such as https://github.com/DanielMiao1/chess/tree/main/patch-1).
Thank you for the very detailed report! Interestingly this only happens when using latest-tag-button in step 3, but it works correctly when using the native branch selector to visit the same tag.
Activity
fregante commentedon Apr 26, 2023
Thank you for the very detailed report! Interestingly this only happens when using
latest-tag-buttonin step 3, but it works correctly when using the native branch selector to visit the same tag.