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

fix: update notifier to consider engine range #8050

Draft
wants to merge 1 commit into
base: latest
Choose a base branch
from

Conversation

milaninfy
Copy link
Contributor

@milaninfy milaninfy commented Jan 21, 2025

When doing manifest call for fetching npm manifest it was using latest every-time, however fetchingnpm@* will still give latest if it's satisfies the engine range otherwise it will give highest matching version for the current engine range.
Pacote.manifest calls internally uses pick-manifest logic to pick the appropriate version of the manifest for the engine range.

@milaninfy milaninfy marked this pull request as ready for review January 22, 2025 04:27
@milaninfy milaninfy requested a review from a team as a code owner January 22, 2025 04:27
@@ -83,7 +83,7 @@ const updateNotifier = async (npm, spec = 'latest') => {
}

// while on a beta train, get updates daily
const duration = spec !== 'latest' ? DAILY : WEEKLY
const duration = current.prerelease.length ? DAILY : WEEKLY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't have been changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong here, but my understanding was since we are using * as spec in new change it will always be !== 'latest' in that case, and what i understood from the existing logic is we are calculating duration as DAILY for pre release version so simplified it to that.

Copy link
Member

@wraithgar wraithgar Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! I got this patch backwards. You added the prerelease check. This was the right decision.

@wraithgar
Copy link
Member

We'll want a new test for the behavior this is guarding against.

@milaninfy milaninfy marked this pull request as draft January 22, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants