Update WinGet catalog snapshot and ensure successful index refresh - #5365
Merged
Gabriel Dufresne (GabrielDuf) merged 3 commits intoSep 9, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
September 9, 2026 19:49
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Nonzero refresh exit codes are treated as successful, preventing the required retry.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Improves WinGet catalog cache invalidation and package-index refresh retry behavior.
Changes:
- Keys native WinGet snapshots by source-index generation.
- Avoids redundant refreshes after successful attempts.
- Adds tests for caching and refresh retries.
File summaries
| File | Description |
|---|---|
WinGetManagerTests.cs |
Tests snapshot invalidation and generation updates. |
PackageManagerTests.cs |
Tests refresh retry behavior. |
TestPackageManager.cs |
Adds injectable refresh behavior. |
PackageManager.cs |
Tracks refresh success across retries. |
WinGet.cs |
Adds and advances the index generation. |
NativeWinGetHelper.cs |
Includes generation in snapshot cache keys. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
September 9, 2026 20:07
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation and focused tests consistently cover generation-based invalidation and single-refresh retry behavior.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0 new
- Review effort level: Balanced
There was a problem hiding this comment.
🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉
Integration Details
{
"deliveryId": "31636d60-ac8a-11f1-8474-925abbd4d437",
"headSha": "83f8910da9c06fbcdb9e19be471c7d5e87564fba",
"reviewer": "copilot-pull-request-reviewer[bot]"
}
Gabriel Dufresne (GabrielDuf)
deleted the
fix/winget-stale-catalog-snapshot-5294
branch
September 9, 2026 20:31
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to how package index refreshing and catalog snapshotting are handled in the WinGet package manager integration. The main focus is to ensure that catalog snapshots are only refreshed when the package source index changes, improving efficiency and correctness. Additionally, the retry logic for update retrieval is enhanced to avoid unnecessary index refreshes, and new tests are added to verify these behaviors.
Catalog snapshotting and source index generation:
SourceIndexGenerationcounter inWinGet, which is incremented every time package indexes are refreshed (including on failure), and used as a cache key inNativeWinGetHelperto ensure catalog snapshots are only refreshed when necessary. (src/UniGetUI.PackageEngine.Managers.WinGet/WinGet.cs,src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/NativeWinGetHelper.cs) [1] [2] [3]Update retrieval retry logic:
PackageManagerso that the package indexes are only refreshed once per update attempt, and not redundantly on retries after fast repair; if the first refresh fails, a second attempt will refresh again. (src/UniGetUI.PackageEngine.PackageManagerClasses/Manager/PackageManager.cs) [1] [2] [3] [4] [5]Testing improvements:
TestPackageManagerfake to allow injection of custom index refresh logic, and added/updated tests to verify catalog snapshotting, index refresh behavior, and retry logic. (src/UniGetUI.PackageEngine.Tests/Infrastructure/Fakes/TestPackageManager.cs,src/UniGetUI.PackageEngine.Tests/PackageManagerTests.cs,src/UniGetUI.PackageEngine.Tests/WinGetManagerTests.cs) [1] [2] [3] [4] [5] [6]These changes make the package manager more efficient and reliable by reducing unnecessary work and improving error handling during update checks.