-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[NewContactPage] fix: same number added twice #18536
[NewContactPage] fix: same number added twice #18536
Conversation
Signed-off-by: Prince Mendiratta <[email protected]>
@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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
cc @techievivek
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 🚀
@@ -79,7 +79,7 @@ function NewContactMethodPage(props) { | |||
const submitForm = useCallback(() => { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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