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
[$1000] A failed IOU request has the “Cancel” feature as a successful IOU request and able to cancel the request #16748
“Cancel” button for failed IOUs shouldn't be clickable and should be disabled or hidden from the UI
Actual Result:
“Cancel” button for failed IOUs is active and clickable
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.92-0 Reproducible in staging?: Reproducible in production?: 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
Hmm. I couldn't reproduce this where the error message pops up after simulating a network failure and then disabling that - it didn't show an error at all. I tested on staging.
@Natnael-Guchima can you check your reproduction steps to make sure nothing is missing?
I'm currently seeing Delete instead of Cancel. Was the copy changed at some point?
No, cancel and decline buttons are removed in favor of the new Delete button on this PR
@Natnael-Guchima Thanks for the reply. So is this bug still applicable? But instead of Cancel, we should disable Delete if the request failed?
You are welcome @akinwale. I am not sure if this bug is still applicable. I haven't heard anything from internal team on weather to pursue this or not.
Please re-state the problem that we are trying to solve in this issue.
"Cancel" button in the IOU details modal is being displayed for failed IOU requests. It is assumed that the Cancel button has been replaced by the "Delete" button based on this PR: #17583. This proposal will assume the Delete button going forward.
What is the root cause of that problem?
The filter for deletable transactions in the getDeletableTransactions method for IOUTransactions does not check for transactions that have a pendingAction. Hence, the Delete button is shown for failed transactions which have a pending action.
📣 @tienifr You have been assigned to this job by @roryabraham!
Please apply to this job in Upwork 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
MelvinBot commentedon Mar 30, 2023
Triggered auto assignment to @greg-schroeder (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.MelvinBot commentedon Mar 30, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)MelvinBot commentedon Apr 3, 2023
greg-schroeder commentedon Apr 5, 2023
Reviewing now
greg-schroeder commentedon Apr 5, 2023
Hmm. I couldn't reproduce this where the error message pops up after simulating a network failure and then disabling that - it didn't show an error at all. I tested on staging.
@Natnael-Guchima can you check your reproduction steps to make sure nothing is missing?
Natnael-Guchima commentedon Apr 5, 2023
One minute, @greg-schroeder. Let me check and get back to you.
Natnael-Guchima commentedon Apr 5, 2023
2023-04-05.19.56.24.mp4
I can reproduce it in staging, @greg-schroeder.
Steps:
The above step should produce the error message. If error is thrown open the failed IOU and click on 'Cancel' button
40 remaining items
Natnael-Guchima commentedon May 10, 2023
You are welcome @akinwale. I am not sure if this bug is still applicable. I haven't heard anything from internal team on weather to pursue this or not.
akinwale commentedon May 10, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
"Cancel" button in the IOU details modal is being displayed for failed IOU requests. It is assumed that the Cancel button has been replaced by the "Delete" button based on this PR: #17583. This proposal will assume the Delete button going forward.
What is the root cause of that problem?
The filter for deletable transactions in the
getDeletableTransactionsmethod forIOUTransactionsdoes not check for transactions that have apendingAction. Hence, the Delete button is shown for failed transactions which have a pending action.App/src/pages/iou/IOUTransactions.js
Lines 67 to 74 in 1b1e562
What changes do you think we should make in order to solve the problem?
Add a filter to remove transactions that have a
pendingActionofaddin thegetDeletableTransactionsmethod.Alternatively, if the button should not be displayed for all transactions that have a pending action, then the filter can be defined as such:
What alternative solutions did you explore? (Optional)
None.
tienifr commentedon May 11, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The failed IOU request is still deleable
What is the root cause of that problem?
In
App/src/pages/iou/IOUTransactions.js
Lines 67 to 74 in 1ee8cf8
We get the deletable transactions without filtering out the errors transaction
What changes do you think we should make in order to solve the problem?
Solution 1: If we don't want to show the delete button
Filter out the error action by adding the following line:
Solution 2: If we want to disable the delete button
Improvement
We should move this line
App/src/pages/iou/IOUTransactions.js
Line 86 in 1ee8cf8
outside of map function to improve performance.
What alternative solutions did you explore? (Optional)
roryabraham commentedon May 11, 2023
@tienifr your proposal with solution 1 LGTM 👍🏼
melvin-bot commentedon May 11, 2023
📣 @tienifr You have been assigned to this job by @roryabraham!
Please apply to this job in Upwork 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 📖
roryabraham commentedon May 11, 2023
Also, would love to see some automated tests cover this change 🙏🏼
0xmiroslav commentedon May 12, 2023
@roryabraham thanks for the proposal review in advance. @tienifr's Solution 1 looks good to me too!
👍 on
some automated tests cover this changegreg-schroeder commentedon May 16, 2023
Per discussion:
We're going to close the issue/PR and pay this out.
greg-schroeder commentedon May 16, 2023
@tienifr, @Natnael-Guchima, @0xmiroslav offers sent
Natnael-Guchima commentedon May 16, 2023
Accepted. Thanks!