You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-11-18] [$250] Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later #73389
Remove negative sign from first split by keeping cursor on first split
10.Note the text above save button mentioning total is less than original amount
Tap save
Expected Result:
Step 10 : The text above the save button is incorrect. It should say 'Total amount is 4.01 greater than the original expense,' and the user should not be able to split the expense.
Actual Result:
Step 10 : The text above the save button is displayed as 'Total amount is 3.99 less than the original expense' . Even though the correct total amount is 4.01, which is actually greater than the original expense.
Error displayed after click save button in Step 11 :
The sum of split amounts exceeds the original amount
Unexpected error submitting this expense. Please try again later.
Please re-state the problem that we are trying to solve in this issue.
Step 10 : The text above the save button is displayed as 'Total amount is 3.99 less than the original expense' . Even though the correct total amount is 4.01, which is actually greater than the original expense.
What is the root cause of that problem?
We’ve always taken the absolute value of transactionDetailsAmount, which causes the warning message to show a smaller amount than the actual value.
What changes do you think we should make in order to solve the problem?
Remove Math.abs from transactionDetailsAmount.
Add a warningMessage for the totalAmountGreaterThanOriginal case.
When totalAmountGreaterThanOriginal is true, we should disable the Save button.
changed the title [-]Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later[/-][+][$250] Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later[/+]on Oct 24, 2025
Please re-state the problem that we are trying to solve in this issue.
Step 10 : The text above the save button is displayed as 'Total amount is 3.99 less than the original expense' . Even though the correct total amount is 4.01, which is actually greater than the original expense.
What is the root cause of that problem?
sumOfSplitExpenses isn't calculated correctly. We're calculating the total of the absolute amount value
Remove all Math.abs usages on SplitExpensePage when comparing/calculating the difference on SplitExpensePage
We don't need to disable the confirm button since the greater than error will appear when we click on this button with the fix above
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
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.
@mkzie2's proposal looks good.
Split amount input currently doesn't support negative value input. I think we should fix this as well.
🎀 👀 🎀 C+ reviewed
changed the title [-][$250] Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later[/-][+][Due for payment 2025-11-18] [$250] Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later[/+]on Nov 11, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.48-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@aimane-chnaif@sakluger 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]
[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 regression but missing case which was not considered while implementing split negative expense
[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.
[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
Test:
Create a manual expense for negative amount
Open the expense details of transaction
Tap more - split expense
Remove the second split
Add a split
Change amount to 0.01
Remove negative sign from first split by keeping cursor on first split
Verify that: The error message shows correct calculated amount
Activity
melvin-bot commentedon Oct 24, 2025
Triggered auto assignment to @sakluger (
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.dmkt9 commentedon Oct 24, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Step 10 : The text above the save button is displayed as 'Total amount is 3.99 less than the original expense' . Even though the correct total amount is 4.01, which is actually greater than the original expense.
What is the root cause of that problem?
We’ve always taken the absolute value of
transactionDetailsAmount, which causes the warning message to show a smaller amount than the actual value.App/src/pages/iou/SplitExpensePage.tsx
Lines 299 to 302 in 302280e
What changes do you think we should make in order to solve the problem?
Remove
Math.absfromtransactionDetailsAmount.Add a
warningMessagefor thetotalAmountGreaterThanOriginalcase.When
totalAmountGreaterThanOriginalis true, we should disable the Save button.App/src/pages/iou/SplitExpensePage.tsx
Lines 299 to 302 in 302280e
App/src/pages/iou/SplitExpensePage.tsx
Line 316 in 302280e
If we don’t disable the Save button, we can remove Math.abs here to show the error message upon submission:
App/src/pages/iou/SplitExpensePage.tsx
Lines 142 to 146 in 302280e
What alternative solutions did you explore? (Optional)
[-]Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later[/-][+][$250] Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later[/+]melvin-bot commentedon Oct 24, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021981750828087713524
melvin-bot commentedon Oct 24, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (
External)mkzie2 commentedon Oct 24, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Step 10 : The text above the save button is displayed as 'Total amount is 3.99 less than the original expense' . Even though the correct total amount is 4.01, which is actually greater than the original expense.
What is the root cause of that problem?
sumOfSplitExpensesisn't calculated correctly. We're calculating the total of the absolute amount valueApp/src/pages/iou/SplitExpensePage.tsx
Line 87 in 56763a0
App/src/pages/iou/SplitExpensePage.tsx
Line 142 in 56763a0
App/src/pages/iou/SplitExpensePage.tsx
Line 299 in 56763a0
What changes do you think we should make in order to solve the problem?
Math.abswhen calculating thesumOfSplitExpenseshereApp/src/pages/iou/SplitExpensePage.tsx
Line 87 in 56763a0
Math.absusages onSplitExpensePagewhen comparing/calculating the difference on SplitExpensePageWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
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.
aimane-chnaif commentedon Oct 26, 2025
@mkzie2's proposal looks good.
Split amount input currently doesn't support negative value input. I think we should fix this as well.
🎀 👀 🎀 C+ reviewed
16 remaining items
[-][$250] Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later[/-][+][Due for payment 2025-11-18] [$250] Expense-Total amount of the split expenses is displayed incorrectly and an error occurs later[/+]melvin-bot commentedon Nov 11, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 11, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.48-1 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-11-18. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 11, 2025
@aimane-chnaif @sakluger 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]
sakluger commentedon Nov 19, 2025
Payment Summary
Contributor: @mkzie2 $250 via Upwork: Paid
Contributor+: @aimane-chnaif $250 via Upwork
aimane-chnaif commentedon Nov 19, 2025
BugZero Checklist:
[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 regression but missing case which was not considered while implementing split negative expense
[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.
[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
Test:
Do we agree 👍 or 👎
sakluger commentedon Nov 19, 2025
Thanks! I updated the payment summary.
aimane-chnaif commentedon Nov 19, 2025
@sakluger I haven't got payment yet.
sakluger commentedon Nov 21, 2025
Sorry @aimane-chnaif, that was my bad. All paid now. Thank you for the bump!