You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Query Tool execute option checkboxes are not reverted when changing the option fails #10600
When changing auto commit, auto rollback or server cursor from the Query Tool's execute options menu fails, the checkbox is meant to go back to its previous value, but it never does, so the menu then disagrees with what the server is actually using.
In MainToolBar.jsx (checkMenuClick, around lines 127-156), the request is sent from inside the setCheckedMenuItems state updater, and the .catch handler sets the local newVal back to the old value. The updater has already returned by then, so the assignment has no effect and setCheckedMenuItems is never called again. For server cursor, the updateServerCursor context update made at the same time is not reverted either. In addition, set_pref_options returns HTTP 200 with status: false when the transaction or connection check fails, and that case never reaches .catch at all.
There is also a possible race (traced from the code, not reproduced): toggles are sent without waiting for the previous response, and each request does a read-modify-write of the pickled transaction object in the session, so with threaded mode, quick successive toggles can complete out of order or overwrite each other's change.
Suggested fix: move the request out of the state updater, revert the checkbox (and updateServerCursor) when the request fails or returns status: false, and disable the menu item while a request is in flight.
Activity
Revert the Query Tool execute option checkboxes when changing an opti…
dpage commentedon Oct 16, 2026
Fixed in ac76a81 (#10621).