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

[$500] Contact methods - Two error messages appear the same time #33061

Closed
6 tasks done
izarutskaya opened this issue Dec 14, 2023 · 28 comments
Closed
6 tasks done

[$500] Contact methods - Two error messages appear the same time #33061

izarutskaya opened this issue Dec 14, 2023 · 28 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Dec 14, 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!


Version Number: v1.4.12-0
Reproducible in staging?: Y
Reproducible in production?: Y
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. 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 disappears when the next one appears

Actual Result:

Two error messages appear the same time

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

Bug6312958_1702554590620.bandicam_2023-12-13_20-47-27-664.mp4

Bug6312958_1702554590611!image__194_

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f249f131d8120932
  • Upwork Job ID: 1735273944025079808
  • Last Price Increase: 2023-12-14
  • Automatic offers:
    • c3024 | Reviewer | 28065356
    • dukenv0307 | Contributor | 28065358
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 14, 2023
@melvin-bot melvin-bot bot changed the title Contact methods - Two error messages appear the same time [$500] Contact methods - Two error messages appear the same time Dec 14, 2023
Copy link

melvin-bot bot commented Dec 14, 2023

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

Copy link

melvin-bot bot commented Dec 14, 2023

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

Copy link

melvin-bot bot commented Dec 14, 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

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

melvin-bot bot commented Dec 14, 2023

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Dec 14, 2023

Proposal

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

Two error messages appear the same time

What is the root cause of that problem?

  1. Those 2 error messages are errors associated with 2 different components, one is the validateCodeSent error here and the below is validateLogin error here

  2. There's another issue which is that the user is able to click the Didn't receive a magic code? button several times.

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

  1. Clear the validateCodeSent error in optimisticData (or failureData) if we submit the code (we already clear it in successData). When user submits the code, they are focusing on the result of the validation so it makes sense to clear unrelated error like validateCodeSent.
  2. (Optional, if we decide that we should fix it) Use the same method as the Login page which is show the 30 seconds timer (`Request a new code in 00:xx), only after that, the user can resend

What alternative solutions did you explore? (Optional)

If we want to display both errors at the same time, we should move them to 1 single location, either below of above the button, so it'll be 2 lines of errors.

@zukilover
Copy link
Contributor

zukilover commented Dec 14, 2023

Proposal

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

Magic code shows error while other error is still shown

What is the root cause of that problem?

The error for the maximum retries is shown regardless of the validateLoginError is empty or not.

errors={ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent')}

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

Add a condition so that it only shows then the validateLoginError is empty:

          <OfflineWithFeedback
                pendingAction={lodashGet(loginData, 'pendingFields.validateCodeSent', null)}
                errors={_.isEmpty(validateLoginError) ? ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent') : null}
                errorRowStyles={[styles.mt2]}
                onClose={() => User.clearContactMethodErrors(props.contactMethod, 'validateCodeSent')}
            >

What alternative solutions did you explore? (Optional)

N/A

@yh-0218
Copy link
Contributor

yh-0218 commented Dec 14, 2023

Proposal

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

Two error messages appear the same time

What is the root cause of that problem?

we have several issues (validateCodeSent, validateLogin) in error case.

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

  1. We need to combine 2 OfflineWithFeedback as one.
  <OfflineWithFeedback
           pendingAction={_.isEmpty(validateLoginError)? lodashGet(loginData, 'pendingFields.validateCodeSent', null) : lodashGet(loginData, 'pendingFields.validateLogin', null)}
           errors={_.isEmpty(validateLoginError)? ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent') : validateLoginError}
           errorRowStyles={[styles.mt2]}
           onClose={() => _.isEmpty(validateLoginError)? User.clearContactMethodErrors(props.contactMethod, 'validateCodeSent') : User.clearContactMethodErrors(props.contactMethod, 'validateLogin')}
   >
  1. If w need origin design(different position for 2 errors).
  <OfflineWithFeedback
           pendingAction={_.isEmpty(validateLoginError)? lodashGet(loginData, 'pendingFields.validateCodeSent', null) : null}
           errors={_.isEmpty(validateLoginError)? ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent') : null}
           errorRowStyles={[styles.mt2]}
           onClose={() => _.isEmpty(validateLoginError)? User.clearContactMethodErrors(props.contactMethod, 'validateCodeSent') : {}}
   >

What alternative solutions did you explore? (Optional)

We can get respected result.

Screen.Recording.2023-12-17.at.7.53.16.PM.mov

@c3024
Copy link
Contributor

c3024 commented Dec 17, 2023

Proposal here by @dukenv0307 looks good to me.

🎀 👀 🎀 C+ Reviewed

Copy link

melvin-bot bot commented Dec 17, 2023

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

@aimane-chnaif
Copy link
Contributor

please check this discussion before going ahead

@yh-0218
Copy link
Contributor

yh-0218 commented Dec 17, 2023

@c3024 My proposal has been updated.

@dukenv0307
Copy link
Contributor

please check this discussion before going ahead

@aimane-chnaif I think this case is different, I commented on the thread

@jacobkim9881
Copy link
Contributor

jacobkim9881 commented Dec 19, 2023

Since two components are created at each place these doesn't need to be one components. Because the developer designed each errors to show below each components(If 2 become one components then the error message only show on one functions place). When maximum request error occurs, the error shows below the clickable resend magic code guide. When verifying fails, incorrect error shows below the verify button.

@jacobkim9881
Copy link
Contributor

jacobkim9881 commented Dec 19, 2023

Seems there is no condition to decide which one is showed between verifying error and maximum request error.

I found <OfflineWithFeedback> uses a props shouldShowErrorMessages = true, as default. <OfflineWithFeedback> is used for validateCodeSent error. Seems the props can have a condition here to show maximum request error of magic codes like below.

 <OfflineWithFeedback
                pendingAction={lodashGet(loginData, 'pendingFields.validateCodeSent', null)}
                errors={ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent')}
                //new condition below:
                shouldShowErrorMessages={isVerifyingFailed}
                //new condition above
                errorRowStyles={[styles.mt2]}
                onClose={() => User.clearContactMethodErrors(props.contactMethod, 'validateCodeSent')}
            >

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 19, 2023
Copy link

melvin-bot bot commented Dec 19, 2023

📣 @c3024 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Dec 19, 2023

📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 20, 2023
@dukenv0307
Copy link
Contributor

@c3024 The PR is ready for review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 22, 2023
@melvin-bot melvin-bot bot changed the title [$500] Contact methods - Two error messages appear the same time [HOLD for payment 2023-12-29] [$500] Contact methods - Two error messages appear the same time Dec 22, 2023
Copy link

melvin-bot bot commented Dec 22, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 22, 2023
Copy link

melvin-bot bot commented Dec 22, 2023

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

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:

Copy link

melvin-bot bot commented Dec 22, 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:

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

@c3024
Copy link
Contributor

c3024 commented Dec 28, 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:

  • [@c3024] The PR that introduced the bug has been identified. Link to the PR: Show all Expensify logins in Contact Methods page & view each in new Contact Method Details page #15204
  • [@c3024] 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: 748f3db#r135840628
  • [@c3024] 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 is a unique case and a discussion in the channel has no use.
  • [@c3024] Determine if we should create a regression test for this bug. Yes
  • [@c3024] 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.

@c3024
Copy link
Contributor

c3024 commented Dec 28, 2023

Regression Test Proposal

  1. Go to Profile > Contact Method
  2. Click on 'New Contact Method' button
  3. Input an email and click 'Add'
  4. Click on the email added in the 'Contact Methods' page
  5. Click on the 'Didn't receive magic code' button several times quickly so that the error "You've reached the maximum number of magic codes..." is shown.
  6. Input an incorrect code
  7. Verify that only the error "Incorrect or invalid magic code..." is shown and the error "You've reached the maximum number of magic codes..." is not shown.

👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Jan 1, 2024
Copy link

melvin-bot bot commented Jan 1, 2024

@cristipaval, @NicMendonca, @c3024, @dukenv0307 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@cristipaval
Copy link
Contributor

I wonder why Melvin didn't remove the hold 👀

@melvin-bot melvin-bot bot removed the Overdue label Jan 2, 2024
@cristipaval cristipaval changed the title [HOLD for payment 2023-12-29] [$500] Contact methods - Two error messages appear the same time [$500] Contact methods - Two error messages appear the same time Jan 2, 2024
Copy link

melvin-bot bot commented Jan 4, 2024

@cristipaval @NicMendonca @c3024 @dukenv0307 this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@cristipaval
Copy link
Contributor

@NicMendonca, What is the payment status here?

@melvin-bot melvin-bot bot removed the Overdue label Jan 4, 2024
@NicMendonca
Copy link
Contributor

@c3024 / @dukenv0307 - you've both been paid via upwork

@NicMendonca
Copy link
Contributor

all set here

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants