Skip to content

_programmaticOp is one boolean shared by overlapping programmatic Plotly operations #76

Closed

Description

@jvdd

Problem

fvRunProgrammaticPlotlyOp (flexviz/adapters/js/plotly/render.js) sets the module flag _programmaticOp to true and clears it in the .finally of its own operation. When two programmatic operations overlap, the first one to finish clears the flag while the second is still running. A plotly_relayout from the second operation could then reach handleRelayout as if a user made it, and post a viewport event.

Reachability

Not reproduced. A test on 2026-09-23 ran fvApplyAxisLocks on three figures in the same tick (the path a linked-axes lock uses). Each figure emitted one relayout, and no POST was sent: Plotly emits the relayout before the operation's promise settles. So the window is small today, but it depends on Plotly's event timing.

Fix direction

Replace the boolean with a counter: increment on start, decrement in .finally, and treat the handler as guarded while the counter is above zero.

Activity

  1. added
    bug
    on Sep 23, 2026
  2. jvdd commented on Sep 25, 2026

    @jvdd
    ContributorAuthor

    Fixed by #89 (merge c3c01fc). The guard is now a counter per figure, fvRunProgrammaticPlotlyOp(figUid, op) in plotly/render.js, and every handler checks its own figure. _programmaticOp no longer exists on main 471c09b. Tests: test_the_guard_ignores_only_its_figure_until_its_last_operation_ends and test_the_guard_ignores_a_deselect_on_its_figure.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions