Skip to content

fix: avoid stale versions in switch-instance popup#6133

Merged
Glavo merged 1 commit into
HMCL-dev:mainfrom
pynickle:fix-6099-delete-version-switch-crash
May 27, 2026
Merged

fix: avoid stale versions in switch-instance popup#6133
Glavo merged 1 commit into
HMCL-dev:mainfrom
pynickle:fix-6099-delete-version-switch-crash

Conversation

@pynickle
Copy link
Copy Markdown
Contributor

Fix #6099

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.
@Glavo
Copy link
Copy Markdown
Member

Glavo commented May 21, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

@Wulian233
Copy link
Copy Markdown
Contributor

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@Glavo Glavo merged commit 4c6f3ae into HMCL-dev:main May 27, 2026
2 checks passed
@pynickle pynickle deleted the fix-6099-delete-version-switch-crash branch May 27, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 删除版本时点击切换实例会崩溃

3 participants