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

[$250] Android - Profile - Zip code field is auto populated with invalid format when adding address #52237

Open
2 of 8 tasks
IuliiaHerets opened this issue Nov 8, 2024 · 8 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 8, 2024

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


Version Number: 9.0.59-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5196117&group_by=cases:section_id&group_order=asc&group_id=229064
Issue reported by: Applause Internal Team

Action Performed:

  1. Open the Expensify app.
  2. Tap on "Settings" on the bottom of the screen.
  3. Tap on "Profile"
  4. Scroll down to "Address" and open the section.
  5. Tap on "Address Line 1"
  6. Complete with "123 Paddington Street" and select the "UK, London" option when it appears on suggestions.
  7. Verify each field is auto populated correctly and tap on "Save"

Expected Result:

When selecting an address from suggestions, all the fields should be auto populated properly and the user should be able to save this address.

Actual Result:

When selecting "123 Paddington Street, UK, London" from address suggestions, the zip code field gets auto populated with an invalid format and the user is unable to save this address.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6658482_1731045837838.UK.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021856693783876183313
  • Upwork Job ID: 1856693783876183313
  • Last Price Increase: 2024-11-13
Issue OwnerCurrent Issue Owner: @mananjadhav
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 8, 2024
Copy link

melvin-bot bot commented Nov 8, 2024

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 8, 2024

Proposal


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

Android - Profile - Zip code field is auto populated with invalid format when adding address

What is the root cause of that problem?

  • We only get the outward code for UK addresses and our regex is configred for accepting outward code & inward code together.

App/src/CONST.ts

Lines 3761 to 3764 in 17cae11

GB: {
regex: /^[A-Z]{1,2}[0-9R][0-9A-Z]?\s*[0-9][A-Z-CIKMOV]{2}$/,
samples: 'LA102UX, BL2F8FX, BD1S9LU, WR4G 6LH',
},

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


  • We should update the regex to accept outward code without inward code` also. We can also update the samples.
        GB: {
            // regex: /^[A-Z]{1,2}[0-9R][0-9A-Z]?\s*[0-9][A-Z-CIKMOV]{2}$/,
            regex: /^[A-Z]{1,2}[0-9R][0-9A-Z]?\s*[0-9]?[A-Z-CIKMOV]{0,2}$/,
            samples: 'LA102UX, BL2F8FX, BD1S9LU, WR4G 6LH',
        },

What alternative solutions did you explore? (Optional)

Result

@melvin-bot melvin-bot bot added the Overdue label Nov 11, 2024
Copy link

melvin-bot bot commented Nov 11, 2024

@JmillsExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Nov 13, 2024

@JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...

@JmillsExpensify
Copy link

Opening up to the community since we already have a proposal.

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2024
@JmillsExpensify JmillsExpensify added External Added to denote the issue can be worked on by a contributor Overdue labels Nov 13, 2024
@melvin-bot melvin-bot bot changed the title Android - Profile - Zip code field is auto populated with invalid format when adding address [$250] Android - Profile - Zip code field is auto populated with invalid format when adding address Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 13, 2024
@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 14, 2024

Edited by proposal-police: This proposal was edited at 2024-11-14 22:59:01 UTC.

Proposal

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

Android - Profile - Zip code field is auto populated with invalid format when adding address

What is the root cause of that problem?

We are only allowing outward and inward code together in the regex here

App/src/CONST.ts

Lines 3761 to 3764 in 17cae11

GB: {
regex: /^[A-Z]{1,2}[0-9R][0-9A-Z]?\s*[0-9][A-Z-CIKMOV]{2}$/,
samples: 'LA102UX, BL2F8FX, BD1S9LU, WR4G 6LH',
},

but in this case it only provided the outward code, hence, the error.

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

The outward code is 2-4 char length code before the space and the inward code is 3 character length after the space so we should update the regex to allow for allowing omitting of the inward code. We do that by making the inward code(the regex part after the space as a whole optional with ?)
We will also need to add a sample without an inward code to inform the user that omitting it is possible.

The other problem I noticed in the regex regarding inward code is inward code are three char length with the first part digit followed by the second part of two letters but the letters cannot include the letters CIKMOV according to here. But the CIKMOV in our regex is doing nothing right now so we should update that part too to exclude these letters by updating to character group of [ABD-HJLNP-UW-Z]

 GB: { 
     regex:/^[A-Z]{1,2}[0-9R][0-9A-Z]?\s*([0-9][ABD-HJLNP-UW-Z]{2})?$/, 
     samples: 'LA102UX, BL2F8FX, BD1S9LU, WR4G 6LH, W1U', 
 }, 

Note that if we change the inward code part as [0-9]?[A-Z-CIKMOV]{0,2}, as suggested above, it will not enforce the inward code to be length of 3 and will generally lose the correct inward code regex rule already setup.

What alternative solutions did you explore? (Optional)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants