Project delayed deletion does not invalidate cached counts of user assigned MRs
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=435914) </details> <!--IssueSummary end--> <!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "type::bug" label: - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=type::bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary When a [project is delay deleted](https://docs.gitlab.com/ee/user/project/working_with_projects.html#delayed-project-deletion), the count of MRs a user is assigned to isn’t [invalidated](https://gitlab.com/gitlab-org/gitlab/-/blob/4f71b89a4ec6343683990489dcd82981c020e734/app/models/user.rb#L1915-1920). Workaround: Go to an MR that you are assigned to, close it, and reopen, to invalidate the cached counts. The counts will now be correct. ### Steps to reproduce These steps can be done on SaaS which has a 7 day delayed deletion policy. 1. Create a project 2. Create an MR 3. Assign that MR to yourself. Note in the sidebar, your Assigned MR count will increase 4. Now delete the project with delayed deletion 5. Note that the Assigned MR count is not decremented <!-- If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report. If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version. -->
issue