Skip to content

[GUI] setDefaultModel onChange may cause race with onRefresh #59

@Vantalens

Description

@Vantalens

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

Severity: Low

Description:
User rapidly changes default model; setDefaultModel().then(onRefresh) fires but onChange returns immediately; React may batch updates incorrectly or show stale model selection.

Code:

<select value={defaultModel} onChange={(event) => client?.setDefaultModel(event.target.value).then(onRefresh)}>

Failure Scenario:
User changes dropdown from A → B → C rapidly → three API calls fire → refresh callbacks race → UI may briefly show B then settle on C.

Suggested Fix:
Debounce onChange or disable select during update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingguiGUI/frontend related issuesjavascriptPull requests that update javascript code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions