You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Release/2.5.4: fix common-phone-number storing the wrong number when +1 is typed - #20
common-phone-number already shows a +1 prefix, but its mask accepted any digit first. Typing +1 (234) 567-8978 stored 1234567897: the typed 1 became the area code and the last digit was dropped. The validator only counted digits, so the control stayed valid. In MSP DEAM the submission then failed with should match pattern "^[2-9]([0-9]{9})$". The mask has behaved this way since 1.0.0.
Fix
Default mask is now (N00) 000-0000, where N accepts 2-9 only, so a typed leading 1 or 0 is ignored. The stock ngx-mask tokens are kept, so a custom [mask] without N behaves as before.
The validator also requires PhoneNumberRegEx (10 digits, first digit 2-9), so programmatic values are checked too.
Breaking (released as a patch, following 2.5.2)
A value starting with 0 or 1 is now invalid, and with the default mask it loses its first digit when written to the control. No North American area code starts with 0 or 1.
N is now a mask token. No enrolment repo passes a custom [mask].
Publish breaking mask changes under a major version
projects/common-lib/package.json:3
This release is explicitly documented as breaking: existing custom masks containing literal N change meaning, and loading some existing values can rewrite the model. Publishing it as 2.5.4 allows consumers using a normal ^2.5.x range to receive those changes automatically, which is incompatible with patch-version expectations. Use a major version for this public API behavior change, or preserve the prior behavior for 2.x consumers.
Release validation-breaking changes as the next major version
projects/common-lib/package.json:3
Publishing this as 2.5.4 conflicts with the repository's established compatibility policy: CHANGELOG.md:880-891 used a major release specifically because validation fixes can make previously accepted forms invalid without a compile-time warning. This PR documents the same break and can also rewrite loaded values, so consumers using ^2.5.3 could receive it automatically as a patch. Please release it as the next major version and synchronize the root manifest, lockfile, and changelog.
Previously missed (1)
In code that hasn't changed since last review
Release validation-breaking changes as the next major version projects/common-lib/package.json:3
Publishing this as 2.5.4 conflicts with the repository's established compatibility policy: CHANGELOG.md:880-891 used a major release specifically because validation fixes can make previously accepted forms invalid without a compile-time warning. This PR documents the same break and can also rewrite loaded values, so consumers using ^2.5.3 could receive it automatically as a patch. Please release it as the next major version and synchronize the root manifest, lockfile, and changelog.
🧠 Review effort: Balanced
Keeping 2.5.4 as a patch, following the 2.5.2 precedent (common-phone-number began rejecting partial numbers in a patch). The consumers build with npm ci from lockfiles, so none pick this up without an explicit update. BCP, the other consumer of this component, was verified against the packed tarball (unit tests, build, Cypress happy paths) and loads no saved phone data. The Breaking section documents the change for anyone who upgrades.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
common-phone-numberalready shows a+1prefix, but its mask accepted any digit first. Typing+1 (234) 567-8978stored1234567897: the typed 1 became the area code and the last digit was dropped. The validator only counted digits, so the control stayed valid. In MSP DEAM the submission then failed withshould match pattern "^[2-9]([0-9]{9})$". The mask has behaved this way since 1.0.0.Fix
(N00) 000-0000, whereNaccepts 2-9 only, so a typed leading 1 or 0 is ignored. The stock ngx-mask tokens are kept, so a custom[mask]withoutNbehaves as before.PhoneNumberRegEx(10 digits, first digit 2-9), so programmatic values are checked too.Breaking (released as a patch, following 2.5.2)
Nis now a mask token. No enrolment repo passes a custom[mask].