J'ai rélisé un programme en NODE RED qui effectue la mise à jour d'un flow par l'intermédiare de l'API j'utilise
msg.method = "PUT";
msg.url = "http://" + retain.host + ":1880/flow/" + encodeURIComponent(msg.idtab);
msg.headers = {
"Content-Type": "application/json",
"Authorization": "Bearer " + msg.Updatetopic
};
Tout se passe correctement et la mise à jour ce fait correctement.
Ma question est de savoir si le flow est bien démarré et que tout le flow de l'application à bein redémarré ? J'ai bien l'éditeur qui m'indique qu'il y a eu une modification. L'editeur trouve tous les nouveaux noeuds et ne trouve pas de conflit. Mais visuellement je ne vois pas un fonctionnement correcte ! Il suffit que je décalle un noeuds pour forcer un déploiement et tout se synchronise et le fonctionnent est optimum. Que pensez vous de mon problème ?
Cordialement
Hello everyone,
I created a Node-RED program that updates a flow via the API. I use the following:
msg.method = "PUT";
msg.url = "http://" + retain.host + ":1880/flow/" + encodeURIComponent(msg.idtab);
msg.headers = {
"Content-Type": "application/json",
"Authorization": "Bearer " + msg.Updatetopic
};
Everything proceeds smoothly, and the update completes successfully.
My question is: has the flow actually started, and has the entire application flow properly restarted? The editor indicates that a modification has occurred; it detects all the new nodes and finds no conflicts. However, visually, it doesn't seem to be working correctly! If I simply shift a node to force a deployment, everything synchronizes and operates optimally. What do you think about this issue?
I just tested integrating all the flows using a POST /flows request to force deployment via the API. I can see the process restarting, but there is no improvement regarding my issue.
Add some debug nodes to the flow you post, with their output set to System Console and Debug Window and see what it shows in the node red log when you post.
What I've noticed is that the nodes are in either an "added" or "modified" status.
For the nodes to be processed, I have to perform a manual rebuild by changing something so that the modifications are picked up without any issues.
Strange.
I recently experienced a similar situation when I tried to update the subflows (id: global). I made a mistake by having a duplicate subflow in my subflows array, which was accepted by the API, but resulted in a strange situation that was not easy to debug: I only saw the old subflow and the new subflow was completely hidden from the UI. Maybe something similar happened to you too? Your flow might contain duplicate nodes (same id). You should be able to find this out by inspecting the output from GET /flow/:id