Skip to content

Conversation

SlaviGetov
Copy link

Hi @chrisjpatty,

A strange issue started occurring after I changed the circularBehavior to allow in my code. Upon linking a node to a pair of cyclic nodes, the program would just crash. I've attached a video to demonstrate how the bug can be reproduced:

cyclicbug.mp4

According to the error, the problem happened here:
image

Judging by the code in the utilities.ts file, the code does not handle the edge case where the start node has an exit point into a cyclic connection, which does not have an exit point to the start node, resulting in a recursive lock and the code never reaching the if statement on line 17.

Additionally, I decided to reorganize the code in the nodesReducer so it only calls it when it either needs to warn or prevent the connection from happening.

Thank you for creating this package, it has helped me a lot more than you can imagine.

@chrisjpatty
Copy link
Owner

Oh good catch thanks for the PR. I'll try to get this reviewed and merged soon.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants