Skip to content

Query Tool execute option checkboxes are not reverted when changing the option fails #10600

Closed

Description

@dpage

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.

Found whilst working on #9603 (#10593).

Activity

  1. dpage commented on Oct 16, 2026

    @dpage
    ContributorAuthor

    Fixed in ac76a81 (#10621).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions