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.46k stars 2.81k forks source link

[$250] Search - Hold and Delete option are available for expense in the deleted (archived) workspace #50352

Open lanitochka17 opened 3 days ago

lanitochka17 commented 3 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.39-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): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat
  3. Submit an expense
  4. Delete the workspace
  5. Go to Search
  6. Select the expense in Step 3 via checkbox
  7. Click on the dropdown

Expected Result:

Hold and Delete option should not be available for expense in the deleted (archived) workspace

Actual Result:

Hold and Delete option are available for expense in the deleted (archived) workspace

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/25e9dd75-9a7c-4c9d-a509-c84e6bbc6357

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021843452809268772596
  • Upwork Job ID: 1843452809268772596
  • Last Price Increase: 2024-10-08
Issue OwnerCurrent Issue Owner: @fedirjh
melvin-bot[bot] commented 3 days ago

Triggered auto assignment to @mallenexpensify (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 3 days ago

@mallenexpensify 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

lanitochka17 commented 3 days ago

We think that this bug might be related to #wave-control

Nodebrute commented 3 days ago

Edited by proposal-police: This proposal was edited at 2024-10-07 19:47:40 UTC.

Proposal

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

Hold and Delete option are available for expense in the deleted (archived) workspace

What is the root cause of that problem?

Here we set canHold to item.canHold but when we delete workspace item.canHold will still be true https://github.com/Expensify/App/blob/fb4e24eca0905c8dec0c6dc69b4758aa66f2a791/src/components/Search/index.tsx#L84

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

We need to add new checks here for cases like where if workspace is deleted we don't show hold button. We can do something like this here

   const isArchivedReport = ReportUtils.isArchivedRoomWithID(item.reportID)
    const canHoldtransaction = !isArchivedReport && item.canHold

and then we can use this here canHold: canHoldtransaction

If we also want to hide delete button we can do the same for canDelete. We should also look for other cases where we don't want to hold and delete button and fix that here too.

What alternative solutions did you explore? (Optional)

Alternatively, we can add !isArchivedReport here https://github.com/Expensify/App/blob/fb4e24eca0905c8dec0c6dc69b4758aa66f2a791/src/components/Search/SearchPageHeader.tsx#L182

And if we want to hide the delete button we can do the same for delete button

ChavdaSachin commented 3 days ago

Proposal

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

Hold and Delete option are available for expense in the deleted (archived) workspace

What is the root cause of that problem?

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

We might need BE support here as well. This will avoid current and future problems it could cause.

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

melvin-bot[bot] commented 3 days ago

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

melvin-bot[bot] commented 3 days ago

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

mallenexpensify commented 3 days ago

@fedirjh are you able to reproduce? I wasn't (but I did a couple additional steps to add another workspace cuz I couldn't delete mine without another)

image image
fedirjh commented 1 day ago

@mallenexpensify I was able to reproduce. The bug appears on the search page, not the expense page :

Screenshot 2024-10-09 at 11 20 25 AM
mallenexpensify commented 1 day ago

Thanks @fedirjh , added Help Wanted, can you review the proposals above? Thx