Skip to content
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 2023-10-23] [HOLD for payment 2023-10-23] [$1000] Bank account - Phone number field is not trimmed for spaces in connect bank account #25996

Closed
2 of 6 tasks
lanitochka17 opened this issue Aug 26, 2023 · 48 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 26, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Open settings->workspaces->any workspace->bank account->connect manually
  3. Fill in fields in step 1 and continue
  4. Fill in fields in step 2, before legal name, phone number, tax ID add some spaces and continue
  5. Go back to step 2 and observe that app trim spaces before value for legal name, tax ID but doesn't trim space for phone number

Expected Result:

App should trim spaces before phone number value as it does for tax ID or legal name

Actual Result:

App should trim spaces before phone number value as it does for tax ID or legal name

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • Windows / Chrome
  • MacOS / Desktop

Version Number: 1.3.57-5

Reproducible in staging?: Yes

Reproducible in production?: Yes

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

trim.spaces.in.phone.number.field.as.it.does.for.tax.ID.mp4
Recording.2989.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692249462405549

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017eadfab4995c4b33
  • Upwork Job ID: 1696513864176926720
  • Last Price Increase: 2023-09-19
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 26, 2023

Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Aug 26, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@hungvu193
Copy link
Contributor

hungvu193 commented Aug 26, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Bank account - Phone number field is not trimmed for spaces in connect bank account

What is the root cause of that problem?

We're not trimming the space here:

companyPhone: parsePhoneNumber(values.companyPhone, {regionCode: CONST.COUNTRY.US}).number.significant,

What changes do you think we should make in order to solve the problem?

We should trim the space before submitting

companyPhone: parsePhoneNumber(values.companyPhone.trim(), {regionCode: CONST.COUNTRY.US}).number.significant, 

What alternative solutions did you explore? (Optional)

N/A

@neonbhai
Copy link
Contributor

neonbhai commented Aug 26, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Bank account - Phone number field is not trimmed for spaces in connect bank account

What is the root cause of that problem?

This happens because we are not sanitizing the phone number input here;

What changes do you think we should make in order to solve the problem?

We should be using the replace function and sanitizing using the NON_NUMERIC regex const:

companyPhone: parsePhoneNumber(values.companyPhone.replace(CONST.REGEX.NON_NUMERIC, ''), {regionCode: CONST.COUNTRY.US}).number.significant,

This is better than just trimming with trim() as we are remove all Non Numeric characters. Note: this is also the approach taken when sanitizing taxID here.

What alternative solutions did you explore? (Optional)

xx

@dukenv0307
Copy link
Contributor

dukenv0307 commented Aug 27, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Phone number field is not trimmed for spaces in connect bank account

What is the root cause of that problem?

When we save the value of company, it's trimmed before saving. We use shouldUseDefaultValue prop for companyTaxID and companyName so after saving and going back companyTaxID and companyName are trimmed

shouldUseDefaultValue={shouldDisableCompanyName}

shouldUseDefaultValue={shouldDisableCompanyTaxID}

companyPhone field doesn't use this prop so it's not trimmed after going back

What changes do you think we should make in order to solve the problem?

We can pass shouldUseDefaultValue into TextInput of companyPhone by the same way we use for companyTaxID

const shouldDisableCompanyPhone = Boolean(bankAccountID && this.props.getDefaultStateForField('companyPhone'))
<TextInput
    inputID="companyPhone"
    label={this.props.translate('common.phoneNumber')}
    accessibilityLabel={this.props.translate('common.phoneNumber')}
    accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
    containerStyles={[styles.mt4]}
    keyboardType={CONST.KEYBOARD_TYPE.PHONE_PAD}
    placeholder={this.props.translate('common.phoneNumberPlaceholder')}
    defaultValue={this.props.getDefaultStateForField('companyPhone')}
    shouldSaveDraft
    disabled={shouldDisableCompanyPhone}
    shouldUseDefaultValue={shouldDisableCompanyPhone}
/>

defaultValue={this.props.getDefaultStateForField('companyPhone')}

What alternative solutions did you explore? (Optional)

We can use a state in CompanyStep for phone number text input

const defaultPhoneValue = getDefaultStateForField('companyPhone');
const [companyPhone, setCompanyPhone] = useState(defaultPhoneValue);

<TextInput
    inputID="companyPhone"
    label={translate('common.phoneNumber')}
    accessibilityLabel={translate('common.phoneNumber')}
    accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
    containerStyles={[styles.mt4]}
    keyboardType={CONST.KEYBOARD_TYPE.PHONE_PAD}
    placeholder={translate('common.phoneNumberPlaceholder')}
    value={companyPhone}
    onValueChange={(value) => setCompanyPhone(value)}
    shouldSaveDraft
/>

We can do the same way this these other fields that are editable.

Result

Screencast.from.11-09-2023.17.18.11.webm

@dhanashree-sawant
Copy link

I think issue reporter was mistakenly marked to @dhanashree instead of @dhanashree-sawant, can we correct that if possible? It will help me to recieve emails about it

@garrettmknight
Copy link
Contributor

@dhanashree-sawant updated the OP. Checking whether this is an issue for us on the backend or not before opening up.

@garrettmknight
Copy link
Contributor

garrettmknight commented Aug 29, 2023

It looks like we're parsing the phone number into the correct format in the App here and then sending it to the API. So the API is currently receiving and storing phone numbers in the backend without any leading spaces but I think the display of the phone number in the App isn't being updated.

Confirmed that the expected behavior is that we'd update the app to clear leading spaces since we're cleaning that up on the backend.

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Aug 29, 2023
@melvin-bot melvin-bot bot changed the title Bank account - Phone number field is not trimmed for spaces in connect bank account [$1000] Bank account - Phone number field is not trimmed for spaces in connect bank account Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

Job added to Upwork: https://www.upwork.com/jobs/~017eadfab4995c4b33

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

Current assignee @garrettmknight is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (External)

@melvin-bot melvin-bot bot added the Overdue label Sep 1, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Sep 1, 2023

Thanks for the proposals everyone.

It does seem like Awesomephonenumber removes the spaces when using parsePhoneNumber already and there are no spaces included in the Onyx data.

@dukenv0307 Your proposal seems promising but it's making the phone number field uneditable for me when we return to it.

@melvin-bot melvin-bot bot removed the Overdue label Sep 1, 2023
@dukenv0307
Copy link
Contributor

@Ollyws For taxID we also use this way and make this field uneditable so I think if we decided to display phoneNumber value with trimming, it will be fine.

@melvin-bot melvin-bot bot added the Overdue label Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

@garrettmknight, @Ollyws Whoops! This issue is 2 days overdue. Let's get this updated quick!

@Ollyws
Copy link
Contributor

Ollyws commented Sep 5, 2023

Asked for more clarification around which fields should be disabled in the slack thread.

@melvin-bot melvin-bot bot removed the Overdue label Sep 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@garrettmknight, @Ollyws Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@garrettmknight, @Ollyws Eep! 4 days overdue now. Issues have feelings too...

@garrettmknight garrettmknight added Weekly KSv2 and removed Daily KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 16, 2023
@garrettmknight
Copy link
Contributor

PR is on Staging - will update to the awaiting payment hold when it goes to prod if Melv misses it.

@garrettmknight garrettmknight added Daily KSv2 and removed Weekly KSv2 labels Oct 16, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Oct 16, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Bank account - Phone number field is not trimmed for spaces in connect bank account [HOLD for payment 2023-10-23] [$1000] Bank account - Phone number field is not trimmed for spaces in connect bank account Oct 16, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 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 2023-10-23. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@Ollyws] The PR that introduced the bug has been identified. Link to the PR:
  • [@Ollyws] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@Ollyws] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@Ollyws] Determine if we should create a regression test for this bug.
  • [@Ollyws] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@garrettmknight] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Oct 16, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-23] [$1000] Bank account - Phone number field is not trimmed for spaces in connect bank account [HOLD for payment 2023-10-23] [HOLD for payment 2023-10-23] [$1000] Bank account - Phone number field is not trimmed for spaces in connect bank account Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.84-10 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 2023-10-23. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@Ollyws] The PR that introduced the bug has been identified. Link to the PR:
  • [@Ollyws] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@Ollyws] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@Ollyws] Determine if we should create a regression test for this bug.
  • [@Ollyws] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@garrettmknight] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@Ollyws
Copy link
Contributor

Ollyws commented Oct 23, 2023

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR:

We can't really call this a regression from any PR, we just never considered to sanitize/trim the draft values after the form was submitted.

  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

N/A

  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

N/A

  • Determine if we should create a regression test for this bug.

I don't think a regression test is helpful for this one as it's a minor aesthetic feature that doesn't affect the flow in any meaningful way.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Oct 23, 2023
@garrettmknight
Copy link
Contributor

Summary of Payments:

New Upwork issue: https://www.upwork.com/en-gb/ab/applicants/1716919006499426304/job-details

New offers out since the other job went stale - I'll pay when y'all accept.

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@garrettmknight
Copy link
Contributor

All paid up - closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants