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
[$500] IOU - No error message when changing amount of a paid request #33799
Version Number: v1.4.20-2 Reproducible in staging?: Y Reproducible in production?: Y 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:
[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.
Expected Result:
Error message "Unexpected error editing the money request, please try again later" will show up when editing the amount of a settled request.
Actual Result:
Error message does not show up.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-] IOU - No error message when changing amount of a paid request[/-][+][$500] IOU - No error message when changing amount of a paid request[/+]on Dec 30, 2023
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
The backend is returning the correct error message, however we don't expect it because we are not handling it in the MoneyRequestView.
What changes do you think we should make in order to solve the problem?
Get the errors from the errorFields and set it as the errors prop for the OfflineWithFeedback. The error message should not persist. Therefore, we can delete from the onyx once the user navigates away from the page or onClose. However, if we need them for later, we can also shouldShowErrorMessages if the latest error message is past a certain duration.
The expected result is weird to me, why would we tell the user an "unexpected error" occurs if it's expected that you cannot edit a settled amount? Why don't we just tell the user they cannot edit a settled amount if that is indeed expected?
Please re-state the problem that we are trying to solve in this issue.
No error message shown for updating the paid amount transaction
What is the root cause of that problem?
It seems the issue occurs after this PR where we have used a new method to update an amount. For the failure case we don't have any report action error entry which isn't showing any error.
@Pujan92 Thank you for the proposal, the root cause looks correct. I just retested with reverting #32533 and it's working as expected.
For the solution, it looks good to me, I believe we should add the failure data inside getUpdateMoneyRequestParams to fix the bug with other fields as well.
📣 @Pujan92 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
Activity
[-] IOU - No error message when changing amount of a paid request[/-][+][$500] IOU - No error message when changing amount of a paid request[/+]melvin-bot commentedon Dec 30, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01064a73e07695ea66
melvin-bot commentedon Dec 30, 2023
Triggered auto assignment to @MitchExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Dec 30, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Dec 30, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh (
External)neonbhai commentedon Dec 30, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
IOU - No error message when changing amount of a paid request
What is the root cause of that problem?
This happens as we don’t check if the request is paid before calling
IOU.updateMoneyRequestAmountAndCurrencyhere:App/src/pages/EditRequestPage.js
Lines 123 to 136 in 8cb48e4
What changes do you think we should make in order to solve the problem?
We should add a check to see if the request is paid using
ReportUtils.canEditFieldOfMoneyRequest()here:App/src/pages/EditRequestPage.js
Lines 127 to 131 in 8cb48e4
We could also use
ReportUtils.isSettled()for the check.Alternatively:
IOU.updateMoneyRequestAmountAndCurrencyhere.Tony-MK commentedon Dec 31, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
The backend is returning the correct error message, however we don't expect it because we are not handling it in the
MoneyRequestView.What changes do you think we should make in order to solve the problem?
Get the errors from the
errorFieldsand set it as theerrorsprop for theOfflineWithFeedback. The error message should not persist. Therefore, we can delete from the onyx once the user navigates away from the page oronClose. However, if we need them for later, we can alsoshouldShowErrorMessagesif the latest error message is past a certain duration.App/src/components/ReportActionItem/MoneyRequestView.js
Lines 201 to 202 in 8cb48e4
Pseudo-code
What alternative solutions did you explore? (Optional)
Create a parent
OfflineWithFeedbackcomponent of MoneyRequestView. Then, use thetransaction.errorvalue for the errors prop of the component.Listen for the transaction and disable the save button once it's paid. Also, displays an error.
MitchExpensify commentedon Dec 31, 2023
The expected result is weird to me, why would we tell the user an "unexpected error" occurs if it's expected that you cannot edit a settled amount? Why don't we just tell the user they cannot edit a settled amount if that is indeed expected?
Victor-Nyagudi commentedon Jan 1, 2024
Is it intentional a user can edit a paid request's amount?
Wouldn't that lead to conflicts over how much was paid by who later on?
2 remaining items
Pujan92 commentedon Jan 2, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
No error message shown for updating the paid amount transaction
What is the root cause of that problem?
It seems the issue occurs after this PR where we have used a new method to update an amount. For the failure case we don't have any report action error entry which isn't showing any error.
App/src/libs/actions/IOU.js
Lines 990 to 1011 in 320ff54
What changes do you think we should make in order to solve the problem?
Add an entry for the failureData in the onyx which sets error to that specific report action.
Like we have for the older method
App/src/libs/actions/IOU.js
Lines 2195 to 2203 in 320ff54
Result
Screen.Recording.2024-01-02.at.16.28.17.mp4
fedirjh commentedon Jan 2, 2024
@Pujan92 Thank you for the proposal, the root cause looks correct. I just retested with reverting #32533 and it's working as expected.
For the solution, it looks good to me, I believe we should add the failure data inside
getUpdateMoneyRequestParamsto fix the bug with other fields as well.🎀 👀 🎀 C+ reviewed
melvin-bot commentedon Jan 2, 2024
Triggered auto assignment to @nkuoch, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
melvin-bot commentedon Jan 2, 2024
📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
melvin-bot commentedon Jan 2, 2024
📣 @Pujan92 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
fedirjh commentedon Jan 9, 2024
Update: PR was merged and deployed to production #33880 (comment). It seems automation was not triggered for this one.
Pujan92 commentedon Jan 25, 2024
Bump @MitchExpensify :)
MitchExpensify commentedon Jan 27, 2024
Payment summary::
Paid and contracts ended