Skip to content

CmdPal: deadlock when building app details #45074

@jiripolasek

Description

@jiripolasek

Microsoft PowerToys version

main

Installation method

Dev build in Visual Studio

Area(s) with issue?

Command Palette

Steps to reproduce

  1. Open All apps.
  2. Use the mouse to select a Steam game for the first time after startup. (Using keyboard _won't trigger that issue).
  3. Observe the UI deadlock.

What happened

The change that fixed Steam icons (#44938) uncovered a deadlock while building AppListItem details:

A) Pre-existing “time bomb”

There’s a pre-existing risk here:

_details = new Lazy<Details>(() =>
{
var t = BuildDetails();
t.Wait();
return t.Result;
});

B) Steam icon fix changes the thumbnail code path

The Steam icon fix allows .ico files to be used as both the list icon and the hero icon. That routes execution through a different code path in ThumbnailHelper.GetThumbnail:

public static async Task<IRandomAccessStream?> GetThumbnail(string path, bool jumbo = false)
{
var extension = Path.GetExtension(path).ToLower(CultureInfo.InvariantCulture);
var isImage = ImageExtensions.Contains(extension);
if (isImage)
{
try
{
var result = await GetImageThumbnailAsync(path, jumbo);
if (result is not null)
{
return result;
}
}
catch (Exception)
{
// ignore and fall back to icon
}
}
try
{
return await GetFileIconStream(path, jumbo);
}
catch (Exception)
{
// ignore and return null
}
return null;
}

C) Triggered from the UI thread via mouse interaction → deadlock

Because the detail load is triggered from the UI thread (via mouse selection), we end up in a deadlock.

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Additional Information

No response

Other Software

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugSomething isn't workingProduct-Command PaletteRefers to the Command Palette utilityStatus-In progressThis issue or work-item is under development

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions