victronenergy / node-red-contrib-victron

MIT License
96 stars 19 forks source link

[BUG] Only changes migration #163

Closed mr-manuel closed 1 year ago

mr-manuel commented 1 year ago

Describe the bug When migrating from an older version to a newer version the "only changes" flag is automatically set, when opening a node.

To Reproduce Steps to reproduce the behavior:

  1. Use an older version like 1.4.26
  2. Insert any output node
  3. Upgrade to the latest version
  4. Open the node and watch that the flag on "Only changes" is set

Expected behavior When opening a node from pre migration that had not this checkbox, than the checkbox should not be automatically selected. When someone opens a node and do not recognise the change, problems will arise and troubleshooting will be hard. Since after migration the nodes behave like before, also the checkbox should not be set, if the value onlyChanges is missing in the config.

Flow Before opening

[
    {
        "id": "5b0ee8e88d74299f",
        "type": "victron-input-battery",
        "z": "202a089e4ad5eef4",
        "service": "com.victronenergy.battery/1",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery/1",
            "name": "SerialBattery(Jkbms)"
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "initial": "",
        "name": "",
        "x": 180,
        "y": 1740,
        "wires": [
            [
                "8db09b7cd94c927e"
            ]
        ]
    }
]

When opening checkbox is preselected

grafik

After closing even the user changed nothing

[
    {
        "id": "5b0ee8e88d74299f",
        "type": "victron-input-battery",
        "z": "202a089e4ad5eef4",
        "service": "com.victronenergy.battery/1",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery/1",
            "name": "SerialBattery(Jkbms)"
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "initial": "",
        "name": "",
        "onlyChanges": true,   // <----- was added
        "x": 180,
        "y": 1740,
        "wires": [
            [
                "8db09b7cd94c927e"
            ]
        ]
    }
]
dirkjanfaber commented 1 year ago

That is a good find. I'll postpone the update to 1.4.29 in Venus until this gets fixed.

dirkjanfaber commented 1 year ago

Merged with master