Files
cloudbeaver/webapp/common-react
801139e3ff dbeaver/pro#8068 [CB] Fix: form reload on save and AI settings language (#4140)
* dbeaver/pro#8068 fix: FormPart reload after save: race condition between loaded=false and savingPromise

Problem:
FormPart.save() sets loaded=false after successful save, expecting
useAutoLoad to call load() and reload data from server. However,
load() is blocked by formState.savingPromise guard (added recently in dbeaver/pro#8151, 9c406a4e1e),
which is only cleared later in FormState.save() finally block.
By the time savingPromise is cleared, no observable changes trigger
a React re-render, so useAutoLoad never retries — loaded stays false
forever and isChanged always returns false, permanently disabling
the Save button.

Solution:
Make FormPart.save() self-contained by adding an inline post-save
reload. After saveChanges(), set loaded=false (so setInitialState
resets both initialState and state), call loader() directly, then
set loaded=true. This eliminates the dependency on the external
useAutoLoad mechanism for post-save reload, avoiding the race
condition with savingPromise entirely.

* dbeaver/pro#8068 fix(Combobox): preserve custom value on Enter key press

When allowCustomValue is enabled, pressing Enter was selecting
an auto-highlighted item from the dropdown instead of keeping
the user's typed value. Disable autoSelect and close the popover
via Ariakit store on Enter to match the blur behavior.

* dbeaver/pro#8068 fix: after saveChanges(), reset state synchronously via setInitialState

* dbeaver/pro#8068 fix: remove redundant state loading in FormPart class

* dbeaver/pro#8068 feat: improve loadable state handling in useAutoLoad and FormPart

---------

Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2026-02-23 17:18:50 +01:00
..
2025-12-18 12:49:11 +01:00