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-09-06] [$1000] Web - Inconsistent error messages text on wrong magic code #22017

Closed
1 of 6 tasks
kbecciv opened this issue Jul 1, 2023 · 94 comments
Closed
1 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 Engineering External Added to denote the issue can be worked on by a contributor Waiting for copy User facing verbiage needs polishing

Comments

@kbecciv
Copy link

kbecciv commented Jul 1, 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!


Action Performed:

Action Performed:

  1. Signout if you are logged in
  2. Enter an email > continue
  3. Enter wrong magic code
  4. Login
  5. Go to contact methods
  6. Add an email > verify
  7. Enter wrong magic code

Expected Result:

same error message

Actual Result:

Inconsistent error messages text on wrong magic code

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.35.4
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
Notes/Photos/Videos: Any additional supporting documentation

bandicam_2023-06-28_15-18-13-488.mp4
bandicam_2023-06-28_15-19-37-915-1.mp4

Expensify/Expensify Issue URL:
Issue reported by: @chiragxarora
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688221719614829

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0150dd5082869ecc1c
  • Upwork Job ID: 1675276504517607424
  • Last Price Increase: 2023-07-22
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 26274048
    • chiragxarora | Reporter | 26274049
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 1, 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

@kbecciv
Copy link
Author

kbecciv commented Jul 1, 2023

Proposal

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

inconsistent error message on incorrect magic code

What is the root cause of that problem?

Root cause of the issue is the different error messages being passed from backend. When user enters an incorrect code while signing in, different error message comes from backend, when wrong code on secondary login, different error message.

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

We should make the error message consistent on backend, we should pick one error message out of two and use it on both flows.
We should use the one which says "incorrect magic code, please try again or request a new one" because other message mentioning code expiry doesn't make much sense

Results
### What alternative solutions did you explore? (Optional) None

@MitchExpensify
Copy link
Contributor

MitchExpensify commented Jul 1, 2023

Agree this is expected: "Incorrect magic code, please try again or request a new one"

@MitchExpensify MitchExpensify added the External Added to denote the issue can be worked on by a contributor label Jul 1, 2023
@melvin-bot melvin-bot bot changed the title Web - Inconsistent error messages text on wrong magic code [$1000] Web - Inconsistent error messages text on wrong magic code Jul 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 1, 2023

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

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

melvin-bot bot commented Jul 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 1, 2023

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

@abdulrahuman5196
Copy link
Contributor

@chiragxarora Could you provide references for your proposal? #22017 (comment)

From code I could see places where we are setting the magic code error locally. Gentle suggestion would be to provide references and more information in proposal, so that we don't have to assume certain parts of proposal.

@chiragxarora
Copy link
Contributor

chiragxarora commented Jul 2, 2023

Updated Proposal to #22017 (comment)

PROPOSAL

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

inconsistent error message on incorrect magic code

What is the root cause of that problem?

Root cause of the issue is backend sending different error messages for the similar process as shown in the videos above.
And while displaying the error,

  • for signin flow, we pick the error from onyx which has the error received from the backend
Screenshot 2023-07-20 at 1 45 10 AM

{hasError && <FormHelpMessage message={ErrorUtils.getLatestErrorMessage(props.account)} />}

  • for secondary login flow, we also display the error from onyx which first has the error message received from backend
Screenshot 2023-07-20 at 1 48 28 AM

errors={ErrorUtils.getEarliestErrorField(loginData, 'validateLogin')}

but we see a third different error because we have populated the failure data with an extra error field here while making the api call which we haven't done in signin flow

{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
errorFields: {
validateLogin: ErrorUtils.getMicroSecondOnyxError('contacts.genericFailureMessages.validateSecondaryLogin'),
},
pendingFields: {
validateLogin: null,
},
},
},
},

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

To make it completely consistent across frontend and backend, we need to make 2 changes here,

  • firstly, we should remove/replace the errorField from the failure data and let the onyx use the error message received from backend while validating code
  • second change would be at the backend which is real rca. As shown in the networks tab attachments of both flow above, we can see that backend is sending different error messages,
    • Incorrect magic code. Please try again or request a new code.
    • This magic code is invalid or has expired, please request a new code and try again.
      We need to display one error message which is Incorrect magic code. Please try again or request a new code. at both the places
      This second change is important as you can see that both the error messages are currently being stored in onyx db and on slow devices/network, second error shows up
Screenshot 2023-07-24 at 11 57 35 PM

What alternative solutions did you explore? (Optional)

None

@alitoshmatov
Copy link
Contributor

I think backend should change the error message, because right now it is showing what backend is sending in error

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

@HezekielT
Copy link
Contributor

HezekielT commented Jul 3, 2023

Proposal

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

Inconsistent error messages text on wrong magic code.

What is root cause of that problem?

The error message we get by calling ValidateSecondaryLogin api call and SigninUser api call is not the same – that is the error message returned by ValidateSecondaryLogin is
Failed to validate contact method with given magic code. Please request a new code and try again.
while SigninUser api call returns
Incorrect magic code. Please try again or request a new code.
Which caused the inconsistency.

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

We need to change the error message we get when calling ValidateSecondaryLogin to
Incorrect magic code, please try again or request a new code. .

I noticed that we set the error fields for contactMethod in failureData of ValidateSecondaryLogin api method as shown below.

const failureData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
errorFields: {
validateLogin: ErrorUtils.getMicroSecondOnyxError('contacts.genericFailureMessages.validateSecondaryLogin'),
},

Where the value of contacts.genericFailureMessages.validateSecondaryLogin
in en.js is

validateSecondaryLogin: 'Failed to validate contact method with given magic code. Please request a new code and try again.',

so we have to change this generic failure message to
Incorrect magic code, please try again or request a new code. in en.js and its correct translation in es.js

Result

Login page error message

Screenshot from 2023-07-12 12-31-35

Contact Page error message

Screenshot from 2023-07-12 12-32-23

What alternative solutions did you explore? (Optional)

None

@melvin-bot melvin-bot bot added the Overdue label Jul 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

@MitchExpensify, @abdulrahuman5196 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@MitchExpensify
Copy link
Contributor

We have a fresh proposal for you to review @abdulrahuman5196

@melvin-bot melvin-bot bot removed the Overdue label Jul 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 8, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@abdulrahuman5196
Copy link
Contributor

@MitchExpensify

In the signin page we show This magic code is invalid or has expired, please request a new code and try again which is got from backend

In contact verification page we show Failed to validate contact method with given magic code. Please request a new code and try again. which is shown with local data.

Which one should be the right one to maintain consistency? Based on that we can make the change.

@HezekielT
Copy link
Contributor

HezekielT commented Jul 8, 2023

@abdulrahuman5196 I think the expected one is Incorrect magic code, please try again or request a new code. according to this comment

@melvin-bot melvin-bot bot added the Overdue label Jul 10, 2023
@MitchExpensify
Copy link
Contributor

This is expected: "Incorrect magic code, please try again or request a new one"

@melvin-bot melvin-bot bot removed the Overdue label Jul 10, 2023
@nishancx
Copy link
Contributor

I think this has been fixed, error message while verifying contact method has been replaced by a more appropriate message.

Screenshot 2023-07-11 at 08 43 33

@abdulrahuman5196
Copy link
Contributor

The text is changed but still inconsistent as per the OP. Correct me if wrong. @MitchExpensify

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 23, 2023
@HezekielT
Copy link
Contributor

@abdulrahuman5196 PR #25762 is ready for review. Thanks!

@chiragxarora
Copy link
Contributor

bumping @cead22 for response to this #22017 (comment)

@cead22
Copy link
Contributor

cead22 commented Aug 23, 2023

The proposal is complete because we only expect front end changes in the proposal, or at least that's my understanding. If you feel differently, I think you should feel encouraged to start a discussion about this in #expensfy-open-source, but I don't think it's worth changing this decision after having selected a proposal and having a PR submitted

@chiragxarora
Copy link
Contributor

The PR has a one line change so I don't think that should be the reason to stick to the same decision.

I'm commenting here because in my proposal, I had suggested the complete solution (frontend plus backend (and why it's needed)) which I think is accepted

Anyways I'm okay with whatever decision is made

cc @cead22

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @HezekielT got assigned: 2023-08-23 01:21:59 Z
  • when the PR got merged: 2023-08-28 08:19:45 UTC
  • days elapsed: 3

On to the next one 🚀

@flodnv
Copy link
Contributor

flodnv commented Aug 28, 2023

@MitchExpensify this is actually eligible for the bonus. The only reason for the delay was different timezones and working hours.

@MitchExpensify
Copy link
Contributor

Payment summary:

Reporting: @chiragxarora $250
C: @HezekielT $1500
C+: @abdulrahuman5196 $1500

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 30, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Inconsistent error messages text on wrong magic code [HOLD for payment 2023-09-06] [$1000] Web - Inconsistent error messages text on wrong magic code Aug 30, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

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:

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 Aug 30, 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
Copy link
Contributor

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:

Not a regression. We have made the error message consistent.

Determine if we should create a regression test for this bug.
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.

Regression test needs to be added. But can only be added after backend fix is also done. So we can add regression test part of that.

@MitchExpensify / @cead22 Could you kindly create separate issue for backend string update if required?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 5, 2023
@MitchExpensify
Copy link
Contributor

MitchExpensify commented Sep 6, 2023

@MitchExpensify / @cead22 Could you kindly create separate issue for backend string update if required?

Is this update required do you think? @cead22

@MitchExpensify
Copy link
Contributor

Reporting: @chiragxarora $250 - Paid and contract ended
C: @HezekielT $1500 - Please accept the Upwork offer 👍
C+: @abdulrahuman5196 $1500 - Paid and contract ended

@HezekielT
Copy link
Contributor

@MitchExpensify Accepted the offer. Thanks!

@MitchExpensify
Copy link
Contributor

Thanks @HezekielT , Paid and contract ended 👍

@cead22
Copy link
Contributor

cead22 commented Sep 7, 2023

Is this update required do you think? @cead22

Not really since the PR to fix the backend message is already merged and deployed. @abdulrahuman5196 given that can you add the regression test now?

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@abdulrahuman5196
Copy link
Contributor

Regression test:

  1. Go to login
  2. Enter your email address and click continue.
  3. Add incorrect magic codes in the magic code inputs.
  4. Verify that an error messages that says Incorrect or invalid magic code. Please try again or request a new code. is displayed.
  5. Now enter the correct magic code and login.
  6. Navigate to Settings => Profile => Contact methods
  7. Click on New contact method.
  8. Enter your email and click on Add option.
  9. From Contact methods options click on Please verify this contact method.
  10. Add incorrect magic codes in the magic code inputs.
  11. Verify that an error messages that says Incorrect or invalid magic code. Please try again or request a new code. is displayed.
  12. Change the language to Spanish.
  13. Repeat step 10 and 11.
  14. Verify that an error messages that says Código mágico incorrecto o no válido. Inténtalo de nuevo o solicita otro código. is displayed in spanish.

@cead22 @MitchExpensify

@melvin-bot melvin-bot bot removed the Overdue label Sep 11, 2023
@MitchExpensify
Copy link
Contributor

Added the test request. Thanks all! Closing

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 Waiting for copy User facing verbiage needs polishing
Projects
None yet
Development

No branches or pull requests

10 participants