App: [HOLD https://github.com/Expensify/App/issues/19066] [$2000] IOU - IOU is duplicated after request errors
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
- Send request money from user B to A(MAIN)
- Turn off Internet in device A pay the request
- Cancel IOU in user B
- Turn internet on in Device A -red dot error message occurs in request
- Request the same amount from user B to A
Expected Result:
IOU should not be duplicated after request.
Also, since we are applying pattern B this is how the chat should look:

Notice:
- there is no
Xto dismiss the error - the error message is not visible yet, it will be visible in the RHN once we open the IOU details
- the “Settled up elsewhere” and “You payed B” box will be semi-transparent
And this is how the RHN should look once we open the details:

Actual Result:
Previous IOU is duplicated after request over “Error” request and pattern B feedback is no properly followed.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android / native
- Android / Chrome
- iOS / native
- iOS / Safari
- MacOS / Chrome / Safari
- MacOS / Desktop
Version Number: 1.2.74.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01fd0d26525bf69427
- Upwork Job ID: 1633174196547432448
- Last Price Increase: 2023-04-07
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 121 (97 by maintainers)
Daily update: I’ve read the whole thread above and now I’m checking the proposals of both @tienifr and @bernhardoj if we can go with one of them (fully or partially) - I’ll most likely post some insights about it tomorrow.
@burczu there is some overlap with the issue this PR is solving.
Also, the details view we are seeing is getting redone by “manual request”. I agree with @luacmartins about putting a HOLD until that is implemented.
I think that looks correct to me, but once again, calling on my offline pattern experts @trjExpensify and @JmillsExpensify for a second opinion here.
@aldo-expensify thanks for the information - please keep me posted when it’s possible to get back to this issue.
Sounds good to me @aimane-chnaif , thanks.
@burczu please start working on the PR.
Daily update: my proposal is under our internal review in the Callstack team. Should be posted here soon.
Daily update: I’ve checked both proposals and it seems they fix the issue only partially - I’m working on my own proposal and then we will see how similar it is to these proposals.
@tienifr @bernhardoj I requested Callstack’s help to move with this faster. If your solutions are used in the final implementation you will be compensated accordingly.
Let’s open for contributors 1-2 days if you agree since we cleared requirement recently.
@bfitzexpensify I’m reassigning as I’m ooo until Tues April 04 and this one will see some movement in that time.
Current Status:
When its time to make payments:
Issue reported by: Applause - Internal Team (no payment needed) Fix: TBD - a proposal hasn’t been officially accepted, assigned to this GH yet PR Review: will be done by @aimane-chnaif
@tienifr as per guideline, full proposal should be submitted only once. Following proposals should just be “Proposal updated”. If this is the one you’re proposing finally, delete old proposals or mark them as outdated.
Yup, I agree.
@aimane-chnaif my take is that the expected results should be:
RHN, IOU details with failed “Settled up elsewhere”:
Notice the opacity change in the entry “Settled up elsewhere” and the alignment of the error. Don’t worry about the error message text content for now, I think that has to be fixed in the server.
When you dismiss the error the semi-transparent “Settled up elsewhere” entry should be removed too
Chat (⚠️ THIS IS OUTDATED - look at the GH issue’s body for the up to date version)
The failed “Settled up elsewhere” in the main chat should have less opacity and the error should be below it.
Dismissing the error should clear the “Settled up elsewhere” entry and return to what you initially had:
The failed “Settled up elsewhere” entries are not really stored in the server, if you log out and log in, they are not there anymore. This is why it makes sense for me that clearing the error should clear them too.
@shawnborton can you check if the above expected behaviour looks correct ^ 🙏
Proposal
Please re-state the problem that we are trying to solve in this issue.
Request money message is duplicated on main device after request error This is the problem from both be and fe side. As @aldo-expensify mentioned here
We should transparent on error and disappear when user clicks the X button
What is the root cause of that problem?
In https://github.com/Expensify/App/blob/657b439007004a5a128fc76df00327cb14203915/src/components/OfflineWithFeedback.js#L88
we don’t make opacity for the iou error message
and in ReportActionItem we also don’t have the logic to delete
settled up elsewhereWhat changes do you think we should make in order to solve the problem?
we should have the new logic to transparent the iou error message in
OfflineWithFeedback,jsIn
ReportActionItem.jswe should passactionNameand deleteOptimisticReportAction if actionName===IOUIn https://github.com/Expensify/App/blob/acc4984ce41d21e0f89c1913053232a567598d8c/src/pages/iou/IOUDetailsModal.js#L146 we have to get
pendingActionfromreportActionsinfindPendingActionfunction because this function just returnsreportActions. It may not related to this issue but we should do this to prevent unexpected error.Result
https://user-images.githubusercontent.com/113963320/224228792-c2c44493-d559-4fc0-883a-d9c02b7e875b.mp4