hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
527 stars 122 forks source link

# ℹ️ The WebSocket node should not be manually managed, it is bundled in the add-on. #1884

Closed jaytea33 closed 4 months ago

jaytea33 commented 4 months ago
          # ℹ️ The WebSocket node should not be manually managed, it is bundled in the add-on.

Making manual changes to that, will cause issues in the long run. The add-on will therefore revert those manual changes each start.

I've shipped v17.0.0 just now with everything latest.

../Frenck

Originally posted by @frenck in https://github.com/hassio-addons/addon-node-red/issues/1781#issuecomment-1880035598

Hello,

Just wanted to report that despite this being in the release notes:

"Update node-red-contrib-home-assistant-websocket to v0.64.0 @renovate"

The ha websocket was NOT upgraded to v0.64.0 following upgrading to 17.0.12, nor did node-red revert my changes when I just updated to v0.64.0 manually in the pallette, rebooted the ha host, and confirmed it still functions correctly on v0.64.0.

I understand the philosophy behind prioritizing stability over bleeding edge, but if the new version is mentioned explicitly in the changelog and updated the underlying add-on dependency, I'd think that the node would have been auto upgraded to match it, right?

If this is expected behavior or I'm the anomaly, this issue can be closed, but I wanted to bring it to the surface now just in case.

Edit: I just noticed there are 2 different versions listed in the 17.0.12 changelog, perhaps that's why there's unexpected behavior?

"Update node-red-contrib-home-assistant-websocket to v0.63.2 @renovate"

Mine did update to v0.63.2 but not v0.64.0, I had to do it manually and was NOT rolled back/reverted as would be the expected behavior for a manual ha web socket upgrade

sinclairpaul commented 4 months ago

If you manually update it via the palette, it will not be updated, this is due to how NPM works. This was commented in the same linked issue https://github.com/hassio-addons/addon-node-red/issues/1781#issuecomment-1883169611

If you want an easy life either use the addon config to apply updates, or wait for the versions to upgrade.

jaytea33 commented 4 months ago

I want to be clear here that I have been getting auto upgrades all this year just fine with no manual tweaking that would break it - the last several versions have all gone through as expected until this latest version, where I ONLY intervened because of the release note version discrepancy

Again, you have TWO web socket versions listed in the latest changelog and I haven't seen this any other time - the lower version succeeded, the higher did not. Previous upgrades this year all worked for me, and your rollback behavior didn't occur when it should've. At the very least, some documentation clarity is necessary.

Edit: I am open to the possibility that I could've inadvertently hit Update on web socket when managing other nodes, causing it to not auto update on upgrade and not roll back because the version was technically correct. That would explain things but unfortunately my log retention doesn't go back far enough to find out.

If I did accidentally upgrade though and this issue is limited to just me, I think at least a warning in the logs that the add-on is no longer managing web socket due to manual outside actions taken, is 💯 needed, seeing as how it's rather easy to break the websocket management by accident with the standard managed config. It would help eliminate issues like this from being opened down the road, but in all likelihood I probably did accidentally update web socket by accident so I'll own that, and apologize for wasting your time. I am very grateful for the work that you do.

sinclairpaul commented 4 months ago

Not really sure what the need for the "you" and "your" is all about, simply put as per the previous comment, let the addon manage the npm package.

Although it sounds simple, it isn't easy to manage different package versions from different sources.

jaytea33 commented 4 months ago

It wasn't personal, I simply meant "there exists 2"

I was letting the add-on manage the package, just not in the add-on config. If it's better to manage npm add-on config, then that should either be the default or referenced somewhere, else you'll just have issues like this keep opening up