[PER-10742] Show warning for non US/Canada phone numbers - #1182
Open
aasandei-vsp wants to merge 4 commits into
Open
aasandei-vsp wants to merge 4 commits into
aasandei-vsp wants to merge 4 commits into
Conversation
The SMS provider we are using for verifying phone numbers only validates US and Canada, so this utility will check to see what area this number is from. Issue: PER-10742
…alue Up until now we didn't have a way to check the value in the inline edit component while is being typed, so adding a new emitter will enable us to validate before actually saving. Issue: PER-10472
Show a warning message if the phone number that is being typed or even if it's already stored to let the user know the we cannot verify it. Issue: PER-10742
When the user gets to the phone number verification page and introduces a code, up until now there was no error shown in case the code was wrong. Issue: PER-10742
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1182 +/- ##
==========================================
+ Coverage 53.68% 53.89% +0.20%
==========================================
Files 368 369 +1
Lines 12925 12983 +58
Branches 2363 2378 +15
==========================================
+ Hits 6939 6997 +58
+ Misses 5752 5749 -3
- Partials 234 237 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Manual test cases — warning on a phone number we cannot text
Setup: Log in and open Account Settings → Email and Phone. You need: one account with no mobile phone saved, one whose phone shows
Verified, one with+44 20 7946 0958already stored and unverified, and one with876 555 0123(a Jamaican number) already stored and unverified. No feature flag gates this work.The Mobile Phone row now carries a permanent line of helptext above it, a warning appears under the field while you type a number Permanent cannot text, and the same warning sits beneath the Verification Status row for a stored number that cannot be reached.
Account Settings — a stored number, with no editing ⭐
(This is the case that did not exist before at all — the warning has to appear from what the server returned, without anybody touching the field.)
Scenario — an unreachable stored number warns on load
+44 20 7946 0958, and do not click anything.Permanent can only send verification codes to US and Canada numbers.is shown beneath the Verification Status row, andPermanent only supports US and Canada numbers.beneath the Mobile Phone field.Scenario — a Jamaican number warns too
876 555 0123.Scenario — a verified number is never warned about
Verified, look at both Mobile Phone rows.Verifiedis shown and no warning appears, even if the stored number is not a plain ten-digit US number.Account Settings — typing a number ⭐
Scenario — a US number never warns
(202) 555-0147, one character at a time.Account information saved., the value reads(202) 555-0147, and no warning is shown anywhere in the group.Scenario — a US number typed with the country code
+1 (202) 555-0147one character at a time.Scenario — a Canadian number and a Puerto Rican number
416 555 0147, then787 555 0147.Scenario — an international number warns partway through
+44 20 7946.+44 20 7946 0958.Permanent can only send verification codes to US and Canada numbers.appears beneath the field.Account information saved.— and the number is stored. This is deliberate: the warning advises, it does not refuse.Scenario — clearing the number
Mobile Phone Numberplaceholder, and no warning anywhere — only the helptext remains.Scenario — cancelling an edit
Verify Phone screen ⭐
(The first scenario is the one that was completely silent before — the send failed into nothing and no message of any kind was produced.)
Scenario — the limitation is named when a code cannot be sent
Permanent can only send verification codes to US and Canada numbers.error.auth.lookup.Scenario — offline and back
Scenario — the email flow is unchanged
Regression — the other inline editors
Cheap sanity checks. The shared inline editor changed, so these are worth one click each.
Scenario — other text fields still save