-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Distance - Total amount in report is not reset to 0.00 when changing distance request offline #36892
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01ed2116286bd18632 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ishpaul777 ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Triggered auto assignment to @madmax330 ( |
We think that this bug might be related to #wave5 |
ProposalPlease re-state the problem that we are trying to solve in this issue.The money request total is not changed when the waypoints are changed offline What is the root cause of that problem?This is a regression from #35880 – the conflict with What changes do you think we should make in order to solve the problem?First, we should move the total recalculation out of the if (!hasPendingWaypoints) {
params.reportActionID = updatedReportAction.reportActionID;
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThread?.reportID}`,
value: {
[updatedReportAction.reportActionID]: updatedReportAction as OnyxTypes.ReportAction,
},
});
successData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThread?.reportID}`,
value: {
[updatedReportAction.reportActionID]: {pendingAction: null},
},
});
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThread?.reportID}`,
value: {
[updatedReportAction.reportActionID]: {
...(updatedReportAction as OnyxTypes.ReportAction),
errors: ErrorUtils.getMicroSecondOnyxError('iou.error.genericEditFailureMessage'),
},
},
});
+ }
// Step 4: Compute the IOU total and update the report preview message (and report header) so LHN amount owed is correct.
let updatedMoneyRequestReport = {...iouReport};
const diff = calculateDiffAmount(iouReport, updatedTransaction, transaction);
if (ReportUtils.isExpenseReport(iouReport) && typeof updatedMoneyRequestReport.total === 'number') {
// For expense report, the amount is negative so we should subtract total from diff
updatedMoneyRequestReport.total -= diff;
} else {
updatedMoneyRequestReport = iouReport
? IOUUtils.updateIOUOwnerAndTotal(iouReport, updatedReportAction.actorAccountID ?? -1, diff, TransactionUtils.getCurrency(transaction), false, true)
: {};
}
updatedMoneyRequestReport.cachedTotal = CurrencyUtils.convertToDisplayString(updatedMoneyRequestReport.total, updatedTransaction?.modifiedCurrency);
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`,
value: updatedMoneyRequestReport,
});
successData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`,
value: {pendingAction: null},
});
- } Lines 1103 to 1155 in 0f409d4
Second, we should update the IOU.calculateDiffAmount function to allow the if (updatedCurrency === iouReport?.currency && updatedTransaction?.modifiedAmount !== undefined) {
// Calculate the diff between the updated amount and the current amount if we change the amount and the currency of the transaction is the currency of the report
return updatedAmount - currentAmount;
} Lines 1006 to 1009 in 0f409d4
What alternative solutions did you explore? (Optional) |
@paultsimura Can you please elaborate the root cause and solution or should i find it myself looking at large diffs mentioned |
You're right @ishpaul777 – updated it in the proposal |
@paultsimura Unfortunately you solution was not working for me, do you mind sharing a working branch if you have it handy? may be i am missing something |
Sure, will share within 2-3 hours - I'm afk at the moment |
@ishpaul777 here it is: #36960 Screen.Recording.2024-02-20.at.22.50.39-compressed.mp4 |
Thanks i'll take a look in my morning, but most probably this might be handled by Pr author as we won't deploy until Thursday. cc @dukenv0307 |
The PR to fix this issue here #37005 cc @cubuspl42 |
Taking over this issue to get the blocker fixed quickly |
Thank you! |
Issue not reproducible during KI retests. (First week) |
This should be ready for C+ payment @neil-marcellini Can you please remove reviewing label |
Triggered auto assignment to @twisterdotcom ( |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Payment Summary:
|
@twisterdotcom accepted offer 🙂 Thanks! |
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: 1.4.43-2
Reproducible in staging?: Y
Reproducible in production?: N
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
The total amount will change to 0.00 (PROD behavior)
Actual Result:
The total amount does not change to 0.00
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6385602_1708428297435.bandicam_2024-02-20_15-58-44-921.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: