homebridge-config-ui-x icon indicating copy to clipboard operation
homebridge-config-ui-x copied to clipboard

Update how a plugin's author is determined to handle NPM schema change

Open PatrickStankard opened this issue 1 year ago • 2 comments

:recycle: Current situation

NPM stopped returning the maintainers key from the registry when viewing a versioned package. Is this intentional? Nobody knows. I have a support ticket open with NPM since last Thursday, and the thread on GitHub Communities hasn't seen a response. This change has prevented the Homebridge UI from showing a plugin's author, as well as showing users that there is a Homebridge UI update from within Homebridge.

:bulb: Proposed solution

Update how a plugin's author is determined: first, attempt to get it from the latest package from NPM (which is what is currently done). If it's not set there, get it from the top-level package metadata. Since getting it from the top-level package metadata can be expensive for packages with many versions, cache the author for 24 hours. This change will continue to work if NPM starts setting maintainers at the version level again, or if they never revert the change that stopped setting maintainers at the version level.

PatrickStankard avatar Jun 25 '24 19:06 PatrickStankard

was this an npm fixed bug in the end? do you think these changes are still relevant?

bwp91 avatar Aug 26 '24 21:08 bwp91

I never heard back from anybody at npm, I’m honestly not sure. I tried to reach out to them through several different channels, but no one ever responded with a definite answer. I do see this old version of my plugin still doesn’t have the maintainers set, though: https://registry.npmjs.org/homebridge-fujitsu-airstage/1.0.6

So… even if they did fix it, I’m not sure if they’d backfill the versions that were published before they fixed it.

PatrickStankard avatar Aug 27 '24 01:08 PatrickStankard

i am going to close this as it has been hanging around for a while, and i don't think this is needed after all. if you disagree, im happy to review again, please just let me know. but thanks for taking the time to work on this in the first place 👍

bwp91 avatar Jun 08 '25 01:06 bwp91