Checks
Problem Description
This is an issue with the current dev branch using the Last History Result feature. It appears to be an intermittent issue and is caused by a race condition in the 'MainViewModel' class between the async operations of QueryResultsAsync and OpenResultAsync. Result selected is added to the result history but this sometimes may not happen before the result list is constructed by QueryResultsAsync call. This has the consequence that when user is using the 'Empty Last Query' query style, the last opened result does not appear in the Home Page of history results, and a re-query must be run (Ctrl + R) in order to have it shown with the last opened result.
To Reproduce
- 'Empty Last Query' query style is on, 'Last opened history' for 'Last Query Style' is chosen, Home Page is enabled and 'Show History Results in Home Page' is enabled.
- Search for paint and open the result
- Go back to the search window and see paint does not show up as a history result until re-query or a new query is typed and cleared
Debug in code, go to MainViewModel.cs file:
- Put breakpoint at
OpenResultAsync method's _history.Add(result); line
- Put breakpoint at
QueryResultsAsync method's QueryHistoryTask(currentCancellationToken); call
- Repeat the above steps and see sometimes
QueryResultsAsync operation is triggered before OpenResultAsync has added the history result to _history
Screenshots
No response
Flow Launcher Version
dev branch
Windows Build Number
Win 11
Error Log
Details
Replace this line with the important log contents.
Checks
I have checked that this issue has not already been reported.
I am using the latest version of Flow Launcher.
I am using the prerelease version of Flow Launcher.
Problem Description
This is an issue with the current dev branch using the Last History Result feature. It appears to be an intermittent issue and is caused by a race condition in the 'MainViewModel' class between the async operations of
QueryResultsAsyncandOpenResultAsync. Result selected is added to the result history but this sometimes may not happen before the result list is constructed byQueryResultsAsynccall. This has the consequence that when user is using the 'Empty Last Query' query style, the last opened result does not appear in the Home Page of history results, and a re-query must be run (Ctrl + R) in order to have it shown with the last opened result.To Reproduce
Debug in code, go to MainViewModel.cs file:
OpenResultAsyncmethod's_history.Add(result);lineQueryResultsAsyncmethod'sQueryHistoryTask(currentCancellationToken);callQueryResultsAsyncoperation is triggered beforeOpenResultAsynchas added the history result to_historyScreenshots
No response
Flow Launcher Version
dev branch
Windows Build Number
Win 11
Error Log
Details