If an exception is launched the values of ValueInput are losts.
For reproduce the bug I add a variable “duration” of type ValueInput in class ANDMERGE, initialized this value from inspector the graph and launch a generic exception. After I remove the exception, the value in variable “duration” is lost. What I expect the value is persisted.
I have prepared a video that reproduces the problem:
I tested this bug in 2.9.0 and 2.9.2 (I had read that a similar bug was there in the 2.9.1)
Just to explain what is going on, if you open up FlowNode.cs and take a look at the “GatherPorts” method, you will see that “RegisterPorts” is called within, and right after that, the “DeserializeInputPortValues” is called. If of course an exception is thrown within the RegisterPorts implementation, the “DeserializeInputPortValues” is never called and thus the port values (of this particular node) are lost since the graph is then serialized back.
There is an exception handling per node registration (so that if one node throws an exception the rest proceed normally), but to avoid what is happening in a per-node basis when an exception is thrown, there will need to exist yet another exception handling. Changing the “GatherPorts” method to be like the following will effectively work the way you suggest (make port serialization perist):