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] [$500] Web - 2 requests appears for few seconds on click of pay elsewhere button #26767

Closed
1 of 6 tasks
kbecciv opened this issue Sep 5, 2023 · 32 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Sep 5, 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. Go to chat with userB
  2. Click on + icon and select request money option
  3. Enter amount and click on request button
  4. From userB, click on pay elsewhere button

Expected Result:

It should not show 2 requests

Actual Result:

Requests appears for few seconds on click of pay elsewhere 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.63.0
Reproducible in staging?: y
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-05.at.12.28.39.PM.mov
Recording.4267.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ef8c662a1041de0d
  • Upwork Job ID: 1699362909149663232
  • Last Price Increase: 2023-09-13
  • Automatic offers:
    • s-alves10 | Contributor | 26670765
    • gadhiyamanan | Reporter | 26670766
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Sep 5, 2023
@OSBotify
Copy link
Contributor

OSBotify commented Sep 5, 2023

👋 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 5, 2023

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

@danieldoglas
Copy link
Contributor

I don't think this is a deploy blocker. cc @mountiny @luacmartins, what do you think?

@mountiny
Copy link
Contributor

mountiny commented Sep 5, 2023

@gadhiyamanan whats the 50units request in the LHN, that should not be there? How did it happen to show up?

I agree not a blocker

@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 5, 2023
@s-alves10
Copy link
Contributor

s-alves10 commented Sep 5, 2023

Proposal

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

2 requests appears for a few seconds on click pay-elsewhere button

What is the root cause of that problem?

This is a regression of this PR

When we pay the money request, payMoneyRequest function is called

In getPayMoneyRequestParams in this function, we get optimistic report preview action from ReportUtils.updateReportPreview

As you can see below, this function increases the childMoneyRequestCount by one as if we create a new money request

childMoneyRequestCount: reportPreviewAction.childMoneyRequestCount + 1,

This is the root cause

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

We should not increase the childMoneyRequestCount of report preview action for pay request.

  1. Add the parameter named requestIncrease to the updateReportPreview function
function updateReportPreview(iouReport, reportPreviewAction, requestIncrease = 1, comment = '', transaction = undefined) {
    ... ...
        childMoneyRequestCount: reportPreviewAction.childMoneyRequestCount + requestIncrease,
}
  1. Add this parameter to all the function call
    reportPreviewAction = ReportUtils.updateReportPreview(iouReport, reportPreviewAction, comment, optimisticTransaction);
        reportPreviewAction = ReportUtils.updateReportPreview(iouReport, reportPreviewAction, 1, comment, optimisticTransaction);

const optimisticReportPreviewAction = ReportUtils.updateReportPreview(iouReport, ReportActionsUtils.getReportPreviewAction(chatReport.reportID, iouReport.reportID));

    const optimisticReportPreviewAction = ReportUtils.updateReportPreview(iouReport, ReportActionsUtils.getReportPreviewAction(chatReport.reportID, iouReport.reportID), 0);

This works as expected

Result
26767.mp4

What alternative solutions did you explore? (Optional)

We can remove the childMoneyRequestCount increasing code from the updateReportPreview function and do this action at the calling function

@gadhiyamanan
Copy link
Contributor

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Sep 6, 2023
@melvin-bot melvin-bot bot changed the title Web - 2 requests appears for few seconds on click of pay elsewhere button [$500] Web - 2 requests appears for few seconds on click of pay elsewhere button Sep 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 6, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01ef8c662a1041de0d

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

melvin-bot bot commented Sep 6, 2023

Triggered auto assignment to @mallenexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 6, 2023

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

@eVoloshchak
Copy link
Contributor

Reviewing this today, apologies for the delay

@eVoloshchak
Copy link
Contributor

I agree with @s-alves10's assessment of the root cause
Instead of adding a requestIncrease param that is a number, I think we can add a boolean instead. There isn't a case where we need to increase the request count by 2 or more, so having a boolean would be more readable
But that can be ironed out during the PR stage, the general direction of the proposal looks good to me

🎀👀🎀 C+ reviewed!

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@mallenexpensify mallenexpensify self-assigned this Sep 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

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

Offer link
Upwork job

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 14, 2023
@s-alves10
Copy link
Contributor

@eVoloshchak

PR is ready for review

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

🎯 ⚡️ Woah @eVoloshchak / @s-alves10, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @s-alves10 got assigned: 2023-09-14 09:58:46 Z
  • when the PR got merged: 2023-09-19 01:50:05 UTC

On to the next one 🚀

@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 22, 2023
@melvin-bot melvin-bot bot changed the title [$500] Web - 2 requests appears for few seconds on click of pay elsewhere button [HOLD for payment 2023-09-29] [$500] Web - 2 requests appears for few seconds on click of pay elsewhere button Sep 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@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

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 melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 29, 2023
@mallenexpensify
Copy link
Contributor

@gadhiyamanan and @s-alves10 , can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~01ef8c662a1041de0d

@eVoloshchak plz fill out the checklst steps, not sure why it didn't auto-post here

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:

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

@gadhiyamanan
Copy link
Contributor

@mallenexpensify applied, thanks!

@s-alves10
Copy link
Contributor

@mallenexpensify
Accepted the offer. Thanks

@eVoloshchak
Copy link
Contributor

This is a regression of #26603

@s-alves10, could you elaborate on this more, please? I'm not too sure this is the PR that caused this, I think it was #23651, but would appreciate it if you expand on why you think it was #26603

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@s-alves10
Copy link
Contributor

@eVoloshchak

Yes, you're right. I was wrong

@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Show comment/requests in report preview #23651
  • 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: https://github.com/Expensify/App/pull/23651/files#r1342685354ё
  • 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: I don't think an additional discussion is needed, there isn't much we could do besides automated testing
  • Determine if we should create a regression test for this bug.
    Is it easy to test for this bug? Yes
    Is the bug related to an important user flow? Yes
    Is it an impactful bug? No
    This isn't very impactful, but it's related to core functionality and fairly easy to test, so I think regression test is worth adding

@eVoloshchak
Copy link
Contributor

Regression Test Proposal

  1. Open the App and log in with any account (user A)
  2. Go to chat with user B
  3. Send a money request to user B
  4. From user B, click on Pay elsewhere
  5. Verify that there is only one request, a second request doesn't appear for a brief period of time

Do we agree 👍 or 👎

@mallenexpensify
Copy link
Contributor

Issue reporter: @gadhiyamanan paid $50 via Upwork
Contributor: @s-alves10 paid $750 via Upwork, includes urgency bonus
Contributor+: @eVoloshchak is due $750 via NewDot

Thanks @eVoloshchak for test steps - https://github.com/Expensify/Expensify/issues/322548

@eVoloshchak
Copy link
Contributor

Requested the payment via NewDot
I did that a couple of days ago, but can't see the payment request after signing out and signing back in, so re-requesting.
Please verify there isn't a duplicate payment request

@JmillsExpensify
Copy link

$750 payment approved for @eVoloshchak based on BZ summary.

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

No branches or pull requests

10 participants