Skip to content

[HOLD for payment 2024-02-20] [$250] Address – Incorrect error message appear when enter Cyrillic letters into Zip field #34668

Closed

Description

@lanitochka17

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: 1.4.26-1
Reproducible in staging?: Y
Reproducible in production?: N
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Login to New dot
  2. Navigate to Settings -> Profile -> Personal details
  3. Navigate to Home address page
  4. Add Cyrillic letters or symbols into Zip/Postcode field

Expected Result:

"Incorrect zip code format" message should appear

Actual Result:

Incorrect error message ( privatePersonalDetails.error.incorrectZipFormat ) appear when enter Cyrillic letters into Zip/Postcode field

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6345666_1705518185161!Capture

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ae2a56928644ce4f
  • Upwork Job ID: 1747794052740149248
  • Last Price Increase: 2024-01-18
  • Automatic offers:
    • s77rt | Reviewer | 28118027
    • dukenv0307 | Contributor | 28118028

Activity

  1. github-actions commented on Jan 17, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  2. melvin-bot commented on Jan 17, 2024

    @melvin-bot

    Triggered auto assignment to @jasperhuangg (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  3. abzokhattab commented on Jan 17, 2024

    @abzokhattab
    Contributor

    Proposal

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

    Address - Incorrect error message appear when enter Cyrillic letters into Zip field

    What is the root cause of that problem?

    1. the zip code input is inside an input wrapper where the inputcomponent prop is TextInput
    2. inside the input wapper we call registerInput which is provided by the FormProvider context here
    3. the registerInput function sets the errorText ---> errorText: errors[inputID] || fieldErrorMessage,
    4. now the object returned from the registerInput is passed to the TextInput as props
    5. the BaseTextInput component uses FormHelpMessage to display the error where the input is the errorText provided in the props
    6. the FormHelpMessage component calls Localize.translateIfPhraseKey to translate the error message
    7. the translateIfPhraseKey function parses the input value to fetch the passed variables to the translate function
    8. in the case of the zipcode we don't provide a second argument to the translation making the variables object assigned to undefined which make the translate function unable to resolve the translation.

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

    we can add an empty object as the default value for the variables obj here :

            const [phrase, variables = {}] = Array.isArray(message) ? message : [message];

    alternatively

    we can modify the zipcode translation above to:

    errors.zipPostCode = ['privatePersonalDetails.error.incorrectZipFormat', {zipFormat: countryZipFormat}];

    futhermore this snippet could be refactored to:

    const trimmedZip = values.zipPostCode.trim().toUpperCase();
    const zipValidation = countrySpecificZipRegex ? countrySpecificZipRegex.test(trimmedZip) : CONST.GENERIC_ZIP_CODE_REGEX.test(trimmedZip);
    const isRequiredFulfilled = ValidationUtils.isRequiredFulfilled(values.zipPostCode.trim());
    
    if (!zipValidation) {
        errors.zipPostCode = isRequiredFulfilled
            ? ['privatePersonalDetails.error.incorrectZipFormat', { zipFormat: countryZipFormat }]
            : 'common.error.fieldRequired';
    }
  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jan 18, 2024
  5. changed the title [-]Address – Incorrect error message appear when enter Cyrillic letters into Zip field[/-] [+][$500] Address – Incorrect error message appear when enter Cyrillic letters into Zip field[/+] on Jan 18, 2024
  6. melvin-bot commented on Jan 18, 2024

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 18, 2024
  8. 35 remaining items

  9. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Feb 13, 2024
  10. changed the title [-][$250] Address – Incorrect error message appear when enter Cyrillic letters into Zip field[/-] [+][HOLD for payment 2024-02-20] [$250] Address – Incorrect error message appear when enter Cyrillic letters into Zip field[/+] on Feb 13, 2024
  11. melvin-bot commented on Feb 13, 2024

    @melvin-bot

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

  12. melvin-bot commented on Feb 13, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.40-5 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 2024-02-20. 🎊

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

  13. melvin-bot commented on Feb 13, 2024

    @melvin-bot

    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:

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

    @s77rt
    Member
  15. melvin-bot commented on Feb 20, 2024

    @melvin-bot

    Issue is ready for payment but no BZ is assigned. @sonialiap you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

  16. sonialiap commented on Feb 21, 2024

    @sonialiap
    Contributor

    @s77rt Reviewer $250 - paid ✔️
    @dukenv0307 Contributor $250 - paid ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions