# Delay nodes mis-configured after upgrade to 2.2.0

**URL:** <https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020>\
**Category:** General\
**Created:** [9 February 2022 09:53 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020 "2022-02-09T09:53:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2022 09:53 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/1 "2022-02-09T09:53:01Z")

</div>

After upgrading to 2.2.0 (from 2.1.x I think) then some my delay nodes show as mis-configured. I don't remember seeing that mentioned here already, apologies if I missed it. If I export and import it again the imported node also shows the problem, so hopefully it will also show the error for others.

```auto
[
    {
        "id": "90e9c97c.3d1ee",
        "type": "delay",
        "z": "e2d1e6af.819db8",
        "name": "",
        "pauseType": "delay",
        "timeout": "1",
        "timeoutUnits": "seconds",
        "rate": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "outputs": 1,
        "x": 146.5,
        "y": 216,
        "wires": [
            [
                "fa458ca8.723308"
            ]
        ]
    }
]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2022 10:09 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/2 "2022-02-09T10:09:06Z")

</div>

Further to this, editing the node and making a trivial change fixes it.  
It appears that it is the fact that the node is missing the property  
`"nbRateUnits": ""`  
that is the problem. Adding that in when importing fixes it.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [9 February 2022 10:59 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/3 "2022-02-09T10:59:24Z")

</div>

It is common for a version upgrade of a node to result in nodes being marked as needing attention. In this case, because the node is part of the core, the upgrade to node-red also updated the node.

Often, all that is needed is to open the config panel for each node, press done and then redeploy. But of course, you should always check what change is needed.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2022 11:19 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/4 "2022-02-09T11:19:48Z")

</div>

I believe the intention is that it should not be necessary to manually intervene following an upgrade. The node should be capable of understanding the previous config, certainly that is what I aim for in my nodes. The only time it should be necessary to manually intervene would be if the new version was not capable of behaving exactly as the original did. In this particular case I suspect it is just a matter of defaulting the property to an empty string.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 February 2022 11:30 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/5 "2022-02-09T11:30:40Z")

</div>

Indeed - a small regression introduced by [https://github.com/node-red/node-red/pull/3351/](https://github.com/node-red/node-red/pull/3351/) - please raise an Issue

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2022 11:59 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/6 "2022-02-09T11:59:11Z")

</div>

Issue raised - [https://github.com/node-red/node-red-nodes/issues/883](https://github.com/node-red/node-red-nodes/issues/883)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [9 February 2022 12:01 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/7 "2022-02-09T12:01:15Z")

</div>

As a core node, I've moved your issue over to the `node-red` repository - the link you've shared will redirect to the right place.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2022 12:10 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/8 "2022-02-09T12:10:12Z")

</div>

> [@knolleary](#):
>
> As a core node, I've moved your issue over to the `node-red` repository

Sorry, that is where I meant to post it, after looking through the node-red-nodes repo to check it is not there. So I did the work and then ignored the outcome apparently. ☹

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [9 February 2022 12:47 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/9 "2022-02-09T12:47:01Z")

</div>

> [@Colin](#):
>
> I believe the intention is that it should not be necessary to manually intervene following an upgrade

Well, that is a nice idea but not always feasible with major version changes 🙂

In fact, I'm not even sure it is possible? If you have to add a new (required) property to the node, surely all of the nodes will need to update and you will then have to redeploy. You can set a default but I think that you still have to open them, press "Done" and redeploy. Or am I missing something?

For uibuilder, we are now at a stage where we occasionally have to introduce some fairly major breaking changes that require an update. I've even added a version check (not easy since there is no inherent mechanism to do that with nodes) so that I can give users some additional information via a node-red notification message when major changes happen.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [10 February 2022 18:59 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/10 "2022-02-10T18:59:47Z")

</div>

> [@TotallyInformation](#):
>
> even added a version check

If you mean the version of your node (not node.js or NR), I have been using  
`RED.nodes.registry.getModule("node-red-contrib-my-node").version`.  
I think this was suggested by @knolleary in the Slack. I have not seen it documented anywhere, so I may be on thin ice.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 February 2022 20:45 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/11 "2022-02-10T20:45:17Z")

</div>

Interesting, I just read the node's package.json 🙂

The difficult part is for the Editor to know whether the node's version has _changed_. You need to save the nodes version when you deploy a node instance but you need to know the node's version every time you open the editor panel. Then you need to tell the editor whether a version change is significant. And you want to update the node version whenever you make another change to the instance settings but not otherwise or it gets annoying to users because the node gets marked as changed when the user hasn't changed it. A rather messy process all round.

But thanks for the reference. I clearly need to go and review the registry API and see if there is anything in there that could simplify any of my code. It is hard to keep it all straight!

* * *

PS: It looks like `getModuleInfo` returns the version and some other stuff and is probably the official way to do it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 April 2022 20:45 UTC](https://discourse.nodered.org/t/delay-nodes-mis-configured-after-upgrade-to-2-2-0/58020/12 "2022-04-11T20:45:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
