Message scope context store

so far the context store only have node, flow and global scope, but there is some objects still might need to be pass with the message during execution but not cloneable.

the most obvious example are http request and response, what node-red currently does is having them in as req and res in message and exclude them when cloning the message object (RED.util.cloneMessage), which is not really convenience

this behavior really creates problem when writing third-party nodes for node-red

Hi @eslym

Is there a question or feature request here?

What behaviour (having req/res in themsg? the non cloning of req/res? other non cloneable props? ) and what problems are you having?

previously i was thinking maybe node red could provide a way to safely pass non-cloneable objects with message, like what node-red does to http request
if i want making node-red to support discord interaction, then the interaction need to be pass with message, but now i found the way to do it safely node.send({ ...msg, getInteraction: ()=> interactionObject }), using this method can ensure the interaction object will be the same instance as it received

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.