To-do count decorator decrement problem
<!--- 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 you have more than 99 to-dos, the decorator that shows your outstanding count on the right of the top nav shows `99+`. If you have more than 100 and resolve one on an issue or MR using the `Mark as done` button, the decorator incorrectly changes to `98`. Refreshing the page or navigating to another page will again show the correct decorator value of `99+`. It should instead stay at `99+` until you have 99 or fewer to-dos. ### Steps to reproduce * Login with a user who has at least 100 to-dos. The to-do count decorator on the top menu should say `99+`. * Open any issue or MR with an outstanding To-do and click `Mark as done`. Note the decorator changes to `98`. * Refresh the page or navigate to another page in GitLab. Note the decorator changes back to `99+`. ### Example Project This seems to happen everywhere on gitlab.com. See screen capture below. ### What is the current *bug* behavior? To-do count decorator in the top nav changes to `98` after resolving a to-do using the `Mark as done` button even if the user still has more than 99 to-dos. ### What is the expected *correct* behavior? If I user has more than 100 outstanding to-dos, the to-do count decorator in the top nav should remain showing `99+` after marking a task done. If the user has exactly 100 to-dos, it should change to `99` after resolving one more task. <!-- Describe what you should see instead. --> ### Relevant logs and/or screenshots Here is an example video of the behavior. (Ignore the auto-collapse of the right-side drawer. I think this is because I had the window so narrow and had manually expanded for the capture.) ![Screen_Recording_2023-01-11_at_1.41.01_PM](/uploads/40f120acf8925d5080b633bfc8da4310/Screen_Recording_2023-01-11_at_1.41.01_PM.mov) ### Output of checks <!-- If you are reporting a bug on GitLab.com, uncomment below --> <!-- This bug happens on GitLab.com --> <!-- /label ~"reproduced on GitLab.com" --> #### Results of GitLab environment info <!-- Input any relevant GitLab environment information if needed. --> <details> <summary>Expand for output related to GitLab environment info</summary> <pre> (For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`) </pre> </details> #### Results of GitLab application Check <!-- Input any relevant GitLab application check information if needed. --> <details> <summary>Expand for output related to the GitLab application check</summary> <pre> (For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:check SANITIZE=true`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`) (we will only investigate if the tests are passing) </pre> </details> ### Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem. -->
issue