Restore package icons missing from list views - #5311
Merged
Conversation
Copilot started reviewing on behalf of
Gabriel Dufresne (GabrielDuf)
August 21, 2026 17:41
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Improves package icon recovery by replacing permanent failure caching with retryable failure tracking.
Changes:
- Adds five-minute retry tracking across package lookup and UI decoding caches.
- Clears lookup state during icon-cache resets and corrects icon MIME mappings.
- Adds package-level retry and reset tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
PackageIconLookupTests.cs |
Tests lookup retries and resets. |
Package.cs |
Tracks failed icon lookups. |
IconCacheEngine.cs |
Corrects ICO MIME mappings. |
Interface_PViewModel.cs |
Resets the package icon cache. |
PackageCollections.cs |
Tracks UI icon failures and decoding retries. |
Suppressed comments (2)
src/UniGetUI.Avalonia/Models/PackageCollections.cs:115
- Clearing these collections does not invalidate tasks already present in
_inflightIconLoads. An icon load that completes after this method returns will callCacheIconorMarkIconFailedand repopulate the just-cleared state, so resetting the cache can still leave a package suppressed for another five minutes. Cancel/drain in-flight loads or use a cache-generation token so pre-clear completions are discarded.
_iconCache.Clear();
_iconCacheOrder.Clear();
_failedIcons.Clear();
src/UniGetUI.PackageEngine.PackageManagerClasses/Packages/Package.cs:405
GetIconUrlIfAnycan still be running while this reset executes; that call may write a success or failure immediately after both dictionaries are cleared. In particular, a stale failure then defeats the reset's intended immediate retry for five more minutes. Synchronize resets with active lookups or gate writes with a generation captured before loading.
_cachedIconPaths.Clear();
_failedIconLookups.Clear();
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Aug 21, 2026
4 tasks
4 tasks
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 significant improvements to the icon caching and lookup system across the package engine, UI, and supporting infrastructure. The main focus is to prevent repeated attempts to load or decode icons that have previously failed, by tracking failures and introducing a retry interval. Additionally, the changes improve cache clearing, error logging, and test coverage for these behaviors.
Icon caching and failure tracking improvements:
PackageWrapperandPackage, preventing repeated attempts to load icons that have recently failed. A retry interval (default 5 minutes, test-overridable) is enforced before another attempt is made.Icon loading and decoding robustness:
Infrastructure and test coverage:
PackageIconLookupTests) to verify correct retry behavior, cache clearing, and icon lookup caching, including support for overriding the retry interval in tests.Minor corrections:
IconCacheEngine.cs.Icon caching and failure tracking:
PackageWrapperand failed icon lookups inPackage, with logic to prevent repeated attempts within a configurable interval.Icon loading and decoding:
Testing and infrastructure:
PackageIconLookupTeststo verify retry, cache, and clearing behaviors, including a test-only override for the retry interval.Other: