Skip to content

Edit session silently decouples from active source when pipeline node is switched mid-session #33

Description

@pcolt

Description

When a user starts an edit session and then clicks a different node in the pipeline browser, the session is not aborted or warned — but the backend's active source silently switches to the new node while EditSession.working_dataset still holds a deep copy of the original node's mesh.

Steps to reproduce

  1. Load a mesh and start an edit session (Edit Tools → Begin Edit Session).
  2. While the session is active, click a different node in the pipeline browser.
  3. The viewport updates to show the new node, but edit_session_active remains True and the edit panel stays open.
  4. Make a selection and commit.

What goes wrong

  • on_active_pipeline_item_change (state_handlers.py:56) has no guard for edit_session_active, so pv_backend.set_active_node() runs unconditionally.
  • After the switch, pv_backend.source points to the new node, but edit_session.working_dataset is still the deep copy of the original node.
  • Any pick/selection event is now dispatched against the wrong source in the backend.
  • A commit saves the session's working dataset (from the original node) to the original filename, regardless of what is displayed.

Risk

Silent data-integrity issue: the user may believe they are editing the currently displayed mesh, but edits land on the original node's file.

Candidate fixes

  • Block switching (simplest): in on_active_pipeline_item_change, return early if state.edit_session_active is True and optionally show a notification explaining why the switch was ignored.
  • Prompt to discard (friendlier): detect the switch attempt, show a confirmation dialog ("Discard current edit session and switch node?"), and only proceed if confirmed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions