Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.79k forks source link

[$250] IOU – Not here page when create new request after canceling payment for the first one #49801

Open lanitochka17 opened 4 days ago

lanitochka17 commented 4 days ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.40-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: N/A Email or phone of affected tester (no customers): gocemate+a2282@gmail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to workspace chat> + > Submit expense> Complete the flow
  2. Pay the request
  3. Go to transaction thread> Click on header> Cancel payment
  4. Go to main page> + > Submit expense> Complete the flow
  5. Navigate to newly created request

Expected Result:

Transaction thread should open

Actual Result:

Not here page appears

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/79bdf5a8-0aca-4006-b29c-98923dce8ecf

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021840688856056706978
  • Upwork Job ID: 1840688856056706978
  • Last Price Increase: 2024-09-30
Issue OwnerCurrent Issue Owner: @rushatgabhane
melvin-bot[bot] commented 4 days ago

Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

lanitochka17 commented 4 days ago

@sonialiap FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

nkdengineer commented 3 days ago

Proposal

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

Not here page appears

What is the root cause of that problem?

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

When we cancel payment here, we should update iouReportID in optimistic data here if chatReport.iouReportID is null or we can check if the current chatReport.iouReportID is created before or after the expenseReport to decide update iouReportID or not.

{
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${chatReport.reportID}`,
    value: {
        iouReportID: chatReport?.iouReportID ? chatReport?.iouReportID : expenseReport.reportID,
    },
}

https://github.com/Expensify/App/blob/70ed492da2743309039e17827d59792e6a148310/src/libs/actions/IOU.ts#L7430

We also need a BE change to update iouReportID of the chat report when we cancel the payment because

What alternative solutions did you explore? (Optional)

NA

melvin-bot[bot] commented 10 hours ago

Job added to Upwork: https://www.upwork.com/jobs/~021840688856056706978

melvin-bot[bot] commented 10 hours ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)