Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register subflow module instance node with parent flow #3818

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

knolleary
Copy link
Member

Fixes #3798

When creating a subflow module instance, we would create the Subflow object then start it before returning back to the parent Flow. However, starting the subflow requires all of its nodes being started - which could involve node lookups (eg mqtt in node calling RED.nodes.getNode() to get ahold of its broker node. For that type of node lookup to work, the flow needs to know the subflow module instance exists - but as that is being done as part of the start code which happens before the parent flow knows about it, the lookups will fail.

This PR fixes it by getting the subflow instance registered with the parent Flow before the instance gets started. It isn't the most beautiful fix as the Flow's view of subflow instances should not be externally modifiable like this... but then again, it works.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 68.199% when pulling 5c29fee on fix-subflow-module-node-lookup into dc7fef6 on master.

@knolleary knolleary merged commit d94f3a4 into master Aug 4, 2022
@knolleary knolleary deleted the fix-subflow-module-node-lookup branch August 4, 2022 11:57
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.

bug: configuration of nodes goes missing upon deploying nodes packed within subflows
2 participants