-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix: changed the expense message appears when splitting expense and then reverting the split
#74660
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
Conversation
…deleting one split
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@dukenv0307 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
While working on this PR, I believe it's expected to see the New-Expensify-2.mp4If we reverse the split and set the remaining expense back to the original amount, we'd see the New-Expensify-2.mp4What do you think? @dukenv0307 |
|
@nyomanjyotisa I think it's the bug that we need to fix, because after resetting the cache and restart, this system message |
|
@dukenv0307 I'm not entirely sure, but we also see the same New-Expensify-2.mp4I wonder if we expect the |
|
If there's no amount change, we shouldn't show the If I split $100 into 2 expenses ($50 for each) Case 1: Delete one split without changing the amount of the second split -> should not show the system message Case 2: If we reverse the split and set the remaining expense back to the original amount -> we should show the |
|
@nyomanjyotisa If that's still unclear, you can raise the discusson on Slack and tag me. Thanks |
|
@dukenv0307 That makes sense, I understand your point. However, I think it would be helpful to get more insight on this. I'll raise a discussion on Slack, thanks for the feedback! |
|
@nyomanjyotisa Can you mention the Slack link here? |
|
@dukenv0307 Sorry for the late response, here is the link to the Slack thread |
|
Getting some extra opinions for the Slack thread |
|
@nyomanjyotisa any updates? |
Yes, because the amount of the expense has change from the original (pre split) amount and there isn't another expense that makes up the difference any more so I think this should behave the same as reducing the amount of a non split expense
I don't think we need to show anything here given the expense has returned to it's original state, meaning the amount hasn't changed (it is the pre split amount) and the expense isn't actually modified any more? Let me know if you agree/disagree/something eles? |
|
Thanks for the answer @heyjennahay, I'll take a look at this tomorrow |
changed the expense message appears when splitting expense and then reverting the split
|
@dukenv0307 I've updated the PR to remove the RCAWhen reverting a split operation (remove one of the split and set remaining expense back to its original amount), the
Lines 14156 to 14159 in 5375071
During the comparison loop, Lines 14166 to 14175 in 5375071
SolutionWe need to remove the if (isReverseSplitOperation) {
delete transactionChanges.transactionID;
}Lines 14166 to 14183 in 5375071
|
It already happened on main, so what is the RCA for? |
Yes, case 1 is the current behavior on main. The RCA is for case 2, where the |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-11-25.at.22.18.22.movAndroid: mWeb ChromeScreen.Recording.2025-11-25.at.22.11.36.moviOS: HybridAppScreen.Recording.2025-11-25.at.22.21.49.moviOS: mWeb SafariScreen.Recording.2025-11-25.at.22.10.10.movMacOS: Chrome / SafariScreen.Recording.2025-11-25.at.22.05.41.mov |
| } | ||
| } | ||
|
|
||
| if (isReverseSplitOperation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but I don't get why we delete transactionChanges.transactionID in this case, can you explain?
Also that was not the solution proposed in the proposal in the issue, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue solved in this PR is different from the original GH issue. It seems like the original GH issue is the expected behavior based on this comment. In this PR, we address case 2 from that comment to prevent showing any system message when user perform a reverse split and set the remaining expense back to its original amount
And then, we delete transactionChanges.transactionID when we reverse a split because the transactionID is different in this case. This causes the transactionID to remain in transactionChanges, and we get the "changed the expense" system message even when the user makes no change at all. I explained the detailed RCA and solution here
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.2.65-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.2.65-6 🚀
|
Explanation of Change
Fixed Issues
$ #74265
PROPOSAL: #74265 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Prerequisite:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android-Native.mp4
Android: mWeb Chrome
Android-mWeb.Chrome.mp4
iOS: Native
iOS-Native.mp4
iOS: mWeb Safari
iOS-mWeb.Safari.mp4
MacOS: Chrome / Safari
MacOS-Chrome.mp4
MacOS: Desktop
MacOS-Desktop.mp4