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(util/semver): handle invalid versions in satisfiesWithPrereleases #6019

Merged
merged 1 commit into from
Jun 26, 2018
Merged

fix(util/semver): handle invalid versions in satisfiesWithPrereleases #6019

merged 1 commit into from
Jun 26, 2018

Conversation

greysteil
Copy link
Contributor

Summary

Fixes a bug where if invalid SemVer versions were present on a registry, Yarn wouldn't be able to update that dependency.

It's (very) rare for invalid SemVer versions to be present on npm registries, but it's possible, particularly for private registries which may or may not have checks present when versions are pushed.

Before this patch, the presence of any such versions would causes a resolution-ending TypeError: Invalid Version when determining which version to update that dependency to. After this patch, invalid versions on the registry will be quietly ignored.

Test plan

I've added a test which fails if the code change here isn't applied.

@greysteil greysteil changed the title Handle invalid versions in satisfiesWithPrereleases fix(util/semver): handle invalid versions in satisfiesWithPrereleases Jun 22, 2018
Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

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

Good for me 👍

@arcanis arcanis merged commit d492daa into yarnpkg:master Jun 26, 2018
@greysteil greysteil deleted the handle-invalid-versions branch June 26, 2018 17:08
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