Skip to content

[Due for payment 2025-04-25] [$250] Reports - Report title changes from "x owes y" to "IOU" after holding the expense #59497

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

Closed
8 tasks done
vincdargento opened this issue Apr 1, 2025 · 17 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@vincdargento
Copy link

vincdargento commented Apr 1, 2025

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


Version Number: 9.1.22-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. [User A] Submit two expenses to User B.
  3. [User B] Go to Reports > Expense Reports.
  4. [User B] Select one of the expenses via checkbox.
  5. [User B] Click on the dropdown > Hold.
  6. [User B] Enter reason and save it.

Expected Result:

The report title will not change after holding the expense.

Actual Result:

The report title changes from "x owes y" to "IOU" after holding the expense.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021907426079430027656
  • Upwork Job ID: 1907426079430027656
  • Last Price Increase: 2025-04-02
  • Automatic offers:
    • mkzie2 | Contributor | 106850553
Issue OwnerCurrent Issue Owner: @OfstadC
@vincdargento vincdargento added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Apr 1, 2025
Copy link

melvin-bot bot commented Apr 1, 2025

Triggered auto assignment to @OfstadC (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@mkzie2
Copy link
Contributor

mkzie2 commented Apr 2, 2025

Proposal

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

The report title changes from "x owes y" to "IOU" after holding the expense.

What is the root cause of that problem?

We will return reportItem.reportName if the action isn't one of ['view', 'pay', 'paid'].

if (reportItem.action === CONST.SEARCH.ACTION_TYPES.VIEW || reportItem.action === CONST.SEARCH.ACTION_TYPES.PAY) {
return translateLocal('iou.payerOwesAmount', {
payer: payerName,
amount: formattedAmount,
});
}
if (reportItem.action === CONST.SEARCH.ACTION_TYPES.PAID) {
return translateLocal('iou.payerPaidAmount', {
payer: payerName,
amount: formattedAmount,
});
}
return reportItem.reportName;

If we hold one transaction, the action returns review, and then the default name appears.

if (shouldShowReview) {
return CONST.SEARCH.ACTION_TYPES.REVIEW;
}

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

For iou report, we can remove the return reportItem.reportName and only return paid name if the action is paid, otherwise return x owes y.

function getIOUReportName(data: OnyxTypes.SearchResults['data'], reportItem: SearchReport) {
    const payerPersonalDetails = reportItem.managerID ? data.personalDetailsList?.[reportItem.managerID] : emptyPersonalDetails;
    const payerName = payerPersonalDetails?.displayName ?? payerPersonalDetails?.login ?? translateLocal('common.hidden');
    const formattedAmount = convertToDisplayString(reportItem.total ?? 0, reportItem.currency ?? CONST.CURRENCY.USD);

    if (reportItem.action === CONST.SEARCH.ACTION_TYPES.PAID) {
        return translateLocal('iou.payerPaidAmount', {
            payer: payerName,
            amount: formattedAmount,
        });
    }

    return translateLocal('iou.payerOwesAmount', {
        payer: payerName,
        amount: formattedAmount,
    });
}

if (shouldShowReview) {
return CONST.SEARCH.ACTION_TYPES.REVIEW;
}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Update the result test with the case the action is review and verify that the reportName if iou report is correct.

What alternative solutions did you explore? (Optional)

Or we can add review case here.

if (reportItem.action === CONST.SEARCH.ACTION_TYPES.VIEW || reportItem.action === CONST.SEARCH.ACTION_TYPES.PAY) {
return translateLocal('iou.payerOwesAmount', {
payer: payerName,
amount: formattedAmount,
});
}

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@OfstadC OfstadC added the External Added to denote the issue can be worked on by a contributor label Apr 2, 2025
@melvin-bot melvin-bot bot changed the title Reports - Report title changes from "x owes y" to "IOU" after holding the expense [$250] Reports - Report title changes from "x owes y" to "IOU" after holding the expense Apr 2, 2025
Copy link

melvin-bot bot commented Apr 2, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 2, 2025
Copy link

melvin-bot bot commented Apr 2, 2025

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

@OfstadC
Copy link
Contributor

OfstadC commented Apr 2, 2025

I'll be OoO through next Monday - so if you need a BZ to take time sensitive action @rayane-d please re-add the bug label. Otherwise i'll check back in on Tuesday 😃

Copy link

melvin-bot bot commented Apr 8, 2025

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

@melvin-bot melvin-bot bot added the Overdue label Apr 8, 2025
@rayane-d
Copy link
Contributor

rayane-d commented Apr 8, 2025

The proposal sounds good to me. Will test it later today

@melvin-bot melvin-bot bot removed the Overdue label Apr 8, 2025
@rayane-d
Copy link
Contributor

rayane-d commented Apr 9, 2025

@mkzie2's proposal looks good to me

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Apr 9, 2025

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

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

melvin-bot bot commented Apr 9, 2025

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@JS00001
Copy link
Contributor

JS00001 commented Apr 9, 2025

@mkzie2 LGTM, please create a PR for the changes whenever you get the chance. Thank you!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Apr 10, 2025
@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 18, 2025
@melvin-bot melvin-bot bot changed the title [$250] Reports - Report title changes from "x owes y" to "IOU" after holding the expense [Due for payment 2025-04-25] [$250] Reports - Report title changes from "x owes y" to "IOU" after holding the expense Apr 18, 2025
Copy link

melvin-bot bot commented Apr 18, 2025

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 18, 2025
Copy link

melvin-bot bot commented Apr 18, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.29-10 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 2025-04-25. 🎊

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

Copy link

melvin-bot bot commented Apr 18, 2025

@rayane-d @OfstadC @rayane-d The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@rayane-d
Copy link
Contributor

rayane-d commented Apr 23, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: fix: report title is incorrect for IOU grouped expense in search page #47029 (comment)

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue: https://github.com/Expensify/Expensify/issues/494110

Regression Test Proposal

Precondition:

  • N/A

Test:

  1. [User A] Submit two IOUs to User B in DM.
  2. [User B] Go to Reports > Expense Reports.
  3. [User B] Verify that the report containing the two expenses is displayed with a "x owes y" name.
  4. [User B] Select one of the expenses via checkbox.
  5. [User B] Click on the dropdown > Hold.
  6. [User B] Enter reason and save it.
  7. [User B] Verify the report title does not change to "IOU" (it should remain "x owes y")
  8. [User B] Change the status of the report between 'view', 'review', 'submit', 'approve', 'pay'
  9. [User B] Verify the report title remains "x owes y"
  10. [User B] Change the status of the report to 'paid'
  11. [User B] Verify the report title changes to "x paid y"

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 25, 2025
@OfstadC
Copy link
Contributor

OfstadC commented Apr 25, 2025

Payment Summary

@OfstadC OfstadC closed this as completed Apr 25, 2025
@garrettmknight
Copy link
Contributor

$250 approved for @rayane-d

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

No branches or pull requests

6 participants