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-07-26] [$1000] Requesting magic code from 'Magic code' page doesn't clear all sign-in errors #21293

Closed
1 of 6 tasks
kavimuru opened this issue Jun 22, 2023 · 37 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@kavimuru
Copy link

kavimuru commented Jun 22, 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:

  1. Navigate to sign-in page
  2. Enter email > click on 'Continue' button
  3. Copy expired magic sign-in link from previous interaction
  4. Paste to browser > prefix the link with 'staging' text > press enter
  5. Verify that 'Magic code expired' page is displayed
  6. Switch to the tab where sign-in page is opened
  7. Click on Sign-in button
  8. Switch to the tab where 'Magic code expired' page is displayed
  9. Click on 'request a new code here!' link
  10. Switch to the tab where sign-in page is opened

Expected Result:

All error messages including 'Please enter your magic code' should be cleared in the same manner as requesting magic code from sign-in page clears all errors

Actual Result:

'Please enter your magic code' error message is not cleared

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.30-5
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

2023-06-15.16.26.26.mp4
Recording.1059.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686836451096149

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018f0afc70ce23ee77
  • Upwork Job ID: 1671920220866732032
  • Last Price Increase: 2023-07-06
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

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

@melvin-bot
Copy link

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

@mdneyazahmad
Copy link
Contributor

mdneyazahmad commented Jun 22, 2023

Proposal

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

Request a new magic code does not clear sign in form errors on other tab.

What is the root cause of that problem?

When user opens an expired link, and clicks request a new code here!, This calls Session.resendValidateCode(), which clears error field in ONYXKEYS.ACCOUNT key in onyx datastore.

hasError in BaseValidateCodeForm is based on this, but errorText is dependent based on formError in the component state which is not updated when we request magic code from other component.

errorText={formError.validateCode ? props.translate(formError.validateCode) : ''}
hasError={hasError}

MagicCodeInput just depend on formError prop therefore this error error is not cleared.

{!_.isEmpty(props.errorText) && (

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

There are two props related to error field. hasError and errorText. I believe, it should be enough to just rely on hasError to display error message. In fact these two props should be synced, i.e., when hasError is true, errorText should contain an error message, and when it is false, it should be empty.

These are the changes:

  1. Add extra condition on Line354
{props.hasError && !_.isEmpty(props.errorText) && ( 
  1. Fix this condition with and
    props.hasError || props.errorText ? styles.borderColorDanger : {},
props.hasError && props.errorText ? styles.borderColorDanger : {},

What alternative solutions did you explore? (Optional)

None

@tienifr
Copy link
Contributor

tienifr commented Jun 22, 2023

Proposal

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

Requesting magic code from 'Magic code' page doesn't clear all sing-in errors

What is the root cause of that problem?

We're using component state to show the error

errorText={formError.twoFactorAuthCode ? props.translate(formError.twoFactorAuthCode) : ''}
hasError={hasError}

we just only clear error state when users click Didn't receive a magic code? on login page.

That why when users click resend validate code from Magic code page, the errors still are shown in the login page.

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

change function resendValidateCode to

    const resendValidateCode = () => {
        User.resendValidateCode(props.credentials.login, true);
    };

move other code to new function like clearData, then execute this function when props.account.loadingForm === CONST.FORMS.VALIDATE_CODE_FORM

     useEffect(()=>{
        if(props.account.loadingForm === CONST.FORMS.VALIDATE_CODE_FORM){
            clearData()
        }
    },[props.account.loadingForm])

Result

Screen.Recording.2023-06-22.at.17.58.35.mp4

@twisterdotcom
Copy link
Contributor

Chatting in Slack on this one. DIdn't realize this could be done. Let's do it!

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Jun 22, 2023
@melvin-bot melvin-bot bot changed the title Requesting magic code from 'Magic code' page doesn't clear all sing-in errors [$1000] Requesting magic code from 'Magic code' page doesn't clear all sing-in errors Jun 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

Job added to Upwork: https://www.upwork.com/jobs/~018f0afc70ce23ee77

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

melvin-bot bot commented Jun 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

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

@twisterdotcom
Copy link
Contributor

@aimane-chnaif two proposals to review here. Let's see if we can get this moving and maybe even merged this week!

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@twisterdotcom
Copy link
Contributor

Bump on this @aimane-chnaif

@twisterdotcom
Copy link
Contributor

I am OOO! Adding another BZ member for the week.

@twisterdotcom twisterdotcom added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jun 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 28, 2023

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

@Expensify Expensify deleted a comment from melvin-bot bot Jun 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Jun 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

@JmillsExpensify, @twisterdotcom, @aimane-chnaif Eep! 4 days overdue now. Issues have feelings too...

@Natnael-Guchima
Copy link

@JmillsExpensify the link is removed from the page on the latest PR. I don't think there is a need to pursue this issue.

image

@twisterdotcom
Copy link
Contributor

We implemented the timer, but you see, I requested a new code in the tab on the right here, but it didn't clear the error in the tab on the left:
image

I think @tienifr's proposal would do that, which is a neat improvement right? We just need @aimane-chnaif to review it.

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

melvin-bot bot commented Jul 12, 2023

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

Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

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
Copy link

melvin-bot bot commented Jul 12, 2023

📣 @natnael! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

The BZ member will need to manually hire Natnael for the Reporter role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!

@Natnael-Guchima
Copy link

Contributor details
Your Expensify account email: natnaelguchima12@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0135b3a84ec2709c21

@melvin-bot
Copy link

melvin-bot bot commented Jul 13, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@garrettmknight
Copy link
Contributor

Following this issue to pay out this bug report when it's fixed.

@danieldoglas
Copy link
Contributor

Fix was deployed

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 19, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Requesting magic code from 'Magic code' page doesn't clear all sign-in errors [HOLD for payment 2023-07-26] [$1000] Requesting magic code from 'Magic code' page doesn't clear all sign-in errors Jul 19, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.42-26 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-07-26. 🎊

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

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 melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jul 25, 2023
@twisterdotcom
Copy link
Contributor

Payment due tomorrow.

External issue reporter: @Natnael-Guchima due $250: https://www.upwork.com/nx/wm/pre-hire/c/8577561/offer/25751090
Contributor that fixed the issue: @tienifr due $1000: https://www.upwork.com/nx/wm/workroom/34187190/overview
Contributor+ that helped on the issue and/or PR: @aimane-chnaif due $1000: https://www.upwork.com/nx/wm/workroom/34202522/overview

@melvin-bot melvin-bot bot removed the Overdue label Jul 25, 2023
@twisterdotcom
Copy link
Contributor

All paid out.

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 Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Projects
None yet
Development

No branches or pull requests

10 participants