I had used a simple function to check if the value of the water tank had changed before sending a slack notification. was all working then one day started sending it every time like it was not saving the value.
I tried changing the variable name from ('Tank1') to (TankOne') deployed and all working again.
Any ideas why, I do get many messages is there a limit to how many times you can save a context variable?
var tank1=context.get('tankOne') ||0;
if (msg.payload != tank1){
context.set('tankOne',msg.payload);
return msg;
}else{
msg.payload="Same";
return msg
}
I did debugs and it had stoped sending "Same" and always sent on the msg.payload.
@zenofmud I think I had moved a flow from that worspace to another tab (sorry if that terminology is not correct) via cut and paste then deploy. These nodes that modes were not part of this flow but were on the same tab.
I may have also removed the degbugs.
It would be my guess that if everything was working and then you moved some flows and then it stopped working, something you moved was the root of your issue.
But since it is now working, I would not spend too much time on rying to figure out why if you can't recreate it.
I would agree except they were unlelated and I didn't undo any of it to fix it which makes me think there is some sort or NodeRed bug around context variables.
Its about stability, the result was many people being spamed in slack and I would like to make sure it doesn't happen again. I could clearly prove before changing the variable name that I did a save and 5 seconds later when retrieving it, it was back to default.
I will try changing it back to that old variable name.