When a Project is first analyzed, or a Portfolio is computed, the ComponentContainer component should automatically refresh once the background task is completed, triggering a re-render of the overview and the component navigation. However, in some cases, this doesn't occur, and either you stay on the same page (say, tutorial page for projects), or some parts of the UI dont get updated (the component navigation, for instance).
Upon initializing the ComponentContainer, we check whether any tasks were already "done" (returned as current), or if any are in the queue.
- If one was done, we assume it's a report that was processed, and load the overview.
- If we only find pending tasks, we wait until one of them moves to "In progress", and reload the overview.
The problem occurs if, upon initial load, no task is current, and, when checking again, nothing is marked as "in progress", but goes straight to current. This can happen on fast systems, especially when analyzing small projects. In that case, SQ will continue pinging the queue, to see if anything moves to "in progress".
If anything is set as current, whereas before there wasn't anything, we can safely assume the report was processed, and treat it like any "initial" analysis.