API /api/project_analyses/search does return a project but (rarely) /api/issues/search not the issues for that project on the first try

SonarQube version: 7.9.1

To ensure a Sonar issue report is available we poll the project_analysis API with: /api/project_analyses/search?project={projectId}

If this analysis search receives at least one result the report should be available:
{"paging":{"pageIndex":1,"pageSize":100,"total":1},"analyses":[{"key":"projectId", ......}], ......}

With /api/issues/search?componentKeys={projectId} we download the report for this specific project. The report should be available because the project_analysis API told us the analysis is available.

In most cases that is true and the first download is filled with all the issues.
But unfortunately - on very rare cases - the first report download is “empty”:

Only the second download and all further attempts are filled.

There seems to be a timely issue between “the analysis is available” and “the report is available”.

Are there any news on that?

Is this a bug? Or is the use case wrong?
Are we using the API correctly? Are there any workarounds?

Seems to be a timely matter of database inserts.

1st: the project is added to the database
2nd: all issues are added to the database

So in rare cases, if the issue search, comes right between the 1st and 2nd step, the issues are empty.

I’ll try to use the developers api to get the information if issues have been added to a project. The example response looks promising.