I think I've discovered the cause of this bug. The post you linked not only has helpful spam or abuse flags, but it was also locked after being deleted, so the system treats it as if it were deleted as spam or abuse (those are locked at the same time as being deleted), and as such attempts to strip the title from the URL. The regex that removes the title from URLs of posts deleted as spam or abuse is a little bit too lenient: it also chops off query strings from the title when it shouldn't.
Most questions that are deleted (for any reason other than spam or abusive) don't have their URL title slug removed, and going to a short link or any link redirects to the full-form link that contains the title:
/questions/[post ID]/title-of-deleted-post
As an example, try clicking on this link: https://meta.stackexchange.com/q/321293. Even if you're a <10k user, the title of that deleted post will still be visible in the URL after the redirect.
In the past, this was true for all deleted questions. However, later on, spammers began to exploit this fact (e.g. https://meta.stackexchange.com/q/234567), so the team decided to strip the URL slug out from such posts*. Therefore, links like:
/q/22795
or:
/questions/22795/placeholder-for-title-of-question
redirect to:
/questions/22795
This happens for all users, 10k+ or not.
The bug lies in the fact that when performing the title stripping, the system considers everything after the ID to be part of the title, and strips them out. This means that things like ?page=2
get stripped out.
I've discovered that the stripping logic does not take place if I manually remove the title from the URL, and links like:
/questions/22795?page=2
...work properly and go to the second page. Even if you insert a /
between the post ID and the query string, it works correctly.
The pagination links, however, use the below type of link:
/questions/22795/placeholder-for-title-of-question?page=2
...which triggers the bug and everything after the post ID is stripped out.
I can think of a few possible fixes:
Do not include the title URL slug in the pagination link if the post is considered to have been deleted as spam or abuse. This seems a little too specific for this edge case; it's extremely rare for a question with lots of answers to occupy multiple pages to be deleted as spam or abuse, or for it to be manually locked after being deleted.
Do not include the title URL slug in the pagination link at all. This seems like it would result in too many redirects.
Do not strip out titles from URLs if the user has 10k+ rep. This might be too complicated.
Fix the stripping logic to not remove query strings. I think this is the best solution.
You may have noticed that fragments (e.g. #22802
) don't get removed. This is because they're not sent to the server, where the URL stripping takes place.
I think the same applies for the answer links: the "Return to Answer" links include the post title in the URL, which results in everything after the question ID getting stripped, including the part of the URL that results in the page changing if the answer is not on the first page.
Update: The development branch of the SOUP user script now contains a workaround for the page link issue. (It doesn't resolve the issue with the "Return to Answer" links.) This is planned for the next stable release (1.56).
* As the user was destroyed instead of the post being deleted as spam, it wasn't locked at the same time as being deleted, so it still remains as a live example. The change was applied retroactively to all posts, including the one you linked.