-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
🐛 Regression: isUUID default behavior change in minor version (v13.15.0)
Type: Breaking Change / Regression in MINOR Version
Hey hey 👋 !
I thought to add this ticket here in case someone else lands into this situation and it might help them.
We encountered a problem in our project after upgrading from 13.7.0 to 13.15.15. We started noticing that isUUID was returning false where previously it was returning true for certain identifiers.
We identified the root cause and it is from this Pull Request change: https://github.com/validatorjs/validator.js/pull/2421/files#diff-57e827a6b8de283f7e507720fa088f49752e19655e6e4d9fa5b3970a9a2c3416R23-R25
It seems now that version "all" (which is set by default) is significantly more restrictive/strict than before, failing UUIDs that were previously accepted. Also, later the option "loose" was added to cover the less restrictive check.
We think that "loose" should have been the default to preserve backwards compatibility, or the change should have been introduced in a MAJOR release.
This change was introduced in version 13.15.0 and constitutes a breaking change by altering the default functionality.
A quick sample of code:
const validator = require('validator');
const uuidWorkingBefore = "DBA76DCA-B405-6522-D248-C0185004D95A";
// The '6' in the third group (version field) makes this UUID invalid by RFC 4122 standard (valid versions are 1-5).
console.log(validator.isUUID(uuidWorkingBefore));
// output -> "true" in `13.7.0` but "false" in `13.15.15`❓ Project Policy Question (Semantic Versioning)
In this project's vision, and to help users handle updates in the future, we need clarity on the versioning strategy: are MINOR version increases (like 13.x.x to 13.y.x) potentially adding breaking changes, or are they intended to be strictly backwards compatible (following Semantic Versioning rules for MINOR versions)?
Small request 🙏 - if there would be breaking changes, could they be mentioned clearly in the release notes?
Thank you all for your work!! ❤️