Skip to content

fix(api-access): keep health dialog key stable during checks - #526

Open
wenbaolu6666-design wants to merge 1 commit into
router-for-me:devfrom
wenbaolu6666-design:fix/health-dialog-remount
Open

wenbaolu6666-design wants to merge 1 commit into
router-for-me:devfrom
wenbaolu6666-design:fix/health-dialog-remount

Conversation

@wenbaolu6666-design

Copy link
Copy Markdown
Contributor

Problem

In the model health dialog, clicking "检测全部" could randomly reset the dialog and discard all in-flight results.

Root cause

providerHealthIdentity included row.models in the React key. When checkAllModels triggers setModels, the dialog's key changes, React unmounts and remounts the entire dialog, losing all check progress.

Fix

Remove row.models from the identity key. The remaining fields (section, index, name, baseUrl, authIndex, apiKeys) are stable for the lifetime of a provider row.

Remove row.models from providerHealthIdentity so refreshing the model
list does not remount ProviderHealthDialog mid-check and discard
in-flight results.
@github-actions
github-actions Bot changed the base branch from main to dev October 27, 2026 06:34
@github-actions

Copy link
Copy Markdown
Contributor

This pull request targeted main.

The base branch has been automatically changed to dev.

@lzt404

lzt404 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

I tested “Check all models” on the current version. The checks completed normally and the results were preserved; I couldn’t reproduce the dialog resetting.

Also, setModels updates the dialog’s local state, not row.models, which is used to compute the key. checkAllModels itself doesn’t call setModels either, so the proposed root cause doesn’t seem to match the code.

Could you share the affected version, reproduction steps, or a screen recording? A regression test that fails before this change and passes afterward would also help confirm the fix.

@wenbaolu6666-design

Copy link
Copy Markdown
Contributor Author

You're right — my root-cause analysis doesn't hold up. checkAllModels never calls setModels, and setModels only touches the dialog's local state, so row.models (and therefore providerHealthIdentity) is stable for the lifetime of the dialog. I can't reproduce the reset either, and I don't have a failing test to offer, so the justification for this change is gone.

Intended change was a one-line removal of row.models from the key. It's harmless but unjustified, so I'm fine with either outcome:

  • close the PR and revisit if someone can reproduce the reset (app version, steps, console errors, or a recording), or
  • keep it as defensive hardening with the rationale corrected to "the key should not depend on data that isn't required for identity".

Say which you prefer and I'll do it. Thanks for checking the actual call path.

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.

3 participants