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
[HOLD for payment 2025-02-04] [$250] Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error #54471
Version Number: v9.0.77-6 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A 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): N/A Issue reported by: Applause Internal Team
Action Performed:
Navigate to staging.new.expensify.com.
[User A] Request money from User B.
[User A] Open IOU details page > Click Amount.
[User B] Pay the request.
[User A] Enter a new amount and save it.
[User A] Close the error message.
Expected Result:
The amount in IOU details page should revert to the original amount after closing the error message (as in PR #32898)
Actual Result:
The amount in IOU details page does not revert to the original amount after closing the error message. It only reverts after refreshing the app.
We can check if getUpdateTrackExpenseParams has the same problem and fix it
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We must create a unit test for one of the update money request APIs, making the request fail. After that we need to verify the transaction data is reverted to the original value before the API is called.
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.
What changes do you think we should make in order to solve the problem?
Create a new function for the clearError prop, over here, to revert the transaction data to the previous values depending on which field was attempted to change while calling Transaction.clearError.
We will revert the transaction values from the report's modified Expense action originalMessage.
clearError={
(transactionID) => {
// Revert the transaction values from reportAction.originalMessage
Transaction.clearError(transactionID)
}
}
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Create a unit test for the new function to check if it can restore the previous values of the transaction even with different changes.
What alternative solutions did you explore? (Optional)
Let's update the failureData and add the previous values of the transaction, in this case, the amount, modified amount, etc...
changed the title [-]Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error[/-][+][$250] Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error[/+]on Dec 24, 2024
Thanks for the proposals, everyone.
Both proposals make sense to me.
As described in the expected result, we should revert the edited amount after closing error message. Because of that I'm aligned with @Tony-MK 's proposal.
changed the title [-][$250] Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error[/-][+][HOLD for payment 2025-02-04] [$250] Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error[/+]on Jan 28, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@hungvu193@bfitzexpensify@hungvu193 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]
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: I can't really find the offending PR of this issue, we can consider this is an improvement to the request money flow.
[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.
Test:
Navigate to staging.new.expensify.com.
[User A] Request money from User B.
[User A] Open the IOU details page > Click Amount.
[User B] Pay the request.
[User A] Enter a new amount and save it.
[User A] Close the error message.
Verify that the amount will be reverted to the old amount.
Activity
melvin-bot commentedon Dec 23, 2024
Triggered auto assignment to @bfitzexpensify (
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 commentedon Dec 23, 2024
Edited by proposal-police: This proposal was edited at 2024-12-23 19:30:42 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
The amount in IOU details page does not revert to the original amount after closing the error message. It only reverts after refreshing the app.
What is the root cause of that problem?
We only update the pending field and error field of transactions in
failureData. Then the updated data isn't reverted.App/src/libs/actions/IOU.ts
Lines 2992 to 3000 in 2458635
What changes do you think we should make in order to solve the problem?
We should revert to original transaction data and only override the pending field and error field. Or we can simply revert to
transactionOr
App/src/libs/actions/IOU.ts
Lines 2992 to 3000 in 2458635
We can check if
getUpdateTrackExpenseParamshas the same problem and fix itWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We must create a unit test for one of the update money request APIs, making the request fail. After that we need to verify the transaction data is reverted to the original value before the API is called.
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.
Tony-MK commentedon Dec 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - Edited amount for a paid request does not revert to paid amount when dismissing the error
What is the root cause of that problem?
We are not returning the transaction amount figure back to the original amount and will take the figure from
modifiedAmountsince it is not empty.App/src/pages/home/report/ReportActionItem.tsx
Line 79 in a6ea6a1
So, we any clear the errors but we don't revert the transaction changes.
App/src/libs/actions/Transaction.ts
Lines 460 to 462 in 2458635
What changes do you think we should make in order to solve the problem?
Create a new function for the
clearErrorprop, over here, to revert the transaction data to the previous values depending on which field was attempted to change while callingTransaction.clearError.We will revert the transaction values from the report's modified Expense action
originalMessage.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Create a unit test for the new function to check if it can restore the previous values of the transaction even with different changes.
What alternative solutions did you explore? (Optional)
Let's update the
failureDataand add the previous values of the transaction, in this case, the amount, modified amount, etc...[-]Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error[/-][+][$250] Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error[/+]melvin-bot commentedon Dec 24, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021871573512679466358
melvin-bot commentedon Dec 24, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (
External)hungvu193 commentedon Dec 25, 2024
Thanks for the proposals, everyone.
Both proposals make sense to me.
As described in the expected result, we should revert the edited amount after closing error message. Because of that I'm aligned with @Tony-MK 's proposal.
🎀👀🎀
43 remaining items
[-][$250] Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error[/-][+][HOLD for payment 2025-02-04] [$250] Expense - Edited amount for a paid request does not revert to paid amount when dismiss the error[/+]melvin-bot commentedon Jan 28, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 28, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 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-02-04. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 28, 2025
@hungvu193 @bfitzexpensify @hungvu193 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]
hungvu193 commentedon Feb 3, 2025
Both @Tony-MK and I tested and couldn't reproduce the bug you mentioned, so we decided to proceed with the PR. Thanks for your input anyway.
hungvu193 commentedon Feb 3, 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: I can't really find the offending PR of this issue, we can consider this is an improvement to the request money flow.
[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.
Test:
Do we agree 👍 or 👎
bfitzexpensify commentedon Feb 4, 2025
Payment summary:
@hungvu193 to be paid $250 through NewDot Manual Requests
@Tony-MK paid $250 via Upwork
garrettmknight commentedon Feb 11, 2025
$250 approved for @hungvu193