Skip to content

[HOLD for payment 2023-07-24] [$1000] Web - Loader animation appears on clicking resend magic code #22083

Closed

Description

@kbecciv

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. Logout if you are logged in
  2. Enter an email
  3. Click continue and wait for 30seconds
  4. Click resend code

Expected Result:

No loader animation on sign in button

Actual Result:

Loader animation on sign in button

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

bandicam.2023-07-01.21-01-25-923.1.mp4
Recording.2294.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f28b124d7b31c045
  • Upwork Job ID: 1675925621136752640
  • Last Price Increase: 2023-07-03

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 2, 2023
  2. melvin-bot commented on Jul 2, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jul 2, 2023

    @melvin-bot

    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
  4. samh-nl commented on Jul 3, 2023

    @samh-nl
    Contributor

    Proposal

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

    Inconsistency in the displaying of the loader in the Sign in button when resending a magic code.

    What is the root cause of that problem?

    Resending the magic code causes MagicCodeInput to be cleared.
    As this is registered as an onChangeText event, this leads to Session.clearAccountMessages(); being called if there is an error present, immediately setting isLoading to false, causing the loader not to be shown in the Sign in button.

    In conclusion, the issue is that clearing errors has the unintended side-effect that it automatically sets isLoading to false.

    if (props.account.errors) {
    Session.clearAccountMessages();
    }

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

    Preventing this side-effect by adding a parameter to Session.clearAccountMessages(); called shouldClearLoading and setting this to false in this situation. If set to false, isLoading should not be cleared.

    This could also be applied to occurrences elsewhere where the intention is to clear errors upon input change (PasswordForm.js:79, LoginForm.js:113, Profile\Contacts\...\BaseValidateCodeForm.js:101),

    What alternative solutions did you explore? (Optional)

  5. bernhardoj commented on Jul 3, 2023

    @bernhardoj
    Contributor

    Proposal

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

    Loading spinner is showing when resending magic code.

    What is the root cause of that problem?

    When we initiate a resend magic code, it will set account.isLoading to true and account.loadingForm to CONST.FORMS.VALIDATE_CODE_FORM.

    function resendValidateCode(login = credentials.login) {
    const optimisticData = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: ONYXKEYS.ACCOUNT,
    value: {
    isLoading: true,
    errors: null,
    loadingForm: CONST.FORMS.VALIDATE_CODE_FORM,
    },
    },
    ];

    loadingForm is helpful in telling which form is actually loading and in our case, resending magic code tells that the validate code form (magic code) is the one that is loading.

    isLoading={
    props.account.isLoading && props.account.loadingForm === (props.account.requiresTwoFactorAuth ? CONST.FORMS.VALIDATE_TFA_CODE_FORM : CONST.FORMS.VALIDATE_CODE_FORM)
    }

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

    There are a couple of solutions, but all of them are similar to each other.

    Option 1:
    When we resend a magic code, no need to set isLoading to true and loadingForm to CONST.FORMS.VALIDATE_CODE_FORM. We immediately show a timer (30s) after pressing the resend button, so having isLoading as true doesn't do anything.

    Option 2:
    Keep isLoading to true, but don't set loadingForm to CONST.FORMS.VALIDATE_CODE_FORM.

    Option 3:
    Keep both, but change loadingForm to a new value, for example, CONST.FORMS.RESEND_VALIDATE_CODE.

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 3, 2023
  7. changed the title [-]Web - Loader animation appears on clicking resend magic code[/-] [+][$1000] Web - Loader animation appears on clicking resend magic code[/+] on Jul 3, 2023
  8. melvin-bot commented on Jul 3, 2023

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 3, 2023
  10. melvin-bot commented on Jul 3, 2023

    @melvin-bot

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

  11. melvin-bot commented on Jul 3, 2023

    @melvin-bot

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

  12. gitvolo commented on Jul 3, 2023

    @gitvolo

    Proposal

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

    Inconsistency in the displaying of the loader in the Sign in button when resending a magic code.

    What is the root cause of that problem?

    There's a resendValidateCode function in Session actions.
    When we click the resend magic code button, onyx update isLoading to true.
    That makes "Sign In" button loading.

    function resendValidateCode(login = credentials.login) {
    const optimisticData = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: ONYXKEYS.ACCOUNT,
    value: {
    isLoading: true,
    errors: null,
    loadingForm: CONST.FORMS.VALIDATE_CODE_FORM,
    },
    },
    ];

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

    Unless it is intentional, we don't need to set isLoading to true.

  13. 27 remaining items

  14. changed the title [-][$1000] Web - Loader animation appears on clicking resend magic code[/-] [+][HOLD for payment 2023-07-24] [$1000] Web - Loader animation appears on clicking resend magic code[/+] on Jul 17, 2023
  15. melvin-bot commented on Jul 17, 2023

    @melvin-bot

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

  16. melvin-bot commented on Jul 17, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.41-3 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-24. 🎊

    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
  17. melvin-bot commented on Jul 17, 2023

    @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.
    • [@MitchExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  18. MitchExpensify commented on Jul 18, 2023

    @MitchExpensify
    Contributor

    Added a reminder to pay to my calendar.

    Friendly reminder to get the BZ steps above addressed @s77rt - Thank you!

  19. s77rt commented on Jul 18, 2023

    @s77rt
    Member
  20. MitchExpensify commented on Jul 18, 2023

    @MitchExpensify
    Contributor

    Awesome, thanks @s77rt !

  21. MitchExpensify commented on Jul 24, 2023

    @MitchExpensify
    Contributor

    Reporting bonus paid @chiragxarora

    C+ paid with bonus to @s77rt

    @bernhardoj invited you to the Upwork Job and will close this out once we get payment over to you!

  22. bernhardoj commented on Jul 24, 2023

    @bernhardoj
    Contributor

    Accepted

  23. MitchExpensify commented on Jul 24, 2023

    @MitchExpensify
    Contributor

    Thanks! Paid and contract ended 🚀

    Great job everyone

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