fix: avoid stale versions in switch-instance popup#6133
Conversation
Filter the popup source list against the repository before creating GameItem rows so a version removed during asynchronous deletion is not rendered from an outdated UI cache. Constraint: Issue HMCL-dev#6099 occurs while repository state and the main page cached version list are briefly out of sync during deletion. Rejected: Catching VersionNotFoundException in icon lookup | preserves repository lookup semantics and fixes the stale UI source instead. Confidence: high Scope-risk: narrow Directive: Keep popup item creation aligned with current repository membership when using cached version lists. Tested: ./gradlew -g .gradle-user-home :HMCL:compileJava; ./gradlew -g .gradle-user-home :HMCL:checkstyleMain; git diff --check Not-tested: Manual JavaFX reproduction of issue HMCL-dev#6099.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the GameListPopupMenu to filter the list of game versions by checking their existence in the profile's repository before display. Feedback suggests enhancing robustness by adding null checks for the profile and versions parameters, filtering null elements within the stream, and optimizing performance by extracting the repository reference outside the stream processing.
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fix #6099