Group issues api sometimes replaces moved issue with duplicate
Summary
When using the group issues api, if a moved issue and it's original are listed on different pages (one issue on the end of one page and the other on the start of another), then sometimes only one issue is listed twice, and the other is omitted.
Steps to reproduce
- Use the group issues api and find an issue that was moved (I look for duplicate titles) and confirm it is listed directly before or after the original
- Calculate per_page and page parameters to list one issue at the end of one page and the other at the start of the next page
- Call the groups issues api for that page and the next and look at the id of each result
Example Project
These are some sample calls that I have seen this happen for. I've found that I can reproduce it repeatedly and then try again a few hours later and have it not reproduce, and vice versa.
For issues with id 16227738 and 16227771: https://gitlab.com/api/v4/groups/4154683/issues?per_page=3&page=3 https://gitlab.com/api/v4/groups/4154683/issues?per_page=3&page=4
For issues with id 16155718 and 16174314 (this one is on the gitlab public group so these per_page and page parameters may need to be updated): https://gitlab.com/api/v4/groups/9970/issues?created_before=2018-11-29T20:14:10&per_page=75&page=3 https://gitlab.com/api/v4/groups/9970/issues?created_before=2018-11-29T20:14:10&per_page=75&page=4
What is the current bug behavior?
One issue is listed twice in the groups api issue output, one is omitted.
What is the expected correct behavior?
Both issues are listed in the groups api issue output regardless of if they are on the same page or not.
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(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
)
Results of GitLab application Check
Expand for output related to the GitLab application check
(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)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)