Skip to content

[Due for payment 2025-02-10] [$250] Contact method - Two error messages appear the same time #55490

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: 9.0.86-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to URL https://staging.new.expensify.com/
  2. Login with any account
  3. Go to Settings -> Profile -> Contact methods
  4. Enter a new contact method -> Don't validate
  5. Several times click Didn't receive a magic code? until you get an error message
  6. Then enter incorrect magic code -> Verify

Expected Result:

The previous error must disappear when the next one appears

Actual Result:

Two error messages appear at the same time

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Add any screenshot/video evidence
Bug6704213_1736242730055.bandicam_2025-01-07_15-04-37-042.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021882050166066042062
  • Upwork Job ID: 1882050166066042062
  • Last Price Increase: 2025-01-22
  • Automatic offers:
    • Krishna2323 | Contributor | 105907621
Issue OwnerCurrent Issue Owner: @zanyrenney

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 20, 2025
  2. melvin-bot commented on Jan 20, 2025

    @melvin-bot

    Triggered auto assignment to @zanyrenney (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.

  3. github-actions commented on Jan 20, 2025

    @github-actions
    Contributor

    ⚠️ @Krishna2323 Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  4. Krishna2323 commented on Jan 20, 2025

    @Krishna2323
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-01-21 05:01:01 UTC.

    Proposal

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

    Contact method - Two error messages appear the same time

    What is the root cause of that problem?

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

        const validateAndSubmitForm = useCallback(() => {
            User.clearValidateCodeActionError('actionVerified');
            if (!validateCode.trim()) {
                setFormError({validateCode: 'validateCodeForm.error.pleaseFillMagicCode'});
                return;
            }
    
            if (!ValidationUtils.isValidValidateCode(validateCode)) {
                setFormError({validateCode: 'validateCodeForm.error.incorrectMagicCode'});
                return;
            }
    
            setFormError({});
            handleSubmitForm(validateCode);
        }, [validateCode, handleSubmitForm]);

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

  5. Shahidullah-Muffakir commented on Jan 21, 2025

    @Shahidullah-Muffakir
    Contributor

    Proposal

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

    Two error messages appears at the same time

    What is the root cause of that problem?

    1. When user tries to send a new magic code multiple times with ResendValidateCode endpoint, we get the error Failed to send a new magic code. because of the limit, and then we are storing this error in the ONYXKEYS.VALIDATE_ACTION_CODE key , under actionVerified property:
      errorFields: {
      actionVerified: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('contacts.genericFailureMessages.requestContactMethodValidateCode'),
      },
    2. When user types a incorrect magic code and click verify , the AddNewContactMethod endpoint returns a new error message for the wrong magic code
    3. The issue occurs because at the point 2, if user gets a new error we are not clearing the the previous error
      function addNewContactMethod(contactMethod: string, validateCode = '') {

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

    To remove the previous error, we can clear the VALIDATE_ACTION_CODE error message whenever user clicks the Verify Btn and addNewContactMethod returns a new error.
    here:

    function addNewContactMethod(contactMethod: string, validateCode = '') {

    in the failureData we can add this:

            {
                onyxMethod: Onyx.METHOD.MERGE,
                key: ONYXKEYS.VALIDATE_ACTION_CODE,
                value: {
                    errorFields: {
                        actionVerified: null,
                    },
                },
            },

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA

    What alternative solutions did you explore? (Optional)

    NA

    Screen.Recording.2025-01-21.at.9.15.23.AM.mov
  6. Krishna2323 commented on Jan 21, 2025

    @Krishna2323
    Contributor

    PROPOSAL UPDATED

    • Added an optional change
  7. zanyrenney commented on Jan 22, 2025

    @zanyrenney
    Contributor

    Image

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 22, 2025
  9. melvin-bot commented on Jan 22, 2025

    @melvin-bot
  10. changed the title [-]Contact method - Two error messages appear the same time[/-] [+][$250] Contact method - Two error messages appear the same time[/+] on Jan 22, 2025
  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 22, 2025
  12. melvin-bot commented on Jan 22, 2025

    @melvin-bot

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

  13. 22 remaining items

  14. parasharrajat commented on Feb 10, 2025

    @parasharrajat
    Member

    @zanyrenney Could you please add the summary?

  15. carlosmiceli commented on Feb 12, 2025

    @carlosmiceli
    Contributor

    Chill Melvi, we're waiting for @zanyrenney

  16. melvin-bot commented on Feb 17, 2025

    @melvin-bot

    @carlosmiceli @parasharrajat @zanyrenney @Krishna2323 this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  17. melvin-bot commented on Feb 18, 2025

    @melvin-bot

    @carlosmiceli, @parasharrajat, @zanyrenney, @Krishna2323 Huh... This is 4 days overdue. Who can take care of this?

  18. mallenexpensify commented on Feb 18, 2025

    @mallenexpensify
    Contributor

    Contributor: @Krishna2323 paid $250 via Upwork
    Contributor+: @parasharrajat due $250 via NewDot

    Test case created

    Apologies for the payment delay

  19. JmillsExpensify commented on Feb 21, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @parasharrajat

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.DailyKSv2ExternalAdded 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