Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebridge UI plugin menu items for some plugins missing #2070

Closed
jsiegenthaler opened this issue Jun 22, 2024 · 46 comments
Closed

Homebridge UI plugin menu items for some plugins missing #2070

jsiegenthaler opened this issue Jun 22, 2024 · 46 comments
Labels

Comments

@jsiegenthaler
Copy link
Contributor

Describe The Bug

Some recently published plugins are missing the Manage Version and Report An Issue items in the plugin menu, and the author name is missing beside the @ symbol.
You can still click on the @ symbol to display the Donate to window, but the @ in front of the author name is missing.

Normal display of menu items and author name:
image

Plugin missing the menu items and author name:
image
This is particularly problematic as the user cannot change to another plugin version due to the missing Manage Version item

Normal display of Donate to:
image

Display of Donate to for a plugin where the author name is missing:
image

You can still click on the single @ character to open the Donate to window

Logs

No response

Config

No response

Homebridge UI Version

4.56.2

Homebridge Version

1.8.3

Node.js Version

20.14.0

Operating System

Raspberry Pi OS / Raspbian

Environment Info

Using hb-service

Raspberry Pi Model

Raspberry Pi 4 B

@grzegorz914
Copy link
Contributor

grzegorz914 commented Jun 22, 2024

Same for me, I think it is related to #2069

@jsiegenthaler
Copy link
Contributor Author

Additionally: newer published versions are now shown as being available, the user has no visibility of any updates.
WS has a new release but it does not appear as an available update:
https://github.com/ebaauw/homebridge-ws/releases/tag/v2.7.23

@jsiegenthaler
Copy link
Contributor Author

Same for me, I think it is related to #2069

Indeed, I observe the following for my affected plugin in my dev environment:
[22.06.2024, 07:37:48] [Homebridge UI] [homebridge-eosstb] Failed to check registry.npmjs.org for updates: "Cannot read properties of undefined (reading 'length')" - see https://homebridge.io/w/JJSz6 for help.

@mkz212
Copy link
Contributor

mkz212 commented Jun 22, 2024

@jsiegenthaler @grzegorz914 you need to add manualy in plugin package.json "maintainers": ["maintainer-name"] and release new version with latest tag. This is because NPM stop adding this automatically to release. Homebridge UI check author (maintainer) from latest release and now it is empty. New UI version fix this.

@dkerr64
Copy link

dkerr64 commented Jun 22, 2024

That NPM has stopped adding maintainers field feels like a bug in NPM and should be fixed there. The NPM Documentation does not document a "maintainers" field but explicitly states... "npm also sets a top-level "maintainers" field with your npm user info."

In addition, the npmjs.com package settings page lists maintainers and allows you to invite another person to be added as a maintainer... all done outside of the package.json source file.

If this is the documented behavior, then it's a bug in NPM that it has stopped adding this field.

@dkerr64
Copy link

dkerr64 commented Jun 22, 2024

And over here npm states themselves...

"The "maintainers" field in the top-level of the registry metadata (ie, not versioned) is the npm-controlled list of the npm usernames of the people with permission to write to that package. This can be modified via the npm owners command." (emphasis mine).

So I believe that it is not correct to recommend adding maintainers field to each package.json file.

@mkz212
Copy link
Contributor

mkz212 commented Jun 23, 2024

@dkerr64

  • NPM always add maintainers to package, now stopped.
  • Homebridge had a bug that checked maintainers.lenght before checking if it exists at all. It was fixes. Check that pkg.maintainers is defined before checking it's length #2069
  • Homebridge check maintainers from latest stable release of plugin, and first of maintainers you see on plugin card next to heart icon.
  • So if plugin doesnt have any new release since 2-3 days (since npm does not add maintainers), everything works.

To summarize:

  • NPM error is that it does not add maintainers (since couple days).
  • The Homebridge UI error was that it checked how many maintainers, without checking if they were at all exist. And this suspended all npm functions, also responsible for checking the version, etc. If it weren't for that, the NPM error would only cause that there would be no author on the plugin card (only a heart icon and a @ sign because it is hardcoded).

So adding maintainers to package.json is only workaround until Homebridge UI and NPM fix errors.

@dkerr64
Copy link

dkerr64 commented Jun 23, 2024

@mkz212 yes good summary... I was working on my plugin and noticed the problem, I tracked it down to checking the length statement then discovered that it had just been fixed, so all good from Homebridge side.

I do think that NPM need to fix their bug. Is there a bug report open?

@solomonj1963
Copy link

solomonj1963 commented Jun 23, 2024

I believe the issue I just experienced may be related to this. I set up the Homebridge Simplisafe3 by @nzapponi yesterday and tested arming and disarming my alarm through a HomeKit scene successfully. This morning I ran my scene that should have turned the alarm off, but found out it had not when the security company called because the alarm went off when it should have been turned off 4 hours ago by my HomeKit scene. Looking at the plugin log, all I see is this:

[6/22/2024, 12:44:14 AM] [Alarm] Initializing homebridge-simplisafe3.SimpliSafe 3 platform...
[6/22/2024, 12:44:16 AM] [Alarm] Sensor not (yet) supported: Back Yard
[6/22/2024, 12:44:16 AM] [Alarm] {
flags: { offline: false, lowBattery: false, swingerShutdown: false },
serial: 'f10f8614',
type: 17,
name: 'Back Yard',
setting: {},
status: {},
timestamp: 1693369208,
deviceGroupID: 0
}
[6/22/2024, 12:44:16 AM] [Alarm] Sensor not (yet) supported: Front Door
[6/22/2024, 12:44:16 AM] [Alarm] {
flags: { offline: false, lowBattery: false, swingerShutdown: false },
serial: 'f10f927c',
type: 17,
name: 'Front Door',
setting: {},
status: {},
timestamp: 1693369562,
deviceGroupID: 0
}
[6/22/2024, 12:44:16 AM] [Alarm] SimpliSafe real time events connected.
[6/22/2024, 12:45:34 AM] [Alarm] Initializing homebridge-simplisafe3.SimpliSafe 3 platform...
[6/22/2024, 12:45:35 AM] [Alarm] Sensor not (yet) supported: Back Yard
[6/22/2024, 12:45:35 AM] [Alarm] {
flags: { offline: false, lowBattery: false, swingerShutdown: false },
serial: 'f10f8614',
type: 17,
name: 'Back Yard',
setting: {},
status: {},
timestamp: 1693369208,
deviceGroupID: 0
}
[6/22/2024, 12:45:35 AM] [Alarm] Sensor not (yet) supported: Front Door
[6/22/2024, 12:45:35 AM] [Alarm] {
flags: { offline: false, lowBattery: false, swingerShutdown: false },
serial: 'f10f927c',
type: 17,
name: 'Front Door',
setting: {},
status: {},
timestamp: 1693369562,
deviceGroupID: 0
}
[6/22/2024, 12:45:35 AM] [Alarm] Detected unsupported camera Back Yard, some features will be disabled.
[6/22/2024, 12:45:35 AM] [Alarm] Detected unsupported camera Front Door, some features will be disabled.
[6/22/2024, 12:45:36 AM] [Alarm] SimpliSafe real time events connected.
[6/22/2024, 12:46:14 AM] [Alarm] Initializing homebridge-simplisafe3.SimpliSafe 3 platform...
[6/22/2024, 12:46:15 AM] [Alarm] Sensor not (yet) supported: Back Yard
[6/22/2024, 12:46:15 AM] [Alarm] {
flags: { offline: false, lowBattery: false, swingerShutdown: false },
serial: 'f10f8614',
type: 17,
name: 'Back Yard',
setting: {},
status: {},
timestamp: 1693369208,
deviceGroupID: 0
}
[6/22/2024, 12:46:15 AM] [Alarm] Sensor not (yet) supported: Front Door
[6/22/2024, 12:46:15 AM] [Alarm] {
flags: { offline: false, lowBattery: false, swingerShutdown: false },
serial: 'f10f927c',
type: 17,
name: 'Front Door',
setting: {},
status: {},
timestamp: 1693369562,
deviceGroupID: 0
}
[6/22/2024, 12:46:15 AM] [Alarm] SimpliSafe real time events connected.

However, the Homebridge log shows the following occurring afterwards.

[6/22/2024, 1:10:08 AM] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[6/22/2024, 2:42:42 AM] [Homebridge UI] Running scheduled instance backup...
[6/22/2024, 2:42:42 AM] [Homebridge UI] Creating temporary backup archive at /var/folders/zn/gzbnx7mj0c1_kmm0h0ngm9hm0000gn/T/homebridge-backup-EMm0dT/homebridge-backup-0ECEF6C38D83.tar.gz
[6/23/2024, 1:10:11 AM] [Homebridge UI] Running job to cleanup config.json backup files older than 60 days...
[6/23/2024, 2:42:42 AM] [Homebridge UI] Running scheduled instance backup...
[6/23/2024, 2:42:42 AM] [Homebridge UI] Creating temporary backup archive at /var/folders/zn/gzbnx7mj0c1_kmm0h0ngm9hm0000gn/T/homebridge-backup-etcwtG/homebridge-backup-0ECEF6C38D83.tar.gz
[6/23/2024, 2:42:42 AM] [Homebridge UI] [homebridge-config-ui-x] Failed to check registry.npmjs.org for updates: "Cannot read properties of undefined (reading 'length')" - see https://homebridge.io/w/JJSz6 for help.
[6/23/2024, 12:35:36 PM] [Homebridge UI] [homebridge-config-ui-x] Failed to check registry.npmjs.org for updates: "Cannot read properties of undefined (reading 'length')" - see https://homebridge.io/w/JJSz6 for help.
[6/23/2024, 12:35:36 PM] [Homebridge UI] [homebridge-config-ui-x] Failed to check registry.npmjs.org for updates: "Cannot read properties of undefined (reading 'length')" - see https://homebridge.io/w/JJSz6 for help.
[6/23/2024, 12:42:42 PM] [Homebridge UI] [homebridge-config-ui-x] Failed to check registry.npmjs.org for updates: "Cannot read properties of undefined (reading 'length')" - see https://homebridge.io/w/JJSz6 for help.

I have now tested arming and disarming using my HomeKit scene and it appears to be working now. I cannot find an explanation as to why the Good Morning scene that turns the alarm off did not run 4 hours ago as it should have. I would appreciate any insight.

@zivanek
Copy link

zivanek commented Jun 23, 2024

I have the same problem, all day

@mkz212
Copy link
Contributor

mkz212 commented Jun 23, 2024

@mkz212 yes good summary... I was working on my plugin and noticed the problem, I tracked it down to checking the length statement then discovered that it had just been fixed, so all good from Homebridge side.

I do think that NPM need to fix their bug. Is there a bug report open?

https://github.com/orgs/community/discussions/129220

@mkz212
Copy link
Contributor

mkz212 commented Jun 23, 2024

I have the same problem, all day

To fix error in plugin you need to add manualy in plugin package.json "maintainers": ["maintainer-name"] and release new version with latest tag. This is because NPM stop adding this automatically to release. Homebridge UI check author (maintainer) from latest release and now it is empty. New Homebridge UI version will fix this.

@mkz212
Copy link
Contributor

mkz212 commented Jun 23, 2024

@solomonj1963 Everyone now have error [homebridge-config-ui-x] Failed to check registry.npmjs.org for updates: "Cannot read properties of undefined (reading 'length')". This has nothing to do with controling the plugin. It is caused by a problem with NPM. And the fact that the new version of Homebridge UI does not have 'maintainers' in package.json.

@mkz212
Copy link
Contributor

mkz212 commented Jun 23, 2024

@donavanbecker @bwp91

  • We cannot update Homebridge UI.
  • You need to add manualy in package.json "maintainers": ["maintainer-name"] and release new version with latest tag.
  • Without this we have error: [Homebridge UI] [homebridge-config-ui-x] Failed to check registry.npmjs.org for updates: "Cannot read properties of undefined (reading 'length')" - see https://homebridge.io/w/JJSz6 for help.

@NorthernMan54
Copy link
Contributor

@mkz212 Can you elaborate on this comment - We cannot update Homebridge UI.

I just went and updated mine and had no issues.

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

@NorthernMan54

I have UI 4.56.2, so the last version before fix.

It shows me error in logs: [Homebridge UI] [homebridge-config-ui-x] Failed to check registry.npmjs.org for updates: "Cannot read properties of undefined (reading 'length')" - see https://homebridge.io/w/JJSz6 for help..

This is because latest release of Homebridge UI - 4.56.3 has no maintainers in package.json.

So it doesn't show me update option.

Version 4.56.2 check lenght of maintainers but not check first that maintainers exist. And in 4.56.3 maintainers not added to package.json so doesnt exist.

@donavanbecker
Copy link
Contributor

if you have UI 4.56.2 then you are not on the latest. v4.56.3 has the fix for this, this is resolved.

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

if you have UI 4.56.2 then you are not on the latest. v4.56.3 has the fix for this, this is resolved.

Yes. I know. But we cannot update to 4.56.3 because you release it with package.json without maintainers. So now every version before 4.56.3 check for the maintainers lenght from the latest release what produce error because there is NO maintainers in latest release!

Why closind Issue when users report that still have errors?

If before npm always automatically added maintainers to the package, and now it stopped and this causes a problem, why not just add maintainers yourself and publish? Is it a problem?

@NorthernMan54
Copy link
Contributor

@mkz212 I just went into the UI and selected 4.56.3

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

@donavanbecker @NorthernMan54

Oh, okay, I already know what it's about and why we don't understand each other. I mean that there is a error in the logs (and users dont know what is it) and that the update notification does not pop up. So users do not know there is fix.

Not everyone knows that you have to click on the Homebridge UI text on the widget to open the version selection window - It's not so obvious, because most people are used to the notification shows up!

@ImpulsePurchase
Copy link

That's right @mkz212. I'm a fairly experienced homebridge user I think, but I was surprised to see there was a later version under the install dialog, with 'Up to Date' as the status for Homebridge UI.

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

That's right @mkz212. I'm a fairly experienced homebridge user I think, but I was surprised to see there was a later version under the install dialog, with 'Up to Date' as the status for Homebridge UI.

That's what I mean! Everyone is so used to the fact that a notification about the update shows up that no one even knows that there is an option to install the selected version after you click on Homebridge UI text. BTW: such an option to instalk other version should also be in settings / UI settings.

@oogje
Copy link

oogje commented Jun 24, 2024

I'm sorry to be so dense but I cannot see any clickable Homebridge UI text. I have homebridge-config-ui-x v4.52.2 but neither the "Homebridge UI" text in the Plugins window nor the "homebridge-config-ui-x v4.52.2" text is clickable. And the only entry in Homebridge UI vertical ellipses menu is "API Documentation".

How do I install homebridge-config-ui-x v4.52.3.

Thanks.
Screenshot 2024-06-23 at 11 51 48 PM

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

@oogje

In Status tab (there where you have widgets and qr code).

IMG_6218

@ImpulsePurchase
Copy link

@oogje Good Question. It's from the Status Page in a box that looks like this
image

@oogje
Copy link

oogje commented Jun 24, 2024

Alas, my status page doesn't look like that - no Homebridge UI text. macOS 14.5, Safari 17.5.
Screenshot 2024-06-23 at 11 58 49 PM

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

For everyone with such problem - you can update by clicking on Homebridge UI text.

Alas, my status page doesn't look like that - no Homebridge UI text. macOS 14.5, Safari 17.5. Screenshot 2024-06-23 at 11 58 49 PM

Click on the icon on the bottom right (in circle) to manage view and add widget. You can also reset view to default.

BTW this is another reason to add version selection to the settings or UI settings!

@oogje
Copy link

oogje commented Jun 24, 2024

I'm sorry if I'm derailing this issue but I don't see a status widget other than the one in my previous screenshot. I don't have a child bridge.

Screenshot 2024-06-24 at 12 03 04 AM

After reset layout...
Screenshot 2024-06-24 at 12 06 42 AM

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

@oogje click reset layout (you already have this widget but i think it is cropped somehow)

@oogje
Copy link

oogje commented Jun 24, 2024

@mkz212 , I edited my last comment to show the reset layout.

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

@oogje hmm... this is strange. It should be there. So this is a bug.

You can also try run terminal (in Homebridge, not mac os terminal) and type: npm install -g homebridge-config-ui-x@4.56.3

@oogje
Copy link

oogje commented Jun 24, 2024

@mkz212 Will do. Thank you!

@zivanek
Copy link

zivanek commented Jun 24, 2024

Thank you guys I updated to version v4.56.3 manually because homebridge didnt't offer me an option to update automatically.
Screenshot 2024-06-24 at 09 05 42

@NorthernMan54
Copy link
Contributor

@mkz212 - In regards to the "maintainers" field with package.json, as it is documented as being supplied by npm, and not a user supplied field, lets wait and see what happens on the npm side over the next few days. I expect that is an issue with a recent release on their side, and would expect it to be resolved by them within a few days.

@dkerr64
Copy link

dkerr64 commented Jun 24, 2024

@oogje hmm... this is strange. It should be there. So this is a bug.

You can also try run terminal (in Homebridge, not mac os terminal) and type: npm install -g homebridge-config-ui-x@4.56.3

If you install homebridge as documented here, then npm is not available...

root@test:~# npm
Command 'npm' not found, but can be installed with:
apt install npm
root@test:~#

I do not know if it is safe to install npm as that looks to drag a whole nodejs environment, which may be different from that included with homebridge (it says 527 new packages will be installed !!!)

Bottom line, we shouldn't require command line to update this plugin.

@dkerr64
Copy link

dkerr64 commented Jun 24, 2024

@mkz212 - In regards to the "maintainers" field with package.json, as it is documented as being supplied by npm, and not a user supplied field, lets wait and see what happens on the npm side over the next few days. I expect that is an issue with a recent release on their side, and would expect it to be resolved by them within a few days.

I agree.

@PatrickStankard
Copy link
Contributor

I opened a support ticket with NPM on Thursday, along with this thread on GitHub Community (which is what they say to do when giving feedback, according to this). If anyone wants to chime in on that thread, or upvote it, or whatever, it might get them to investigate it sooner rather than later

@NorthernMan54
Copy link
Contributor

Upvoted

@solomonj1963
Copy link

solomonj1963 commented Jun 24, 2024

I'm glad this is figured out and my instance is fixed now. However, I would like to point out that, due to the notification "bug", there are probably still thousands of installations out there where the person is not even aware of it. I was not aware of it until my alarm monitoring company called me for tripping my alarm when it should have been turned off via HomeKit but wasn't. I'd like to point out that sometimes the impact of a bug can be larger than the developers realize, and I'm concerned that there needs to be a method developed to make sure existing users do get notified and apply the update. I don't believe saying this is completed is really true, as a manual fix has been identified and only known to people who find this discussion. With all due respect, I believe something creative should be implemented to assure every user is notified of the update that has been lurking in the shadows. I appreciate everything all you developers do for us, I truly do! But unless I'm missing something here, this missing notification remains a high impact bug and people are still not being notified.

@dkerr64
Copy link

dkerr64 commented Jun 24, 2024

I opened a support ticket with NPM on Thursday, along with this thread on GitHub Community (which is what they say to do when giving feedback, according to this). If anyone wants to chime in on that thread, or upvote it, or whatever, it might get them to investigate it sooner rather than later

There is zero discussion on that thread... which is rather discouraging after 4 days for something that will impact 1000's of packages.

@PatrickStankard
Copy link
Contributor

@solomonj1963 this bug is only related to the Homebridge UI asynchronously checking for updates on existing packages, it wouldn't have any impact on the functionality of the plugins themselves

@mkz212
Copy link
Contributor

mkz212 commented Jun 24, 2024

@solomonj1963 this bug is only related to the Homebridge UI asynchronously checking for updates on existing packages, it wouldn't have any impact on the functionality of the plugins themselves

If you have UI v.4.56.2 or below, for every plugin that doesn't have maintainers in package.json in latest release, you cannot update plugin and cannot access 'Instal other version' in plugin menu. So some impact is...

@PatrickStankard
Copy link
Contributor

That is true! I just wanted to clarify because I don't think this bug had anything to do with what was being described in this comment

@solomonj1963
Copy link

@solomonj1963 this bug is only related to the Homebridge UI asynchronously checking for updates on existing packages, it wouldn't have any impact on the functionality of the plugins themselves

Thank you for the response. I hope you are correct with that. In my case, all I can say is that I had a "Good Morning" scene which included setting my Simplisafe alarm system to off. The same scene triggers alot of other activity around my home that did occur. The only device used in that scene that is on my homebridge instance is the Simplisafe system. I had nothing showing in any of my logs that homebridge or my plugins saw that I had activated that scene. Other devices on my home-assistant platform did see it and acted as expected. So, I'm not complaining, but I feel like this was a big gap in my instance and it is within reason it could be for others. I'm only recommending a little more thought be invested on this potential impact.

@dkerr64
Copy link

dkerr64 commented Jun 24, 2024

@solomonj1963 this bug is only related to the Homebridge UI asynchronously checking for updates on existing packages, it wouldn't have any impact on the functionality of the plugins themselves

If you have UI v.4.56.2 or below, for every plugin that doesn't have maintainers in package.json in latest release, you cannot update plugin and cannot access 'Instal other version' in plugin menu. So some impact is...

The problem is even worse, because the UI 4.56.2 and below are not detecting that there is a new UI release. To test, I just installed hombridge following instructions here. And it installed UI v4.56.2 and reports that it is up-to-date...

image

image

So your average user has no idea that the Homebridge UI is out-of-date, AND will not get any prompting for ANY other plugin that has had an update published.... unless the plugin owner adds the maintainers list to their package.json.

And... this UI needs to add it to its own package.json, which will hopefully then cause homebridge to highlight that a new UI is available.

@dkerr64
Copy link

dkerr64 commented Jun 24, 2024

Opened #2076 as this one is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests