Clicking on a milestone's "xyz issue" link can lead to apparently wrong result of 0 issues found

Summary

The "xyz issues" link on the Milestones overview of a project shows the total number of issues per milestone. When clicking the link, you are taken to the list of open issues of the milestone, though.

For Milestones without any open issues left, this gets you to a page where a prominent "Sorry, your filter produced no results" grabs your attention and makes you think about what you or the system is doing wrong.

Steps to reproduce

  1. Go to e.g. https://gitlab.com/gitlab-org/gitlab-ce/-/milestones?sort=due_date_desc&state=all (all the milestones there are closed, which helps to illustrate the issue, but this also happens with open milestones)
  2. Click on any of the "xyz issues" links, e.g. https://gitlab.com/gitlab-org/gitlab-ce/issues?milestone_title=10.0 or https://gitlab.com/gitlab-org/gitlab-ce/issues?milestone_title=9.5
  3. Be surprised about either no and the message mentioned above, or very few issues being shown instead of the hundreds you expected

Example Project

See links above; also the behavior for any project I've seen so far.

What is the current bug behavior?

The milestone overview shows the total number of issues on a milestone, but the link leads to the open issues on the milestone.

What is the expected correct behavior?

Either the link should go to all of the issues on the milestone, or there should be more detailed numbers in the operview (e.g. "xyz open, abc closed issues").

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise.)

Output of checks

This bug happens on GitLab.com