Skip to content

[HOLD for payment 2023-10-10] [$500] Dev - Request Money - Manual request money Infinity loading after login #28280

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 and login again
  2. Click FAB button
  3. Click request money
  4. Click manual tab, Observed infinite loading

Expected Result:

Show manual request money

Actual Result:

Infinity loading show

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: Dev 1.3.74-2
Reproducible in staging?: n
Reproducible in production?: n
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

Screen.Recording.2023-09-26.at.23.23.59.mov
Screen.Recording.2023-09-26.at.22.40.35.mov
Screen.Recording.2023-09-26.at.22.37.52.mov
Screen.Recording.2023-09-26.at.22.36.09.mov
Screen.Recording.2023-09-26.at.22.34.31.1.mov
Screen.Recording.2023-09-26.at.22.34.31.mov
Screen.Recording.2023-09-27.at.08.31.02.1.mov

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017e5ca352b532b8bd
  • Upwork Job ID: 1706782626430234624
  • Last Price Increase: 2023-09-26

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 26, 2023
  2. changed the title [-]Dev - Request Money - Manual request money Infinity loading after login[/-] [+][$500] Dev - Request Money - Manual request money Infinity loading after login[/+] on Sep 26, 2023
  3. melvin-bot commented on Sep 26, 2023

    @melvin-bot

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

  4. melvin-bot commented on Sep 26, 2023

    @melvin-bot
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 26, 2023
  6. melvin-bot commented on Sep 26, 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
  7. melvin-bot commented on Sep 26, 2023

    @melvin-bot

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

  8. kbecciv commented on Sep 26, 2023

    @kbecciv
    Author

    Proposal by: @namhihi237
    Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695742872366339

    Proposal

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

    Manual request money shows Infinity loading after logout and login again

    What is the root cause of that problem?

    This issue was introduced by #25786
    We currently have the condition checking iou.didInitCurrency to show FullScreenLoadingIndicator:

    if (!lodashGet(iou, 'didInitCurrency', false)) {
    return <FullScreenLoadingIndicator />;
    }

    When the app is initialized, we initializedidInitCurrency here
    let didInitCurrency = false;

    Here is the logic to reset the iou after login.
    let shouldResetIOUAfterLogin = true;
    let currentUserPersonalDetails = {};
    Onyx.connect({
    key: ONYXKEYS.PERSONAL_DETAILS_LIST,
    callback: (val) => {
    currentUserPersonalDetails = lodashGet(val, userAccountID, {});
    if (!val || !shouldResetIOUAfterLogin || didInitCurrency) {
    return;
    }
    // eslint-disable-next-line no-use-before-define
    resetMoneyRequestInfo();
    shouldResetIOUAfterLogin = false;
    Onyx.merge(ONYXKEYS.IOU, {
    didInitCurrency: true,
    });
    },
    });

    That's why before logging out shouldResetIOUAfterLogin = false. After logging out and logging back in, shouldResetIOUAfterLogin is still false, causing the phone to return and not reset the iou.
    This leads to didInitCurrency = false so when we enter NewRequestAmountPage it results in show loading. until we reload the page to reset the shouldResetIOUAfterLogin = true variable

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

    We should modify the conditions a bit

    if (!val || (!shouldResetIOUAfterLogin && didInitCurrency)) {
        return;
    }

    What alternative solutions did you explore? (Optional)

    N/A

  9. studentofcoding commented on Sep 27, 2023

    @studentofcoding
    Contributor

    Proposal

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

    The issue is that the "Request Money" feature is stuck in an infinite loading state after login.

    What is the root cause of that problem?

    In the NewRequestAmountPage.js file, a condition checks if didInitCurrency is false; if so, it returns a FullScreenLoadingIndicator. This causes an infinite loading state if didInitCurrency is not set to true once the currency is initialized, and only set true when it's not a part of the condition on

    let didInitCurrency = false;
    Onyx.connect({
    key: ONYXKEYS.IOU,
    callback: (val) => {
    didInitCurrency = lodashGet(val, 'didInitCurrency');
    },
    });
    let shouldResetIOUAfterLogin = true;
    let currentUserPersonalDetails = {};
    Onyx.connect({
    key: ONYXKEYS.PERSONAL_DETAILS_LIST,
    callback: (val) => {
    currentUserPersonalDetails = lodashGet(val, userAccountID, {});
    if (!val || !shouldResetIOUAfterLogin || didInitCurrency) {
    return;
    }
    // eslint-disable-next-line no-use-before-define
    resetMoneyRequestInfo();
    shouldResetIOUAfterLogin = false;
    Onyx.merge(ONYXKEYS.IOU, {
    didInitCurrency: true,
    });
    },
    });

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

    We need to ensure that didInitCurrency is set to true once the currency is initialized. This change should be made in the IOU.js file where the currency is being initialized.

    Here is the proposed change in IOU.js:

    Onyx.connect({
        key: ONYXKEYS.IOU,
        callback: (val) => {
            didInitCurrency = lodashGet(val, 'didInitCurrency');
            if (!didInitCurrency) {
                // Initialize the currency here
                // After initializing the currency
                Onyx.merge(ONYXKEYS.IOU, {didInitCurrency: true});
            }
        },
    });
    

    Result

    Apple Native App

    output.mp4

    Safari Desktop

    output_dekstop.mp4

    What alternative solutions did you explore? (Optional)

    None

    @trjExpensify @narefyev91

  10. narefyev91 commented on Sep 27, 2023

    @narefyev91
    Contributor

    Proposal from @namhihi237 looks good to me #28280 (comment)
    🎀 👀 🎀 C+ reviewed

  11. 10 remaining items

  12. changed the title [-][$500] Dev - Request Money - Manual request money Infinity loading after login[/-] [+][HOLD for payment 2023-10-10] [$500] Dev - Request Money - Manual request money Infinity loading after login[/+] on Oct 3, 2023
  13. melvin-bot commented on Oct 3, 2023

    @melvin-bot

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

  14. melvin-bot commented on Oct 3, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.76-6 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-10-10. 🎊

    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
  15. melvin-bot commented on Oct 3, 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:

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

    @trjExpensify
    Contributor

    👋 Can we get this checklist filled out please to proceed with payments?

  17. narefyev91 commented on Oct 11, 2023

    @narefyev91
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR - it was revering PR flow
    • 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 - N/A
    • 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 - N/A
    • Determine if we should create a regression test for this bug - N/A
  18. trjExpensify commented on Oct 11, 2023

    @trjExpensify
    Contributor

    The PR that introduced the bug has been identified. Link to the PR - it was revering PR flow

    What does this mean? The PR that caused this bug has been identified and since reverted by its author, so it could have been linked here.

    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 - N/A

    I don't think this is "not applicable", this bug was a regression from somewhere, right? I think you're saying they are already aware of it because they authored the PR to revert it citing this bug.

    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 - N/A

    When answering "N/A" it would be good to expand just a little on why you think something is not applicable. I think that reason might be because the problem the original PR was solving is being prevented (deep linking to say the confirmation screen of a money request), so it's not something we need to "catch" going forward.

    Determine if we should create a regression test for this bug - N/A

    Same sentiment as above. I.e No need to add a regression test for a deep link flow that's not going to be possible anymore or something.

  19. trjExpensify commented on Oct 11, 2023

    @trjExpensify
    Contributor

    As for payments then, I think those are only as follows:

    1. @namhihi237 $50 for the bug report

    I've gone ahead and sent you an offer, @namhihi237!

  20. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 11, 2023
  21. namhihi237 commented on Oct 11, 2023

    @namhihi237
    Contributor

    @trjExpensify accepted thanks

  22. trjExpensify commented on Oct 11, 2023

    @trjExpensify
    Contributor

    Perfect, paid!

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