Repository navigation
Description
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: 9.1.70-6
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): jsidojnsdoisjoid2893@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Money Requests
Action Performed:
- Go to staging.expensify.com
- Create a report with two expenses with negative amount.
- Log in to staging.new.expensify.com with the same account.
- Go to workspace chat.
- Open the expense report from Step 2.
- Click More > Delete.
- Delete the report.
- Go to self DM and open one of the unreported expenses.
- The unreported expense does not retain its negative sign in the amount.
- Open the same unreported expense on Old Dot.
- On Old Dot, the same unreported expense retains its negative sign in the amount.
- Go back to workspace chat on ND.
- Click + > Create report.
- Click Add expense > Add unreported expense.
- Select any unreported expense from Step 8.
- Click Add to report.
- Open the expense preview.
- The negative sign in the amount resurfaces after adding the unreported expense to a report.
Expected Result:
In Step 9, after moving expense with negative amount to self DM, the negative sign should be retained.
Actual Result:
In Step 9, after moving expense with negative amount to self DM, the negative sign is not retained.
In Step 11, the same unreported expense shows negative sign on Old Dot, but not on New Dot.
In Step 18, after adding the unreported expense to a report, the negative sign reappears.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Bug6868380_1750766455131.20250624_195220.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021938305495880593613
- Upwork Job ID: 1938305495880593613
- Last Price Increase: 2025-07-03
- Automatic offers:
- thelullabyy | Contributor | 107992969
Issue Owner
Current Issue Owner: @clarajones-expensifyMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Jun 24, 2025
Triggered auto assignment to @clarajones-expensify (
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.melvin-bot commentedon Jun 26, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021938305495880593613
[-]Expense - Negative sign disappears after moving expense with negative sign to self DM[/-][+][$250] Expense - Negative sign disappears after moving expense with negative sign to self DM[/+]melvin-bot commentedon Jun 26, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 (
External)thelullabyy commentedon Jun 27, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Step 9, after moving expense with negative amount to self DM, the negative sign is not retained.
In Step 11, the same unreported expense shows negative sign on Old Dot, but not on New Dot.
In Step 18, after adding the unreported expense to a report, the negative sign reappears.
What is the root cause of that problem?
The amount of selfDM's transaction has the same pattern with the amount of expense report's transaction
App/src/libs/ReportUtils.ts
Line 3973 in 04414ea
But we always return the positive amount if the transaction is not from expense report or it comes from tracked expense
App/src/libs/TransactionUtils/index.ts
Lines 563 to 658 in 04414ea
What changes do you think we should make in order to solve the problem?
For the tracked expense, we should return the amount with the same pattern as the expense report's transaction. We should update this condition to
App/src/libs/TransactionUtils/index.ts
Lines 563 to 658 in 04414ea
Because we can check the unreported transaction via
transaction.reportID, I suggest we can removeisFromTrackedExpenseparam and check this internally ingetAmountfunctionIf we still want to keep this parameter, we should pass this parameter when we get the amount here and other places that we want to get the real amount instead of a positive amount
App/src/libs/ReportUtils.ts
Line 3973 in 04414ea
App/src/libs/TransactionUtils/index.ts
Lines 410 to 414 in f660f73
App/src/libs/TransactionUtils/index.ts
Line 479 in f660f73
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Update
getAmountunit test to verify that this function returns the correct amount for unreported transaction.What alternative solutions did you explore? (Optional)
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.
ikevin127 commentedon Jun 28, 2025
Thanks for the proposal !
Looking at PR #38709 which introduced this logic:
and from the PR description I wasn't able to find anything related to our issue, so I asked on the PR what was the purpose of adding
|| isFromTrackedExpensebecause it's causing our issue, asked whether it's expected behaviour or we can change that logic without breaking things their PR implemented.30 remaining items
melvin-bot commentedon Jul 21, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jul 21, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.83-5 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-07-28. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 21, 2025
@youssef-lr @clarajones-expensify @ikevin127 / @thelullabyy 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]
clarajones-expensify commentedon Jul 21, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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:
[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:
[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.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
clarajones-expensify commentedon Jul 21, 2025
Hi @ikevin127 ! Would you fill out the above checklist? Thank you
ikevin127 commentedon Jul 22, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: No specific offending PR, this became an issue because over time the app evolved and new features were added (e.g. moving deleted report expenses to selfDM).
[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:
Regression Test Proposal
Do we agree 👍 or 👎.
clarajones-expensify commentedon Jul 28, 2025
payment summary
C+: @ikevin127 requires $250 through NewDot Manual Requests
Contributor: @thelullabyy paid $250 via upwork job
trjExpensify commentedon Jul 29, 2025
Approved $250 for @ikevin127.