…. Happens on an initial attempt to write the state file and no state has yet been established.
Just found this issue when applying 1.6.0 to a new project. The original code to see if ts was in the history fails because no history is yet defined. I rewrote it to make sure all parents of ts were defined before attempting to use its value.
This is related to the recent improvement you made to allow file writing frequency to be controllable.
Typical error statements on NR startup:
9 Jan 15:41:08 - [error] [shared-state:Water] Error writing state file: /home/pi/.node-red/shared-state/Water
9 Jan 15:41:08 - [error] [shared-state:Water] TypeError: Cannot read property 'ts' of undefined
…. Happens on an initial attempt to write the state file and no state has yet been established. Just found this issue when applying 1.6.0 to a new project. The original code to see if
ts
was in the history fails because no history is yet defined. I rewrote it to make sure all parents ofts
were defined before attempting to use its value. This is related to the recent improvement you made to allow file writing frequency to be controllable. Typical error statements on NR startup: