Skip to content

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

Closed

Description

@lanitochka17

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

Activity

  1. added
    Daily
    Bug
    on Oct 4, 2023
  2. melvin-bot commented on Oct 4, 2023

    @melvin-bot

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

  3. melvin-bot commented on Oct 4, 2023

    @melvin-bot

    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
  4. c3024 commented on Oct 4, 2023

    @c3024
    Contributor

    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
  5. self-assigned this
    on Oct 4, 2023
  6. added
    Reviewing
    on Oct 4, 2023
  7. mountiny commented on Oct 4, 2023

    @mountiny
    Contributor

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

  8. sophiepintoraetz commented on Oct 5, 2023

    @sophiepintoraetz
    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?

  9. mountiny commented on Oct 5, 2023

    @mountiny
    Contributor

    This is now fixed in staging, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyReviewing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions