After a backup and restore, problem to create new handles dynamically.
See original GitHub issueDescribe the Bug
My project is to create a custom node, this custom node contains a button that allows new handles to be created. This works fine, but when the flow is saved and restored, the new handles added to the same custom node are not connectable.
This error message appears until the node is deleted:
couldn't create edge for source handle id: dndnode_1649946748290_call_3_call_1649946788581; edge id: reactflow__edge-dndnode_1649946748290dndnode_1649946788581-dndnode_1649946778292
I already tried with this problem: #1641, but it did not solve my error, maybe I missed something
I noticed that the number of Handle I added and the number of handleBounds
in the node are different after a restore, so I think this is a potential path to bug resolution. (You can see that on the screenshot)
Secondly, if a handle is removed, the edge remains and leads to errors, is it up to me to remove the edge programmatically?
0 -> 26 sec : The main issue 26 -> the end : The second question
Your Example Website or App
Here is the codesandbox link to my code, if you want to test it yourself: https://codesandbox.io/s/react-flow-issue-add-handles-after-restoring-k4uwgg
Steps to Reproduce the Bug or Issue
- Go to the sandbox code link above
- Drag and drop a “Custom Node” and an “Output Node” (the sidebar is at the bottom of the stream).
- Click on the “+ Add” button to add handles, you can create as many handles as you want.
- Link the handles of the custom node with the output node, each handle does not need to be linked.
- After that save with the green button (download icon) in the upper right corner.
- Refresh the page with F5 or the container.
- You will see the correctly restored stream
- Now create a new handle or handles and try to connect them to the output source.
The bug occurs if you go to the console an error message appears every time you change the node.
If you try to delete or link the two nodes with the handles created before the restore, this works as it should.
Expected behavior
As a user I expected to add new handles to my custom node after a restore but I can’t connect the new handles to nodes.
Screenshots or Videos
Platform
- OS: Linux
- Browser: Chrome
- Version: 10.1.0 & 10.0.8
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:13 (3 by maintainers)
Top GitHub Comments
Sorry guys! We will export the symbol you need for accessing the
handleBounds
!Thank you, @remibesset, for your help and suggestion! It works perfectly. Now this issue is not blocking me, though it would be better to have some kind of reliable documented API for this in the future.