Skip to content

[Bug] Deleting a node leaves its connections on the pins of the other nodes #50

Closed

Description

@bhowiebkr

Before submitting

  • I read the known problems in STATUS.md and searched open and closed issues.
  • I removed credentials, private paths and files I cannot share, also from any graph file I attach.

Program

From the source code

Area

Undo and redo

Observed behavior

After a node is deleted and the delete is undone, the graph runs the deleted node object as well
as the restored one. The nodes after it run two or three times, and the output node can show a
value from the deleted node. Each delete and undo makes execution slower.

Reproduction

  1. Open examples/password_generator_tool_group.md.
  2. Select Password Generator Engine and delete it.
  3. Undo.
  4. Run the graph.

Observed: run as automated tests, not by hand on the desktop. 14 tests in 5 files fail each run
(now marked xfail): test_delete_undo_performance_regression.py,
test_actual_execution_after_undo.py, test_performance_fix_demonstration.py,
test_performance_regression_validation.py and test_password_generator_chaos.py.

Expected behavior

After the undo, the graph is as before the delete: each connection is on its two pins, no pin
holds a connection that the graph does not have, and each node runs once.

Impact

Everyone who deletes a node and undoes. The run results are wrong until the editor opens the
file again. NOT_ENOUGH_INFO: a save after the undo was not checked. Save writes
graph.connections (source-derived), and the tests find no wrong entry there, only on the pins.

Build

From the source code, commit c04d1b2 with the uncommitted changes of the repository upgrade.

System

Windows 11, Python 3.13.14, PySide6 6.12.0.

Evidence

  • Observed: after delete and undo, pins of the remaining nodes hold connection objects that are
    not in graph.connections. The executor follows pin.connections, so it reaches the deleted
    node object.
  • Source-derived: DeleteNodeCommand.execute in
    src/pyflowgraph/commands/node/basic_operations.py removes each connection from
    graph.connections and from the scene, but not from its start and end pins.
    CreateNodeCommand.undo in the same file does the same.
  • Proposed check, run: a pytest plugin that, after DeleteNodeCommand.execute, removes each
    affected connection from its two pins. With it, all 14 tests pass.
  • Still works: delete and undo of a connection alone.

Reported by

Claude Code agent (Claude Opus 5.5). Not yet reviewed by a person.

Activity

  1. added
    bugSomething isn't working
    undo-redoCommand system and state management
    on Nov 15, 2026
  2. bhowiebkr commented on Nov 15, 2026

    @bhowiebkr
    OwnerAuthor

    Fixed in 5316e8c. Deleting a node now removes its connections from the pins of the other nodes. Checked by tests/test_node_deletion_connection_bug.py; all test files pass with tools/run_tests.py on Python 3.13 and 3.11.

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

    bugSomething isn't workingundo-redoCommand system and state management

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions