Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel payment - IOU preview and report title display "Canceled" when canceled payment is repaid #33508

Closed
4 of 6 tasks
lanitochka17 opened this issue Dec 22, 2023 · 10 comments
Closed
4 of 6 tasks
Assignees

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 22, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.16-3
Reproducible in staging?: Y
Reproducible in production?: N
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:

Issue found when executing PR #32674

Action Performed:

  1. [User A] Request money from User B
  2. [User B] Click on IOU preview > Pay elsewhere
  3. [User B] Click 3-dot menu > Cancel payment > Cancel payment
  4. [User B] Pay elsewhere the request again

Expected Result:

IOU preview and report title will not display "Canceled" when canceled payment is repaid

Actual Result:

IOU preview and report title display "Canceled" when canceled payment is repaid

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6324145_1703263838762.bandicam_2023-12-22_17-46-22-423__1_.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Dec 22, 2023
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Dec 22, 2023

Triggered auto assignment to @joelbettner (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@paultsimura
Copy link
Contributor

paultsimura commented Dec 22, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

When canceling the IOU payment and paying again, the "canceled" label remains on the report previews.

What is the root cause of that problem?

This is happening because when paying the IOU Request, we do not reset the iouReport.isCancelledIOU to false.

What changes do you think we should make in order to solve the problem?

First, we should fix this on FE: add an optimistic isCancelledIOU: false (and corresponding failure data) here:

App/src/libs/actions/IOU.js

Lines 2787 to 2797 in b0e038f

{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`,
value: {
...iouReport,
lastMessageText: optimisticIOUReportAction.message[0].text,
lastMessageHtml: optimisticIOUReportAction.message[0].html,
hasOutstandingChildRequest: false,
statusNum: CONST.REPORT.STATUS.REIMBURSED,
},
},

It also should be handled from the BE so that the API response will not return isCancelledIOU: true on the PayMoneyRequest call.

What alternative solutions did you explore? (Optional)

@joelbettner
Copy link
Contributor

I believe this was caused by this PR: #32674

@Gonals would you mind taking a look. I think what @paultsimura has outlined is correct.

@situchan
Copy link
Contributor

That PR caused lots of deploy blockers. Seems like Cancel payment feature is not complete yet.
I'd suggest to revert PR or at least hide Cancel option until it is fully implemented without any critical bug.

@joelbettner
Copy link
Contributor

I'm going to make the call that this does not need to be a deploy blocker since the fixes for this do not need to come in the App repo. The Web-Expensify and Auth PRs above should fix this.

@joelbettner joelbettner added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Dec 23, 2023
@paultsimura
Copy link
Contributor

@joelbettner I would say we still should add the optimistic data updates on the App side after the BE changes are done: #33508 (comment)

@mountiny
Copy link
Contributor

THE PR got reverted assigning @Gonals just so they are aware

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jan 18, 2024
Copy link

melvin-bot bot commented Jan 18, 2024

This issue has not been updated in over 15 days. @joelbettner, @Gonals eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot closed this as completed Mar 15, 2024
Copy link

melvin-bot bot commented Mar 15, 2024

@joelbettner, @Gonals, this Monthly task hasn't been acted upon in 6 weeks; closing.

If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants