[NewContactPage] fix: same number added twice#18536
Conversation
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
|
@techievivek @s77rt One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
What are steps 10 and 11 for? |
|
@s77rt I've noticed that in the current staging, the behaviour can be different when the requests have been throttled, so might as well check for that case. As you would see in the linked issue, the bug was not reproduced when the requests were throttled so we should check for that case. |
|
I don't think this has any effects for the tests here. The bug was not reproducible because we saved the phone number on onyx without the domain and also checked for the existence without the domain. But this used to break when the API response arrives where the phone number is now stored with domain but checking for existence was still done without the domain. With this PR the phone number will always be stored with domain (and checked with domain). The additional steps are not really required. Step 5 (waiting for opacity with green dot) is enough. |
|
Sounds good, updated OP. |
Reviewer Checklist
Screenshots/VideosWebweb.mp4Mobile Web - Chromemweb-chrome.mp4Mobile Web - Safarimweb-safari.mp4Desktopdesktop.mp4iOSios.mp4Androidandroid.mp4 |
| const phoneLogin = LoginUtils.appendCountryCode(LoginUtils.getPhoneNumberWithoutSpecialChars(login)); | ||
| const parsedPhoneNumber = parsePhoneNumber(phoneLogin); | ||
| const userLogin = parsedPhoneNumber.possible ? parsedPhoneNumber.number.e164 : login; | ||
| const userLogin = parsedPhoneNumber.possible ? `${parsedPhoneNumber.number.e164}${CONST.SMS.DOMAIN}` : login; |
There was a problem hiding this comment.
NAB: Maybe a comment in these cases could be helpful otherwise one wouldn't understand the significance of appending the domain here.
There was a problem hiding this comment.
It seems we ended up fixing this twice at the same time. Either way, should leave both fixes? #18473 Even if they are redundant, it will make it more bullet proof? 😄
There was a problem hiding this comment.
Not exactly bullet proof 😅 I have commented on the linked PR #18473 (comment).
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/techievivek in version: 1.3.12-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
|
🚀 Deployed to staging by https://github.com/techievivek in version: 1.3.12-0 🚀
|
Details
With this PR, we are fixing the issue where the same contact number is accepted twice as a contact method on the NewContactMethod Page.
Fixed Issues
$ #18207
PROPOSAL: #18207 (comment)
Tests
Offline tests
N/A.
QA Steps
Same as above.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
web.mp4
Mobile Web - Chrome
android-mWeb.mp4
Mobile Web - Safari
iOS-mWeb.mp4
Desktop
desktop.mp4
iOS
iOS.mp4
Android
android.mp4