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

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

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

PatrickStankard
Copy link
Contributor

♻️ 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.

💡 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.

@bwp91
Copy link
Contributor

bwp91 commented Aug 26, 2024

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

@PatrickStankard
Copy link
Contributor Author

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.

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

Successfully merging this pull request may close these issues.

3 participants