KEMBAR78
Fix certain msstore source 404 failures by treating them as empty responses by yao-msft · Pull Request #5179 · microsoft/winget-cli · GitHub
Skip to content

Conversation

yao-msft
Copy link
Contributor

@yao-msft yao-msft commented Feb 4, 2025

When searching for store source with id that's recently taken down, store source will return 404 instead of empty results (what winget-cli-restsource does). This will be treated as a source search error in our code. The fix is to treat 404 response with certain schema as empty result instead of failure.

Tested manually with store source and added unit tests.

fixes #4785, fixes #4784

Microsoft Reviewers: Open in CodeFlow

@yao-msft yao-msft requested a review from a team as a code owner February 4, 2025 06:15
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@mdanish-kh
Copy link
Contributor

@yao-msft
Copy link
Contributor Author

yao-msft commented Feb 4, 2025

Does this resolve:

which subsequently should be the fix for

as well?

Yes. I'll link the issues. Thanks!

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-External Issue outside of winget-cli source labels Feb 4, 2025
@yao-msft
Copy link
Contributor Author

yao-msft commented Feb 4, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@JohnMcPMS JohnMcPMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yao-msft yao-msft merged commit 9c6d3b4 into microsoft:master Feb 4, 2025
9 checks passed
@yao-msft yao-msft deleted the 404empty branch February 4, 2025 20:53
JohnMcPMS pushed a commit that referenced this pull request Feb 5, 2025
…ponses (#5179)

When searching for store source with id that's recently taken down,
store source will return 404 instead of empty results (what
winget-cli-restsource does). This will be treated as a source search
error in our code. The fix is to treat 404 response with certain schema
as empty result instead of failure.

Tested manually with store source and added unit tests.

fixes #4785, fixes #4784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-External Issue outside of winget-cli source Issue-Bug It either shouldn't be doing this or needs an investigation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

404 error on msstore endpoint resulting in Failed to update source: msstore [PowerShell Module]: CatalogError if fetching msstore packages fails

3 participants