Closed Steve-Mcl closed 10 months ago
It was pointed out on the nodered Slack #FlowFuse channel - why do I set msg.req
/msg.req
with the strings REQ:${eventId}
and RES:${eventId}
, why not simply apply req/res if present in the original msg.
Before publishing the PR, I spent a fair bit time mulling this over (e.g. should I just re-add req & res if present originally).
In the end, I left this in as belt and braces. e.g. These temporary strings guarantee the following:
msg
was an actual HTTP-In msg
req
/res`One point that may be worth considering is to leave the req
object in the msg
as the down stream flow may wish to use properties of it? I am fairly sure this would stringify without the circular ref errors.
Of course, the user could simply cherry pick properties from req
and add them to a separate object/payload if needed.
Thoughts?
/.../ leave the req object in the msg as the down stream flow may wish to use properties of it? I am fairly sure this would stringify without the circular ref errors.
I just checked and msg.req
too contains constructors that won't submit to stringification without a custom replacer. Downstream nodes are probably more interested in the res object, and having access to only one of them will probably introduce at least some level of confusion.
I think you've found a good level with the current solution that basically says "handle http entrance and exit on the same level", just like you should follow your guests to the door as they leave.
@lgrkvst thanks for the feedback.
Description
constructor
is something before attempting to read thename
property. This reveals the real exception - which in the case of the HTTP-Inmsg
object was a circular ref errormsg
contains the HTTP In nodereq
/res
properties is passed through project-call nodes, detach the properties then re-attach them when the response comes in.Related Issue(s)
42
Checklist
flowforge.yml
?flowforge/helm
to update ConfigMap Templateflowforge/CloudProject
to update values for Staging/ProductionLabels
backport
labelarea:migration
label