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

[$250] Bulk Invoice Delete doesn't remove the deleted rows from the UI #55680

Open
8 tasks done
m-natarajan opened this issue Jan 23, 2025 · 12 comments
Open
8 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@m-natarajan
Copy link

m-natarajan commented Jan 23, 2025

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: 9.0.89-2
Reproducible in staging?: y
Reproducible in production?: y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @mananjadhav
Slack conversation (hyperlinked to channel name): expensify - bug

Action Performed:

  1. Go to Reports section with some outstanding invoices.
  2. Click on Invoices
  3. Click on the select all invoices or choose some of the invoices by clicking on the checkbox
  4. Click on the top right button and delete the invoice.
  5. You'll notice the selected invoices are still retained in the table.
  6. They're removed on refresh of the page.

Expected Result:

The deleted invoices should be removed from the UI as soon as they're deleted.

Actual Result:

The selected invoices are still retained in the table even after being deleted. They're removed on refreshing the page.

Workaround:

unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Recording.920.mp4
web-bulk-delete-invoice.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021882909145340105934
  • Upwork Job ID: 1882909145340105934
  • Last Price Increase: 2025-01-24
Issue OwnerCurrent Issue Owner: @DylanDylann
@m-natarajan m-natarajan added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Jan 23, 2025
Copy link

melvin-bot bot commented Jan 23, 2025

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

@Christinadobrzyn
Copy link
Contributor

I think this can be external

@Christinadobrzyn Christinadobrzyn added the External Added to denote the issue can be worked on by a contributor label Jan 24, 2025
@melvin-bot melvin-bot bot changed the title Bulk Invoice Delete doesn't remove the deleted rows from the UI [$250] Bulk Invoice Delete doesn't remove the deleted rows from the UI Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 24, 2025
Copy link

melvin-bot bot commented Jan 24, 2025

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

@mac-ad
Copy link

mac-ad commented Jan 25, 2025

Proposal

Bulk Invoice Delete doesn't remove the deleted rows from the UI #55680

What is the root cause of that problem?

The list of data is fetched which works fine, it is then sorted into another variable which is then used to render on the page. However, when an item is deleted, the new list of data is fetched correctly from api but the variable used to render the UI list is not recalculating to reflect the reduced data. As a result, the UI does not reflect the changes and continues to display the outdated list until the entire page is refreshed.

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

We can ensure the sorted list is recalculated whenever there is a change in the fetched data. This can be achieved by memoizing the list to respond to any updates in the data.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

For the test cases:

  1. Initial rendering test: The reports page should render all the outstanding expenses.
  2. Deletion Test: bulk delete few of the expenses at once, and observe whether the Ui updates itself with reduced list or not.

Copy link

melvin-bot bot commented Jan 25, 2025

📣 @mac-ad! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@mac-ad
Copy link

mac-ad commented Jan 25, 2025

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~0152bf1c44868894cc

Proposal

Bulk Invoice Delete doesn't remove the deleted rows from the UI #55680

What is the root cause of that problem?

The list of data is fetched which works fine, it is then sorted into another variable which is then used to render on the page. However, when an item is deleted, the new list of data is fetched correctly from api but the variable used to render the UI list is not recalculating to reflect the reduced data. As a result, the UI does not reflect the changes and continues to display the outdated list until the entire page is refreshed.

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

We can ensure the sorted list is recalculated whenever there is a change in the fetched data. This can be achieved by memoizing the list to respond to any updates in the data.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

For the test cases:

  1. Initial rendering test: The reports page should render all the outstanding expenses.
  2. Deletion Test: bulk delete few of the expenses at once, and observe whether the Ui updates itself with reduced list or not.

Copy link

melvin-bot bot commented Jan 25, 2025

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@samh0lmes
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01280e21e1cafb6114

Proposal

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

When a user selects 1 or more transactions to be deleted, they remain on the page until a refresh (sometimes with a delay)

What is the root cause of that problem?

The deletion is done asynchronously and the UI does not reflect that the items have been deleted until the API request is complete. The transactions are not removed from the UI until they are actually deleted.

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

Ensure the UI is optimistically updated with the selected transaction IDs to be deleted before the async job is complete by ensuring the optimisticData does not include the deleted transaction IDs:

const {optimisticData, finallyData} = getOnyxLoadingData(hash);

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

Go to reports -> invoices
Add a few invoices
Delete 1 invoice
Click Delete
It should be immediately removed from the UI

Go to reports -> invoices
Add a few invoices
Delete 1 invoice
Click Cancel
It should not be removed from the UI (even on refresh)

Go to reports -> invoices
Add a few invoices
Delete multiple invoice
Click Delete
They should be immediately removed from the UI

Go to reports -> invoices
Add a few invoices
Delete 1 invoice
Click Cancel
They should not be removed from the UI (even on refresh)

Copy link

melvin-bot bot commented Jan 25, 2025

📣 @samh0lmes! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@samh0lmes
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01280e21e1cafb6114

Copy link

melvin-bot bot commented Jan 25, 2025

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Status: No status
Development

No branches or pull requests

5 participants