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-29] [HOLD for payment 2023-09-27] IOU - RHP does not disappear after sending a request money #27724

Closed
5 of 6 tasks
lanitochka17 opened this issue Sep 18, 2023 · 22 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 18, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Log in with any account
  3. Click on FAB
  4. Select "Request money."
  5. Complete the creation of an IOU with a user with whom there is no history of conversation
  6. Go to the conversation with the user to whom you sent the IOU
  7. Click Action menu
  8. Select "Request money" and complete it with any amount of money

Expected Result:

The RHP should close and the user should get into a conversation with the user to whom the IOU was sent

Actual Result:

RHP does not close after the IOU is completed

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

Reproducible in staging?: Yes

Reproducible in production?: No

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

Bug6205460_Recording__336.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 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

@OSBotify
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

Auto-assign attempt failed, all eligible assignees are OOO.

@jeet-dhandha
Copy link
Contributor

Proposal

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

  • On Requesting Money the page is navigating back to Manual Request page instead of report page.

What is the root cause of that problem?

  • Here in MoneyRequestConfirmPage.js the conditions
    • _.isEmpty(props.iou.participants)
    • props.iou.amount === 0 && !props.iou.receiptPath && !isDistanceRequest
      are getting true which in turn is calling goBack() function which is navigating back to Manual Request page instead of report page.

if (_.isEmpty(props.iou.participants) || (props.iou.amount === 0 && !props.iou.receiptPath && !isDistanceRequest) || shouldReset) {
Navigation.goBack(ROUTES.getMoneyRequestRoute(iouType.current, reportID.current), true);
}

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

  • We can add a ref navigatingBack and set it true when we call requestMoney function.

const requestMoney = useCallback(

  • And we can add a check if (!navigatingBack.current) in the conditions.
if (!navigatingBack.current && (_.isEmpty(props.iou.participants) || (props.iou.amount === 0 && !props.iou.receiptPath && !isDistanceRequest) || shouldReset)) {
    Navigation.goBack(ROUTES.getMoneyRequestRoute(iouType.current, reportID.current), true);
}

What alternative solutions did you explore? (Optional)

  • N/A

@DylanDylann
Copy link
Contributor

Proposal

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

RHP does not disappear after sending a request money

What is the root cause of that problem?

Let's see here

App/src/libs/actions/IOU.js

Lines 650 to 652 in 5150f86

resetMoneyRequestInfo();
Navigation.dismissModal(isMoneyRequestReport ? report.reportID : chatReport.reportID);
Report.notifyNewAction(chatReport.reportID, payeeAccountID);

When requesting money, we clear the field on ONYX before dismissing the modal.

And in here

if (_.isEmpty(props.iou.participants) || (props.iou.amount === 0 && !props.iou.receiptPath && !isDistanceRequest) || shouldReset) {

Because we clear the field before dismissing the modal, this logic will be triggered. It causes wrong navigation.

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

App/src/libs/actions/IOU.js

Lines 650 to 652 in 5150f86

resetMoneyRequestInfo();
Navigation.dismissModal(isMoneyRequestReport ? report.reportID : chatReport.reportID);
Report.notifyNewAction(chatReport.reportID, payeeAccountID);

In here, we should dismiss modal before clear iou field

if (_.isEmpty(props.iou.participants) || (props.iou.amount === 0 && !props.iou.receiptPath && !isDistanceRequest) || shouldReset) {

And in here we should check if modal.isVisible === false we will return that useEffect like that

useEffect(() => {
        const initialModalState = getModalState();
        if (!initialModalState.isVisible) {
            return;
        }

What alternative solutions did you explore? (Optional)

@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 19, 2023

@laurenreidexpensify This issue is blocking other issues that relate to IOU. Could you prioritize taking a look at this?

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

Triggered auto assignment to @AndrewGable (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@laurenreidexpensify
Copy link
Contributor

The automation failed to assign an engineer here so have re-added.

@AndrewGable
Copy link
Contributor

@jeet-dhandha and @DylanDylann - Trying to figure out which PR introduced this recently, if you have any leads that would be helpful!

@AndrewGable
Copy link
Contributor

I can reproduce on staging, I cannot reproduce on production so this does seem like something we introduced recently.

@AndrewGable
Copy link
Contributor

Interestingly, I cannot reproduce on main, so I do wonder if this has already been fixed..?

@AndrewGable
Copy link
Contributor

I can't tell if main is actually not triggering the bug or not as I cannot reproduce locally on the staging branch

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 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.

@DylanDylann
Copy link
Contributor

Can't reproduce now

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Sep 19, 2023
@AndrewGable AndrewGable removed the DeployBlockerCash This issue or pull request should block deployment label Sep 20, 2023
@AndrewGable
Copy link
Contributor

AndrewGable commented Sep 20, 2023

The regression was introduced in #26854 and this was fixed by @aimane-chnaif in #27793

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 20, 2023
@melvin-bot melvin-bot bot changed the title IOU - RHP does not disappear after sending a request money [HOLD for payment 2023-09-27] IOU - RHP does not disappear after sending a request money Sep 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.71-12 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-27. 🎊

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

melvin-bot bot commented Sep 20, 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:

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Sep 22, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-09-27] IOU - RHP does not disappear after sending a request money [HOLD for payment 2023-09-29] [HOLD for payment 2023-09-27] IOU - RHP does not disappear after sending a request money Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-29. 🎊

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

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

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

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. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants