applets/kicker: don't emit queryFinished if still querying
Reason for the change
The kicker backend passes the RunnerManager's queryFinished signal forward, if there are no querying runners remaining. Both kicker's frontend and kickoff use this to display "No matches". This doesn't work, because RunnerManager emits this signal when the query is finished for any reason, including when it is aborted. This is particularly troublesome in kickoff, as it aggregates the results on the krunner side, and only uses one query itself. So the following happens:
- the user types the first letter, the number of querying models is set to 1, and the query is started
- the user types the second letter, the number of querying models is set to 1, and the query is started
- the first query is aborted (as it's replaced be the new one), and the RunnerManager sends the queryFinished signal to the kicker backend
- the kicker backend receives the signal, reduces the number of querying models by 1 (now 0), and signals kickoff that the query is finished
- the frontend displays "No matches" with a query still running
- the actual results come in and replace the placeholder
Similar things can happen in Kicker, but it's less common there, as it has multiple querying models and so will often have actual results ready when the internal tracker of running queries inappropriately hits zero.
Instead, as each querying model sends queryFinished, we check first if the model is still querying. If so, we just skip that signal; it was a query that stopped for other reasons. This solves the issue in both kickoff and kicker.
Test plan
- Open kickoff
- Start typing
Screenshots or screen recordings
The issue can be seen in this video
Bugs fixed
BUG: 473174 FIXED-IN: 6.5.4