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-06-28] [$1000] Settings - Zip/ Pin code validation is case sensitive #20569

Closed
4 of 6 tasks
kbecciv opened this issue Jun 11, 2023 · 39 comments
Closed
4 of 6 tasks
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

@kbecciv
Copy link

kbecciv commented Jun 11, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

Action Performed:

  1. Open the app
  2. Open settings
  3. Open profile
  4. Open personal details
  5. Open Home address
  6. Change country to 'Ascension Island'
  7. Insert same format zip code but in lower case and observe that it throws validation error.

Expected Result:

The Zip/ Pin code should be uppercased on the background without user noticing and then we can run the verification making the case sensitiveness irrelevant.

Actual Result:

Zip/ Pin code validation is case sensitive

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.26.1

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

case.sensitive.zipcode.error.mp4
Recording.3066.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ebaa85cf62804d03
  • Upwork Job ID: 1668213774703255552
  • Last Price Increase: 2023-06-12
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 11, 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

@dukenv0307
Copy link
Contributor

Proposal

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

Zip/ Pincode validation is case sensitive

What is the root cause of that problem?

Example for Ascension Island Country

App/src/CONST.js

Lines 1570 to 1573 in 82ce35f

AC: {
regex: /^ASCN 1ZZ$/,
samples: 'ASCN 1ZZ',
},

We are using this regex to check if the zipcode is valid or not. And this regex is accepted if the input is uppercase

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

We should uppercase the input before validating and saving zipcode
In here

if (!countrySpecificZipRegex.test(values.zipPostCode.trim())) {

and
PersonalDetails.updateAddress(values.addressLine1.trim(), values.addressLine2.trim(), values.city.trim(), values.state.trim(), values.zipPostCode.trim(), values.country);

Update

values.zipPostCode.trim()

to

values.zipPostCode.trim().toUpperCase())

What alternative solutions did you explore? (Optional)

In some countries, we only have some options in zip code field (ex: Ascension Island Country, we only have 1 option is ASCN 1ZZ ). So with these country, we can use an option selector instead of input field

@eh2077
Copy link
Contributor

eh2077 commented Jun 12, 2023

It looks like country zip code is case sensitive and would like to tag @Prince-Mendiratta to confirm as you added the feature #14958

@huzaifa-99
Copy link
Contributor

huzaifa-99 commented Jun 12, 2023

Proposal

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

The zip codes in the address form are case sensitive

What is the root cause of that problem?

Our zip code regex for countries is designed to be case-sensitive for all countries other than Montserrat.

We currently have ~42 (-1 Montserrat) countries with alphabets in zip codes, all case-sensitive.

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

Most countries use uppercase zipcodes for ease of processing, but lowercase ones also work. We can allow case-insensitive zip codes for all countries by adding an i flag in the regex, so for example, the regex for Ascension Island will become

AC: {
    regex: /^ASCN 1ZZ$/i,
    // ...

which will match the lower and upper case alphabets.

Optional:

  • Update the zip code sample values with lowercase zipcode examples.

What alternative solutions did you explore? (Optional)

N/A

@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Jun 12, 2023
@melvin-bot melvin-bot bot changed the title Settings - Zip/ Pin code validation is case sensitive [$1000] Settings - Zip/ Pin code validation is case sensitive Jun 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

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

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

melvin-bot bot commented Jun 12, 2023

Triggered auto assignment to @mountiny (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@mountiny
Copy link
Contributor

@Prince-Mendiratta Can you please confirm if the case sensitiveness has been intentional and any reason we should not make this case insensitive?

@0xmiros
Copy link
Contributor

0xmiros commented Jun 12, 2023

Also cc-ing @Beamanator

@Prince-Mendiratta
Copy link
Contributor

As far as I recall, we implemented case sensitiveness as letters in zip code are supposed to be in upper case. If we think differently now and we want to allow case insensitive inputs, I can put in a PR (without any payment) as it is a pretty simple change.

@mountiny
Copy link
Contributor

Hmm I am not sure, I know in UK for example sometimes the websites complain if I dont use uppercase so maybe a bit more digging into this should be done. Or we can just simply enfore the uppercase and let users know. Or map it to uppercase as they write it in

@0xmiros
Copy link
Contributor

0xmiros commented Jun 12, 2023

Or map it to uppercase as they write it in

We can just fix this in web only. (flicker happens in native but it's already uppercased as default in keyboard so no need)

@mountiny
Copy link
Contributor

I am inclined to overwriting user to uppercase in this case.

@Beamanator
Copy link
Contributor

Beamanator commented Jun 12, 2023

@mountiny I thought we didn't prefer modifying user input as we typed? Example: we don't accept uppercase letters in contact methods, but instead of overwriting user input as they type, we lowercase the text before sending it to the API

So maybe we just auto capitalize before storing the zip code in onyx & sending to the API?

@mountiny
Copy link
Contributor

That works as well, I was not sure if there are some generic guidelines about this.

@0xmiroslav does that sound good to you?

@Beamanator
Copy link
Contributor

I think I discussed it with Shawn in the past - we can tag him if you'd like, but otherwise I think I'd go with auto-uppercasing without the user needing to know

@0xmiros
Copy link
Contributor

0xmiros commented Jun 12, 2023

That works as well, I was not sure if there are some generic guidelines about this.

@0xmiroslav does that sound good to you?

Sounds good to me. I have no concern either way as long as it's not against our form guidelines.
Maybe uppercase will be used only in validation and save raw user input in onyx?

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jun 12, 2023

@0xmiroslav In this context, Could you take a look at my proposal with the idea to uppercase zipcode when validating and submitting? And then we can discuss more if there is any problem

@mountiny
Copy link
Contributor

Updated the issue op

@0xmiros
Copy link
Contributor

0xmiros commented Jun 12, 2023

@0xmiroslav In this context, Could you take a look at my proposal with the idea to uppercase zipcode when validating and submitting? And then we can discuss more if there is any problem

Proposal looks good to me. It's straightforward.

@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

📣 @dukenv0307 You have been assigned to this job by @mountiny!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@dukenv0307
Copy link
Contributor

Hi @abdulrahuman5196 The PR is ready for review

@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

🎯 ⚡️ Woah @abdulrahuman5196 / @dukenv0307, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @dukenv0307 got assigned: 2023-06-14 16:13:00 Z
  • when the PR got merged: 2023-06-15 17:03:38 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 21, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Settings - Zip/ Pin code validation is case sensitive [HOLD for payment 2023-06-28] [$1000] Settings - Zip/ Pin code validation is case sensitive Jun 21, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.29-11 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-06-28. 🎊

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.

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 Jun 21, 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:

  • [@abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] 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:
  • [@abdulrahuman5196] Determine if we should create a regression test for this bug.
  • [@abdulrahuman5196] 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.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abdulrahuman5196
Copy link
Contributor

BZ checklist

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

This wasn't a regression. We have identified this requirement now to uppercase zip/postal codes in background

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

Yes

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.

  1. Open settings -> profile -> personal details -> Home address
  2. Change country to 'Ascension Island'
  3. Insert the same format zip code as suggested but in lowercase
  4. Verify that it doesn't throw a validation error.
  5. Click the save button
  6. Verify that the zipcode is converted to uppercase automatically

cc: @mountiny

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jun 27, 2023
@abdulrahuman5196
Copy link
Contributor

Gentle ping on this @johncschuster

@melvin-bot melvin-bot bot removed the Overdue label Jun 30, 2023
@sakluger
Copy link
Contributor

sakluger commented Jul 1, 2023

Sorry for the delay everyone, @johncschuster is out for the week. I just sent offers through Upwork to @dhanashree-sawant, @dukenv0307, and @abdulrahuman5196.

@abdulrahuman5196
Copy link
Contributor

@sakluger Thank you. Accepted the job invite.

@melvin-bot melvin-bot bot added the Overdue label Jul 3, 2023
@mountiny
Copy link
Contributor

mountiny commented Jul 4, 2023

@dukenv0307 @abdulrahuman5196 and @dhanashree-sawant has this all been paid out?

If yes we can close this

@melvin-bot melvin-bot bot removed the Overdue label Jul 4, 2023
@abdulrahuman5196
Copy link
Contributor

@mountiny no. I have accepted the contract. But still waiting on payment release.

@mountiny
Copy link
Contributor

mountiny commented Jul 4, 2023

Independence day, probably gonna be paid tomorrow, sorry for that

@abdulrahuman5196
Copy link
Contributor

No problem. Thought so. Many people would be off this time of the year. 😅

@johncschuster
Copy link
Contributor

Sorry for the delay, folks! I'm working on this now!

@johncschuster
Copy link
Contributor

Payment has been issued! Thanks for your patience, everyone!

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