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 2024-05-06] [$250] [Held requests] Hold request link for the requestee shows "undefined" #37554

Closed
3 of 6 tasks
lanitochka17 opened this issue Feb 29, 2024 · 67 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 29, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.45-2
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. [User A] Request money from User B
  3. [User B] Navigate to request details page
  4. [User B] Click 3-dot menu > Hold request

Expected Result:

There will be no "undefined" in Hold request link

Actual Result:

Hold request link for the requestee shows "undefined"

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6397422_1709230911407.20240301_004031.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0166aa9b176af4b313
  • Upwork Job ID: 1766289313058312192
  • Last Price Increase: 2024-04-06
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 29, 2024
Copy link

melvin-bot bot commented Feb 29, 2024

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

@lanitochka17
Copy link
Author

@greg-schroeder FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@Pujan92
Copy link
Contributor

Pujan92 commented Feb 29, 2024

Proposal

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

Hold request reason link includes undefined

What is the root cause of that problem?

We are passing policy type here instead of the iouType and for a non-active policy it will be undefined empty after the TS migration PR. Due to that, it will form the incorrect route without iouType and lead to the not found page.
If we see the getRoute of the ROUTES.MONEY_REQUEST_HOLD_REASON it expects the first parameter should be the iouType not the policyType.

Navigation.navigate(ROUTES.MONEY_REQUEST_HOLD_REASON.getRoute(policy?.type ?? '', iouTransactionID, report?.reportID, activeRoute));

App/src/ROUTES.ts

Lines 301 to 304 in bae502e

MONEY_REQUEST_HOLD_REASON: {
route: ':iouType/edit/reason/:transactionID?',
getRoute: (iouType: string, transactionID: string, reportID: string, backTo: string) => `${iouType}/edit/reason/${transactionID}?backTo=${backTo}&reportID=${reportID}` as const,
},

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

Pass CONST.IOU.TYPE.REQUEST instead of policy?.type here to correct the iouType. We aren't using this route param value in the hold page but to be consistent with other routes we need to pass iouType.

@greg-schroeder
Copy link
Contributor

@melvin-bot melvin-bot bot added the Overdue label Mar 4, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

@greg-schroeder Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Mar 5, 2024

@greg-schroeder Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Mar 7, 2024

@greg-schroeder Huh... This is 4 days overdue. Who can take care of this?

@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Mar 9, 2024
Copy link

melvin-bot bot commented Mar 9, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0166aa9b176af4b313

@melvin-bot melvin-bot bot changed the title Hold request - Hold request link for the requestee shows "undefined" [$500] Hold request - Hold request link for the requestee shows "undefined" Mar 9, 2024
@greg-schroeder
Copy link
Contributor

Setting to External per team discussion

@melvin-bot melvin-bot bot added Help Wanted Apply this label when an issue is open to proposals by contributors and removed Overdue labels Mar 9, 2024
Copy link

melvin-bot bot commented Mar 9, 2024

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

@greg-schroeder greg-schroeder changed the title [$500] Hold request - Hold request link for the requestee shows "undefined" [$250] Hold request - Hold request link for the requestee shows "undefined" Mar 9, 2024
Copy link

melvin-bot bot commented Mar 9, 2024

Upwork job price has been updated to $250

@damadoko
Copy link

damadoko commented Mar 9, 2024

Proposal

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

Hold request reason link includes undefined

What is the root cause of that problem?

  • The policyID of a Chat report is created by the requestor's personal policyID (in the BE side).
  • Each account only has 1 personal policyID. That mean when the receiver open above report, the report policyID will not found in receiver's policy list, it will fallback to {}:
    const policy = policies[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`] || {};
  • That empty policy was passed to the navigate param, which cause the undefined value included in the link:
    Navigation.navigate(ROUTES.MONEY_REQUEST_HOLD_REASON.getRoute(policy?.type, parentReportAction?.originalMessage?.IOUTransactionID ?? '', report?.reportID, activeRoute));

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

I think we need to pass CONST.POLICY.TYPE.PERSONAL as the fallback value:

 Navigation.navigate(ROUTES.MONEY_REQUEST_HOLD_REASON.getRoute(policy?.type ?? CONST.POLICY.TYPE.PERSONAL, parentReportAction?.originalMessage?.IOUTransactionID ?? '', report?.reportID, activeRoute));

Because currently, we only have 4 type of policies, other type free, corporate, team are workspace's policy. Therefore, these policy type always available in both requester and receiver. This bug only happen in receiver side in P2P request money flow.

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Mar 11, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

@sobitneupane, @greg-schroeder Whoops! This issue is 2 days overdue. Let's get this updated quick!

@sobitneupane
Copy link
Contributor

In latest main, when I try to reproduce the issue, the app crashes. Is it related to this issue? Or is there any other open issue to resolve it?

Screen.Recording.2024-03-13.at.14.47.59.mov

@melvin-bot melvin-bot bot removed the Overdue label Mar 13, 2024
@bernhardoj
Copy link
Contributor

It shows not found page since this TS PR where it puts an empty string as the default value. There is an issue for that here, but basically they are the same issue.

@sobitneupane
Copy link
Contributor

@bernhardoj Do you mean #38345 issue and #37554 issue are same?

@bernhardoj
Copy link
Contributor

I would say they are the same and @Pujan92 solution will solve it.

Copy link

melvin-bot bot commented Mar 16, 2024

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

Copy link

melvin-bot bot commented Apr 12, 2024

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

@dangrous
Copy link
Contributor

Hi! I think this sounds good, but I'm going to take a little more time to confirm, since I just came back from leave and the Hold Request flow didn't exist when I left - so I have to get more familiar with it!

@greg-schroeder
Copy link
Contributor

Thanks @dangrous! Let us know if you need more eyes 👍

@dangrous
Copy link
Contributor

Okay, I think this makes sense to me! Thanks for your patience. I may have a couple questions along the way but let's move forward.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 16, 2024
Copy link

melvin-bot bot commented Apr 16, 2024

❌ There was an error making the offer to @GandalfGwaihir for the Contributor role. The BZ member will need to manually hire the contributor.

@allgandalf
Copy link
Contributor

PR Update: waiting on @dangrous to merge the PR, I Think he's OoO :)

@dangrous
Copy link
Contributor

Yep! I was out, looking at this shortly.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 29, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Held requests] Hold request link for the requestee shows "undefined" [HOLD for payment 2024-05-06] [$250] [Held requests] Hold request link for the requestee shows "undefined" Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 29, 2024
Copy link

melvin-bot bot commented Apr 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.67-7 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 2024-05-06. 🎊

For reference, here are some details about the assignees on this issue:

  • @sobitneupane requires payment through NewDot Manual Requests
  • @GandalfGwaihir requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Apr 29, 2024

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:

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

@sobitneupane
Copy link
Contributor

sobitneupane commented May 7, 2024

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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

#33897

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

#33897 (comment)

  • [@sobitneupane] 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:
  • [@sobitneupane] Determine if we should create a regression test for this bug.

Yes

  • [@sobitneupane] 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.

#37554 (comment)

@sobitneupane
Copy link
Contributor

Regression Test Proposal

  1. Login from one account
  2. Request money 1:1 with the same user 2 times
  3. Login from that other account to which you have requested money
  4. Open chat and navigate to any one of the money request by the previously logged in user.
  5. Hold the request
  6. Verify that you can successfully hold the request.

Do we agree 👍 or 👎

@greg-schroeder
Copy link
Contributor

Processing

@greg-schroeder
Copy link
Contributor

$250 - C+ - @sobitneupane - you can make a ND manual request for payment
$250 - C - @GandalfGwaihir - I've sent you a manual offer for this issue, can you please accept it in upwork? Thanks!

I'll now file the regression test.

@allgandalf
Copy link
Contributor

I've sent you a manual offer for this issue, can you please accept it in upwork? Thanks!

Have accepted the offer, thanks :)

@JmillsExpensify
Copy link

$250 approved for @sobitneupane

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
Archived in project
Development

No branches or pull requests