microsoft / microsoft/winget-cli

Attempt a source update when search fails

Open
#2,412 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Description of the new feature / enhancement

Although this is an edge case scenario, it may be good to consider.

Assume the user has the default source 'winget' configured.

If a user runs the command winget source update, all available sources will be updated.
The user can then run winget list .NET to see all the .NET packages installed on their machine.
This is all normal and as expected.

If the user manually removes the Winget source package through the command Get-AppxPackage 'Microsoft.Winget.Source' | Remove-AppxPackage, the data for the winget source will be removed. This is not something which a typical user would do, but a power user may do. The user can then attempt to run winget list .NET to see all the .NET packages installed on their machine. Based on the user's configuration, one of two things may occur.

  1. If the user has multiple sources configured they will receive the warning:
Failed when searching source; results will not be included: winget
  1. If the only configured source is the default winget source they will receive the error:
Failed when opening source(s); try the 'source reset' command if the problem persists.
An unexpected error occurred while executing the command:
0x8a15000f : Data required by the source is missing

However, in both cases, a source reset is not required. If the user waits until the source auto-update interval expires, the source will be updated and the search will succeed. Or, if the user runs winget source update, the source will be updated and the search will succeed.

Proposed technical implementation details

Given that the client already can detect these source errors, it would provide a smoother user experience if the client attempted to update the source and retry the search if such an error is encountered.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the CLI search path that reports source-search and source-open failures, then compare it with the existing winget source update flow. Check how the missing Microsoft.Winget.Source scenario is detected and how multiple versus single sources are handled. Done means an eligible source failure can recover through an update and retry without requiring source reset.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.