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

IOU - User B can't request money to user A inside the IOU report user A created #28816

Closed
6 tasks done
lanitochka17 opened this issue Oct 4, 2023 · 6 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 4, 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!


Issue found when executing PR #28542

Action Performed:

Pre-requisite: user must be logged in with 2 different accounts

  1. As user A, go to user B chat
  2. Request money to user B
  3. Go to the IOU report that got created
  4. Make another money request in the IOU report
  5. As user B, got to the IOU report that user A created
  6. Click on "+" button

Expected Result:

There should be and option to request money

Actual Result:

As user B, there is no "Request money" option in the IOU report that user A created

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.77-2

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug6224616_1696425348028.bandicam_2023-10-03_17-00-28-063.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

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

@melvin-bot
Copy link

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

@c3024
Copy link
Contributor

c3024 commented Oct 4, 2023

Proposal

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

User B is not shown "Request Money" option in an IOU report of User A's request for money from B

What is the root cause of that problem?

Here we remove the current user from the participants

const reportParticipantIDs = useMemo(
() => _.without(lodashGet(report, 'participantAccountIDs', []), currentUserPersonalDetails.accountID),
[currentUserPersonalDetails.accountID, report],
);

For an IOU report created, the ownerAccountID is the requestor and the participantIDs are the requested people.
In this case, for User B, they are the only participant and removing the current user that is user B leaves no participants and this here

App/src/libs/ReportUtils.js

Lines 3380 to 3386 in ab821e5

return [
...(canRequestMoney(report, participants) ? [CONST.IOU.MONEY_REQUEST_TYPE.REQUEST] : []),
// Send money option should be visible only in DMs
...(Permissions.canUseIOUSend(betas) && isChatReport(report) && !isPolicyExpenseChat(report) && hasSingleParticipantInReport ? [CONST.IOU.MONEY_REQUEST_TYPE.SEND] : []),
];
}

does not return "Request Money" option

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

We should change this here

() => _.without(lodashGet(report, 'participantAccountIDs', []), currentUserPersonalDetails.accountID),

to something like this

() => _.without([...lodashGet(report, 'participantAccountIDs', []), report?.ownerAccountID], currentUserPersonalDetails.accountID),

What alternative solutions did you explore? (Optional)

Result
Screen.Recording.2023-10-04.at.9.14.48.PM.mov

@mountiny mountiny self-assigned this Oct 4, 2023
@mountiny mountiny added the Reviewing Has a PR in review label Oct 4, 2023
@mountiny
Copy link
Contributor

mountiny commented Oct 4, 2023

This is waiting for backend PR to be deployed https://github.com/Expensify/Auth/pull/8827

@sophiepintoraetz
Copy link
Contributor

@mountiny - I'm headed OOO from today - I checked the PR and it looks like no reviewer payment is due here. Neither was it reported so I believe there is no BZ action to be taken here? If so, then please can you close or unassign me from this issue?

@mountiny
Copy link
Contributor

mountiny commented Oct 5, 2023

This is now fixed in staging, closing

@mountiny mountiny closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

4 participants