We are using SonarQube version 9.9 and experiencing inconsistent pagination behavior with the issues/search API.
We fetch issues using ps=100. Due to the 10,000 issue limit, after every 10,000 issues we reset the page number and continue fetching by using the last fetched issue’s creationDate with a createdAfter approach.
However, some issues have the same creationDate. Because of this, the API does not seem to return stable pagination results. For example, page 42 returns issues, page 43 returns an empty issue list, but page 44 returns issues again.
Example:
Page 42 -> returns issues
Page 43 -> returns empty issues list
Page 44 -> returns issues
This causes a risk of missing issues in our integration, because an empty page may be interpreted as the end of the result set.
We are also using the s parameter to sort by creation date, but the pagination result still seems inconsistent when multiple issues have the same creationDate.
Could you please clarify:
-
Is this expected behavior in the
issues/searchAPI? -
How does the API guarantee stable pagination when multiple issues have the same
creationDate? -
Is there a recommended way to use a secondary stable sort field?
-
Is using
createdAfterafter each 10,000 issues the correct approach?
Example endpoint format:
/api/issues/search?p=43&ps=100&s=CREATION_DATE&createdAfter=...
/api/issues/search?p=44&ps=100&s=CREATION_DATE&createdAfter=...
Thank you.