1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/packages/node_modules/@node-red/runtime/lib
Nick O'Leary 84771f5864
Flows/subflows must preinitialise their context objects
Fixes #2513

If a node inside a subflow accessed its context object in its
constructor, the subflow-instance flow context would not yet
have been created. This would cause a place holder context
to get created on its behalf, but that place holder doesn't
have its parent set properly. This then breaks the usage
of $parent inside such a subflow.

This fix has changed it so flows (and subflows) create their
flow context as part of their initial creation. That ensures
it exists when individual nodes from the subflow are created,
allowing them to safely access their context.

This has also fixed a related issue where any attempt to use
$parent to access beyond the root parent would seemingly hang
as the callback was never being called. This would cause
messages to get stuck in flows. The fix ensures the callback
is used in the root context objects and undefined is returned.
2020-03-27 23:47:12 +00:00
..
api Allow credentials to be provided as part of /flows api 2020-02-13 16:44:48 +00:00
library Handle empty list of example flows 2019-05-28 11:21:53 +01:00
nodes Flows/subflows must preinitialise their context objects 2020-03-27 23:47:12 +00:00
storage Add better handling of host-key-verify error with projects 2020-03-13 13:09:47 +00:00
events.js API documentation updates 2018-12-05 13:00:25 +00:00
exec.js Add event log to editor 2018-10-18 23:49:47 +01:00
index.js Use appropriate the version of Node.js 2019-08-06 19:24:45 +09:00
settings.js pull out editor-client and editor-api 2018-08-17 22:10:54 +01:00