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.52k stars 2.87k forks source link

[HOLD for payment 2024-08-09] [$250] Search - List still shows receipt when removed, and receipt reappears when returning online #44000

Closed lanitochka17 closed 2 months ago

lanitochka17 commented 4 months 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: 1.4.85-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 Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to 1:1 DM
  3. Submit an expense with a receipt
  4. Go to Search and open the transaction from Step 3
  5. Go offline
  6. Click on the receipt and delete it
  7. Dismiss the RHP
  8. Note that the expense in the list still has the receipt and not removed
  9. Go online
  10. Open the transaction from Search again
  11. Note that the removed receipt changes to green thumbnail and can be viewed when opened

Expected Result:

In Step 8, after removing receipt offline, the expense in the list will not show the receipt In Step 11, when returning online, the deleted receipt will not appear again

Actual Result:

In Step 8, after removing receipt offline, the expense in the list still shows the receipt In Step 11, when returning online, the deleted receipt appears as a green thumbnail and can be viewed when opened

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/8553b535-1695-49df-923f-8c36d23c3746

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01306ca9167fa65ee4
  • Upwork Job ID: 1805674432579051426
  • Last Price Increase: 2024-06-25
  • Automatic offers:
    • nkdengineer | Contributor | 102955586
Issue OwnerCurrent Issue Owner: @anmurali
melvin-bot[bot] commented 4 months ago

Triggered auto assignment to @laurenreidexpensify (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 months ago

@laurenreidexpensify 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 4 months ago

Proposal

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

In Step 8, after removing receipt offline, the expense in the list still shows the receipt In Step 11, when returning online, the deleted receipt appears as a green thumbnail and can be viewed when opened

What is the root cause of that problem?

When we delete the receipt, we update the receipt field of transaction as an empty object and we use the set method to update the transaction in Onyx so it works fine.

https://github.com/Expensify/App/blob/75614394a2fb1e8114e35bb2d8d33bdd0c565946/src/libs/actions/IOU.ts#L6573-L6579

But when we update the snapshot data we use merge method here and then the receipt data isn't updated correctly in this case.

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

When we delete the receipt here we can update the receipt as null here or we can update to the object with source as empty string.

https://github.com/Expensify/App/blob/75614394a2fb1e8114e35bb2d8d33bdd0c565946/src/libs/actions/IOU.ts#L6573

Another problem here is if we create a request without receipt and then add the receipt to the request, the snapshot is also not updated correctly because we only pick the field that exist in the snapshot data here. To fix this I think when BE return the snapshot data of transaction we can return receipt field as an empty object.

What alternative solutions did you explore? (Optional)

melvin-bot[bot] commented 4 months ago

Triggered auto assignment to @anmurali (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.

laurenreidexpensify commented 4 months ago

@anmurali handing over for my parental leave clear out. Haven't reviewed this yet, so your call on whether you want to push it forward or close out if not worth a fix. Thanks!

melvin-bot[bot] commented 4 months ago

@anmurali Huh... This is 4 days overdue. Who can take care of this?

anmurali commented 4 months ago

I am putting this in wave collect as it is related to search v1.

melvin-bot[bot] commented 4 months ago

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

melvin-bot[bot] commented 4 months ago

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

thesahindia commented 4 months ago

@nkdengineer's proposal looks good!

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

melvin-bot[bot] commented 4 months ago

Triggered auto assignment to @techievivek, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 4 months ago

πŸ“£ @nkdengineer πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer 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 πŸ“–

melvin-bot[bot] commented 4 months ago

@anmurali, @techievivek, @thesahindia, @nkdengineer Huh... This is 4 days overdue. Who can take care of this?

nkdengineer commented 4 months ago

i'll raise PR soon

nkdengineer commented 4 months ago

@thesahindia this PR is ready for preview

melvin-bot[bot] commented 3 months ago

This issue has not been updated in over 15 days. @anmurali, @techievivek, @thesahindia, @nkdengineer 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[bot] commented 3 months ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 3 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.15-9 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-08-09. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 3 months ago

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:

melvin-bot[bot] commented 2 months ago

@anmurali, @techievivek, @thesahindia, @nkdengineer Huh... This is 4 days overdue. Who can take care of this?

anmurali commented 2 months ago

Payment summary

garrettmknight commented 1 month ago

$250 approved for @thesahindia