-
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
[HOLD for payment 2021-10-14] [HOLD for payment 2021-10-14] Prevent inaccurate information by enforcing a character limit during the VBA flow #5184
Comments
Triaged & auto-assigned via the |
Adding |
Triggered auto assignment to @puneetlath ( |
I created workspace, added private domain email as secondary login and verified. Although I am not able to see add bank account related flow. Any suggestion how to activate VBA flow to reproduce this issue as a contributor. Also in my account only paypal.me shows as payment method, there is no Add Bank Account etc. |
Hmm @PrashantMangukiya that is indeed odd. Let me chat to our Engineers to double-check and see if this is truly an issue that's Contributor-suitable! |
@SofiedeVreese Thank you for updates. This issue not set as external so consider as my suggestion (not proposal). At present I can not reproduce VBA flow, so suggesting generic sample code to format phone number as user is typing. During form submit we have to remove also remove () and - from phone number, because within db we may not store such formatting chars. Also sample code given to limit Tax ID to 9 char, and SSN to 4 chars. onChangeTaxID(taxId) {
const taxIdFinal = !taxId ? taxId : taxId.trim().slice(0, 9);
this.setState({
taxId: taxIdFinal,
});
}
onChangeSSN(ssn) {
const ssnFinal = !ssn ? ssn : ssn.trim().slice(0, 4);
this.setState({
ssn: ssnFinal,
});
}
onChangePhoneNumber(phone) {
this.setState({
phone: this.formatPhoneNumber(phone),
});
}
formatPhoneNumber(phone) {
if (!phone) { return phone; }
const phoneNumber = phone.replace(/[^\d]/g, ''); // Cleanup non digit value
if (phoneNumber.length < 4) { return phoneNumber; }
if (phoneNumber.length < 7) {
return `(${phoneNumber.slice(0, 3)}) ${phoneNumber.slice(3)}`;
}
return `(${phoneNumber.slice(0, 3)}) ${phoneNumber.slice(3, 6)}-${phoneNumber.slice(6, 10)}`;
}
<ExpensiTextInput
label={this.props.translate('common.phoneNumber')}
value={this.state.phone}
onChangeText={this.onChangePhoneNumber}
keyboardType={CONST.KEYBOARD_TYPE.PHONE_PAD}
returnKeyType="done"
/> If this issue labeled as external then consider as proposal. I already submitted proposal on Upwork, you can accept it if my solution suitable for this issue. Thank you. |
Proposal My suggestion would be to resolve just the length and type checks in this issue. Auto-formatting is at the moment not supported. We should be adding masked input support rather than programmatically adding phone number formatting. For example, http://insin.github.io/react-maskedinput/ . I am suggesting without adding auto-formatting to the phone number, we should add In
and in
|
Hey @PrashantMangukiya I checked with our engineers and this flow is not hidden, it's sitting on a beta active on dev. They suggested trying with a fresh private domain account vs secondary login. |
@SofiedeVreese I got it, thanks for the updates. |
Hm, I agree with @akshayasalvi that we should just validate the length/format and not worry about auto-formatting the input. My suggestion would be to simply:
What do you think @SofiedeVreese ? |
I like that @puneetlath it seems the simplest and cleanest way of tackling this issue. |
@akshayasalvi do you agree with Puneet's feedback above? @puneetlath if so, would you like to proceed with @akshayasalvi ? |
Yeah, @SofiedeVreese I agree with @puneetlath's feedback. |
@akshayasalvi I don't know that simply using |
I agree. But I also a little unsure if we're allowing parenthesis and dashes. Placement for this might differ based on the locale. I could quickly write a regex to match this, once you confirm the format. I've also checked some of the codes, it seems we're using |
So perhaps one solution would be to:
|
Sure that could work. |
Ok great. And can you share your proposal at a high level for how you would handle each of the requirements? |
In extension to what I've mentioned in this comment #5184 (comment)
Here's what I'll add.
cc - @puneetlath |
Sounds good. @SofiedeVreese can you go ahead and hire @akshayasalvi in Upwork please? |
Hey @akshayasalvi looks like I haven't received a proposal from you in Upwork yet. Would you be able to submit your proposal there too so I can hire you via Upwork? Thanks! 🙌 |
@SofiedeVreese Done. |
Thank you @akshayasalvi I've just hired you through Upwork! |
PR close to being merged. |
PR merged, now waiting for deploy. |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.6-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2021-10-14. 🎊 |
Issue paid out! As it was sitting on a Newsletter milestone, I've paid out $375. |
Expected Result:
When you're adding your phone number, tax ID and last 4 of SSN in the add VBA flow, we should enforce a character limit and format at you type.
Actual Result:
We do none of that.

Solution:
Enforce a character limit on these fields such that:
*The phone number limit is 10, excluding the
(
and)
which surround the beginning 3 digits. We should auto-format this as you type. Such that typing5551234567
auto formats to(555) 123-4567
Future Notes:
12-3456789
but not all Tax ID's are EIN's (some self employed people just use SSNs) and we'd also need to not include the dash when we send it to our validation APIs.Coming from Expensify/Expensify #176806
The text was updated successfully, but these errors were encountered: