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-10-10] [$500] Dev - Request Money - Manual request money Infinity loading after login #28280

Closed
6 tasks done
kbecciv opened this issue Sep 26, 2023 · 20 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 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Sep 26, 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. 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
@kbecciv kbecciv 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 Sep 26, 2023
@melvin-bot melvin-bot bot changed the title Dev - Request Money - Manual request money Infinity loading after login [$500] Dev - Request Money - Manual request money Infinity loading after login Sep 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

Job added to Upwork: https://www.upwork.com/jobs/~017e5ca352b532b8bd

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

melvin-bot bot commented Sep 26, 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
Copy link

melvin-bot bot commented Sep 26, 2023

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

@kbecciv
Copy link
Author

kbecciv commented Sep 26, 2023

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

@studentofcoding
Copy link
Contributor

studentofcoding commented Sep 27, 2023

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

@narefyev91
Copy link
Contributor

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

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

@studentofcoding
Copy link
Contributor

Proposal from @namhihi237 looks good to me #28280 (comment)

🎀 👀 🎀 C+ reviewed

Could I ask why @narefyev91? as from what I see the Solution on @namhihi237 proposal is not clear

@situchan
Copy link
Contributor

As this is within regression period, original author/reviewer could take this.
cc: @tienifr @allroundexperts

@narefyev91
Copy link
Contributor

narefyev91 commented Sep 28, 2023

@Gonals Based on comment from @tgolen here https://github.com/Expensify/App/pull/25786/files/ecb657b4ecafe42d4c34537adf1ba90b3a01f94b#r1339409911 - the PR which introduced regression may be reverted and contributor who works on the issue should take care of this regression (re-work on initial issue and resolve this regression as well). But also @tgolen pointed good item #26538 - that we can wait his code changes
I will say that we can put on hold for now until this #24393 - will be closed

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Sep 28, 2023
@melvin-bot melvin-bot bot 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 Oct 3, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 3, 2023

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

@melvin-bot
Copy link

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

  • [@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:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 10, 2023
@trjExpensify
Copy link
Contributor

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

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

@trjExpensify
Copy link
Contributor

trjExpensify commented Oct 11, 2023

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.

@trjExpensify
Copy link
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!

@trjExpensify trjExpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 11, 2023
@namhihi237
Copy link
Contributor

@trjExpensify accepted thanks

@trjExpensify
Copy link
Contributor

Perfect, paid!

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

No branches or pull requests

7 participants