Skip to content

Conversation

Copy link

Copilot AI commented Nov 30, 2025

Hide item context menu action showed success but item remained visible due to race condition—ReQuery() executed before DisableProgramAsync completed, and cache wasn't cleared.

Changes

  • Fix race condition: Wrap disable/requery in Task.Run(async...) to await completion before ReQuery()
  • Clear cache: Call ResetCache() after disabling to ensure fresh query results
  • Fix logic bug: Replace .First() with .FirstOrDefault() + null check to avoid exception when program not in UWP list (needed to fall through to Win32 check)
  • Add error handling: Wrap in try-catch with logging; move success message after operation completes
// Before: fire-and-forget race condition
_ = DisableProgramAsync(program);
Context.API.ShowMsg(...);  // Shows immediately
Context.API.ReQuery();     // Queries before disable completes

// After: proper async sequencing
_ = Task.Run(async () =>
{
    try
    {
        await DisableProgramAsync(program);
        ResetCache();
        Context.API.ShowMsg(...);
        Context.API.ReQuery();
    }
    catch (Exception e)
    {
        Context.API.LogException(ClassName, "Failed to disable program", e);
    }
});
Original prompt

This section details on the original issue you should resolve

<issue_title>BUG: Hide item option does not work</issue_title>
<issue_description>### 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

After hiding an item from the dropdown list, the item remains visible afterwards.

To Reproduce

  1. Open Flow, search for an item, right click on it and press Hide
  2. The popup notification appears, saying: "Success! Successfully disabled this program from displaying in your query"
  3. The item remains in the query
  4. Clear the query and search for the item again afterwards, it still remains visible.

Screenshots

No response

Flow Launcher Version

2.0.3

Windows Build Number

10.0.26200.7171

Error Log

N/A</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@prlabeler prlabeler bot added the bug Something isn't working label Nov 30, 2025
Copilot AI changed the title [WIP] Fix hide item option not working in Flow Launcher Fix hide item option not working in Program plugin Nov 30, 2025
Copilot AI requested a review from Jack251970 November 30, 2025 06:21
Copilot finished work on behalf of Jack251970 November 30, 2025 06:21
@Jack251970 Jack251970 closed this Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 min review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Hide item option does not work

2 participants