[Bug] Refreshing PR page causes commit links to change destination

Hi, I’ve encountered an odd bug where refreshing the page of a PR results in the links of the commits to change their destination randomly.

On the PR page the “user added x commits x time ago” section typically has links of the form https://github.com/.../.../pull/415/commits/<hash>.

If I refresh the page a few times the links sometimes change and then have the form https://github.com/user/repo/commit/<hash>. In other words, they now point to the commit in the repository and not the PR.

Which link you get seems entirely random each time you refresh the page, but it has various implications:

  1. Depending on the randomness, reviewers leave comments on the repository and not the PR, which are then not visible to the PR author when they look at their PR or the individual commits (comments left on one URL are not visible on the other).

  2. Leaving comments on the commit/<hash> URL, rather than the pull/415/commits/<hash> URL, means that those comments don’t produce any event in the webhook.

I had a video accompanying this bug report, but it seems I can’t upload it here. Feel free to contact me for the video or any extra information.