Skip to content

Dev: Last history result not showing for 'Empty Last Query' query style #4374

@jjw24

Description

@jjw24

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 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

  1. '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.
  2. Search for paint and open the result
  3. 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:

  1. Put breakpoint at OpenResultAsync method's _history.Add(result); line
  2. Put breakpoint at QueryResultsAsync method's QueryHistoryTask(currentCancellationToken); call
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dev branch onlyAn issue or fix for the Dev branch buildbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions