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 2024-04-05] [$500] IOU-Error message remains on IOU report even same error message is dismissed from 1:1 #34189
Version Number: 1.4.23-0 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:
Log in with separate accounts in the main testing device and a secondary device
In the main testing device create an IOU with a user
Disable the internet connection in the main testing device
In the main testing device (while offline) cancel the IOU
In the secondary device (online) mark the IOU as paid with the option "Settled up elsewhere"
Enable the internet connection in the main testing device
Verify a red dot appears on the chat in LHN
Tap the X from the conversation
Go to IOU report
Expected Result:
Since User dismiss the X error should not appear into IOU report
Actual Result:
Error message remains on IOU report even same error message is dismissed from 1:1
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Android - IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/-][+][$500] Android - IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/+]on Jan 9, 2024
Please re-state the problem that we are trying to solve in this issue.
Error message remains on IOU report even same error message is dismissed from 1:1
What is the root cause of that problem?
When we failed to delete the money request, there'll be 2 different errors created on the IOU report and the chat report here and here
What changes do you think we should make in order to solve the problem?
When we generate the errors on IOU report and chat report, generate them with the same microseconds since they are basically 1 single error.
When clearing the error from either the IOU report or the chat report, optionally check if the error content is iou.error.genericDeleteFailureMessage, if true, we'll find a report action from the other report (if IOU report then we find in chat report and vice versa) that has an error with the same microseconds (and error content), and clear that error as well.
Detail implementation
Define the errorKey
const errorKey = DateUtils.getMicroseconds();
Store the error for the action itself
Update this line here to
Create new function named clearAllRelatedReportActionErrors in libs/action/ReportActions.ts to clear the error from action itself and children/parent actions
Update onClose to use clearAllRelatedReportActionErrors
What alternative solutions did you explore? (Optional)
The same approach listed above can be applied to many other scenarios where there's an error that occurs in multiple places but actually are the same error.
Another approach is to make microsecond errors an error object instead of just a text/translation key. In that object we can include metadata on where else this same error is added and use that to clear the error. Or we can even create a dedicated errors_${microseconds} key in Onyx to store the metadata, and when deleting we cross check that object to see if there's anywhere else this error needs to be deleted.
Not sure about adding logic to sync error deletion across reports though, adds a fair bit of complexity and potential for more bugs.
Ideally, if we want the error to behave as it belongs to a single entity (say IOU report) and displayed in multiple places, we should reflect that in the data and component structure. Data normalisation, as opposed to duplication. Otherwise, we may find this type of issue props up again.
I agree with @tienifr and @codebycarlos. I checked his proposal.
The proposal advises that the data structure be normalized. This would eliminate duplicate errors and speed up the resolution process. The solution aims for simplicity and effectiveness by providing consistent error generation with shared microseconds and updating dismissal logic to eliminate errors from both reports at the same time.
changed the title [-][$500] IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/-][+][HOLD for payment 2024-04-05] [$500] IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/+]on Mar 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
[@DylanDylann] 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:
[@DylanDylann] A discussion in #expensify-bugs 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:
[@DylanDylann] Determine if we should create a regression test for this bug.
[@DylanDylann] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
[-]Android - IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/-][+][$500] Android - IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/+]melvin-bot commentedon Jan 9, 2024
Job added to Upwork: https://www.upwork.com/jobs/~015c3e14be277849ac
melvin-bot commentedon Jan 9, 2024
Triggered auto assignment to @alexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jan 9, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (
External)tienifr commentedon Jan 10, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Error message remains on IOU report even same error message is dismissed from 1:1
What is the root cause of that problem?
When we failed to delete the money request, there'll be 2 different errors created on the IOU report and the chat report here and here
What changes do you think we should make in order to solve the problem?
When we generate the errors on IOU report and chat report, generate them with the same microseconds since they are basically 1 single error.
When clearing the error from either the IOU report or the chat report, optionally check if the error content is
iou.error.genericDeleteFailureMessage, if true, we'll find a report action from the other report (if IOU report then we find in chat report and vice versa) that has an error with the same microseconds (and error content), and clear that error as well.Detail implementation
Update this line here to
and here to
Create new function named
clearAllRelatedReportActionErrorsinlibs/action/ReportActions.tsto clear the error from action itself and children/parent actionsUpdate onClose to use clearAllRelatedReportActionErrors
Here's the test branch: https://github.com/tienifr/App/tree/fix/34189
What alternative solutions did you explore? (Optional)
The same approach listed above can be applied to many other scenarios where there's an error that occurs in multiple places but actually are the same error.
Another approach is to make microsecond errors an error object instead of just a text/translation key. In that object we can include metadata on where else this same error is added and use that to clear the error. Or we can even create a dedicated
errors_${microseconds}key in Onyx to store the metadata, and when deleting we cross check that object to see if there's anywhere else this error needs to be deleted.Result
Screen.Recording.2024-01-22.at.18.00.00.mov
codebycarlos commentedon Jan 10, 2024
Agree with @tienifr's diagnosis. 👍
Not sure about adding logic to sync error deletion across reports though, adds a fair bit of complexity and potential for more bugs.
Ideally, if we want the error to behave as it belongs to a single entity (say IOU report) and displayed in multiple places, we should reflect that in the data and component structure. Data normalisation, as opposed to duplication. Otherwise, we may find this type of issue props up again.
Thoughts?
kaushiktd commentedon Jan 11, 2024
I agree with @tienifr and @codebycarlos. I checked his proposal.
The proposal advises that the data structure be normalized. This would eliminate duplicate errors and speed up the resolution process. The solution aims for simplicity and effectiveness by providing consistent error generation with shared microseconds and updating dismissal logic to eliminate errors from both reports at the same time.
melvin-bot commentedon Jan 15, 2024
@alexpensify, @Santhosh-Sellavel Eep! 4 days overdue now. Issues have feelings too...
92 remaining items
[-][$500] IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/-][+][HOLD for payment 2024-04-05] [$500] IOU-Error message remains on IOU report even same error message is dismissed from 1:1[/+]melvin-bot commentedon Mar 29, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 29, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 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 2024-04-05. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 29, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
alexpensify commentedon Apr 4, 2024
@DylanDylann and @tienifr - I had to create a new Job in Upwork:
https://www.upwork.com/jobs/~019a5f69e7fb9d4402
Please apply and I can complete the payment process tomorrow. Thanks!
melvin-bot commentedon Apr 5, 2024
Payment Summary
Upwork Job
BugZero Checklist (@alexpensify)
alexpensify commentedon Apr 5, 2024
@tienifr and @DylanDylann - I've sent offers in Upwork. Please accept and I can continue the process. Thanks!
alexpensify commentedon Apr 8, 2024
I was able to complete the payment process for @tienifr. I'm waiting for @DylanDylann to accept and I can carry on in Upwork.
DylanDylann commentedon Apr 9, 2024
@alexpensify I accepted. Thanks
alexpensify commentedon Apr 9, 2024
Thanks, all set here. Everyone has been paid in Upwork. Here is the payment summary:
#34189 (comment)
Upwork Link:
https://www.upwork.com/jobs/~019a5f69e7fb9d4402