Skip to content

[GUI] Provider activation promise not awaited, may show stale state #58

@Vantalens

Description

@Vantalens

File: packages/gui/src/App.tsx:510

Severity: Medium

Description:
activateProvider().then(onRefresh) chains but isn't awaited in onClick; if user rapidly clicks multiple providers, onRefresh fires before activations settle.

Code:

<Button onClick={() => client?.activateProvider(provider.id).then(onRefresh)}>激活</Button>

Failure Scenario:
User clicks Provider A → clicks Provider B immediately → both activations fire → onRefresh runs before backend processes them → UI shows wrong active provider.

Suggested Fix:
Disable button during activation or use async onClick handler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingguiGUI/frontend related issuesjavascriptPull requests that update javascript codemedium-priorityMedium priority issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions