Skip to content

[Due for payment 2025-05-27] [Due for payment 2025-05-13] [Due for payment 2025-05-08] [$250] Reports - Unable to delete expense in Reports #61141

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

Closed
4 of 8 tasks
mitarachim opened this issue Apr 30, 2025 · 36 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@mitarachim
Copy link

mitarachim commented Apr 30, 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.1.38-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: iPhone 15 Pro Max / iOS 18.4
App Component: Search

Action Performed:

  1. Launch Expensify app.
  2. Go to any chat.
  3. Submit an expense to the chat.
  4. Go to Reports.
  5. Long press on the expense.
  6. Tap on the dropdown.
  7. Tap Delete.
  8. Tap Delete.

Expected Result:

The confirmation modal will close and the expense is deleted.

Actual Result:

The confirmation modal is not closed and the expense is not deleted.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6817261_1745985217143.Bug_2.mp4
Bug6817261_1745985217151.Bug_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021917546474921434343
  • Upwork Job ID: 1917546474921434343
  • Last Price Increase: 2025-04-30
  • Automatic offers:
    • linhvovan29546 | Contributor | 107139001
Issue OwnerCurrent Issue Owner: @CortneyOfstad
@mitarachim mitarachim added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment labels Apr 30, 2025
Copy link

melvin-bot bot commented Apr 30, 2025

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 30, 2025
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 Apr 30, 2025

Triggered auto assignment to @madmax330 (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Apr 30, 2025

💬 A slack conversation has been started in #expensify-open-source

@mitarachim mitarachim changed the title Reports - The delete button doesn't respond on the Search page Reports - Unable to delete expense in Reports Apr 30, 2025
@madmax330
Copy link
Contributor

Hmm I'm able to delete the expense fine in Chrome... 😕

@madmax330 madmax330 removed the DeployBlocker Indicates it should block deploying the API label Apr 30, 2025
@madmax330
Copy link
Contributor

Since nothing changed on the auth command or web command, i'm going to remove the web blocker label:

@madmax330 madmax330 added the External Added to denote the issue can be worked on by a contributor label Apr 30, 2025
@melvin-bot melvin-bot bot changed the title Reports - Unable to delete expense in Reports [$250] Reports - Unable to delete expense in Reports Apr 30, 2025
Copy link

melvin-bot bot commented Apr 30, 2025

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

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

melvin-bot bot commented Apr 30, 2025

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

@mountiny
Copy link
Contributor

@jnowakow @rayane-d Would you take a look please?

@thienlnam
Copy link
Contributor

I also can't seem to reproduce, asking QA to retry

@thienlnam
Copy link
Contributor

Hmm nevermind, this is reproducible on iOS mobile at least

@linhvovan29546
Copy link
Contributor

Proposal

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

Reports - Unable to delete expense in Reports

What is the root cause of that problem?

From PR #60800 where the selected option is always cleared selected option after modal hidden:

clearSelectedTransactions();

Subsequently, in the delete expense logic, there's an early return if no option is selected. Since the selected expense is cleared as described above, the condition in handleDeleteExpenses is met, and the deletion does not proceed.

<ConfirmModal
isVisible={isDeleteExpensesConfirmModalVisible}
onConfirm={handleDeleteExpenses}

const handleDeleteExpenses = () => {
if (selectedTransactionsKeys.length === 0 || !hash) {
return;
}

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

We can introduce a new property to the delete dropdown action:
shouldPreserveSelectionAfterHideModal = true

options.push({
icon: Expensicons.Trashcan,
text: translate('search.bulkActions.delete'),
value: CONST.SEARCH.BULK_ACTION_TYPES.DELETE,
shouldCloseModalOnSelect: true,

  options.push({
                icon: Expensicons.Trashcan,
                text: translate('search.bulkActions.delete'),
                value: CONST.SEARCH.BULK_ACTION_TYPES.DELETE,
                shouldCloseModalOnSelect: true,
                shouldPreserveSelectionAfterHideModal: true,
...

Then, in SearchSelectedNarrow, update handleOnModalHide to check this new property before clearing the selection:

const handleOnModalHide = () => {
if (selectedOptionIndexRef.current === -1) {
return;
}
options[selectedOptionIndexRef.current]?.onSelected?.();
clearSelectedTransactions();
};

    const handleOnModalHide = () => {
        if (selectedOptionIndexRef.current === -1) {
            return;
        }

        options[selectedOptionIndexRef.current]?.onSelected?.();
        if(options[selectedOptionIndexRef.current]?.shouldPreserveSelectionAfterHideModal) {
        return
        }
        clearSelectedTransactions();
    };

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

N/A

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.

@izarutskaya
Copy link

Issue is still reproducible
Build 9.1.38-3

iPhone 15 Pro Max / iOS 18.4

ScreenRecording_05-01-2025.15-22-24_1.MP4

Device: iPhone 12 iOS 17.5.1

IMG_0875.MP4

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 6, 2025
Copy link

melvin-bot bot commented May 6, 2025

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

If no regressions arise, payment will be issued on 2025-05-13. 🎊

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

Copy link

melvin-bot bot commented May 6, 2025

@rayane-d @stephanieelliott @rayane-d The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@stephanieelliott
Copy link
Contributor

Hey @rayane-d can you please complete the BZ checklist so that we can pay this on 5/8?

@stephanieelliott
Copy link
Contributor

stephanieelliott commented May 6, 2025

Reapplying the Bug label to get another BZ member on this as I am OOO til May 19. 

Status: Nothing left to do here but issue payment on 5/13

@stephanieelliott stephanieelliott removed their assignment May 6, 2025
@stephanieelliott stephanieelliott added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels May 6, 2025
Copy link

melvin-bot bot commented May 6, 2025

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 Daily KSv2 labels May 6, 2025
Copy link

melvin-bot bot commented May 13, 2025

@madmax330, @CortneyOfstad, @thienlnam, @rayane-d, @linhvovan29546 Huh... This is 4 days overdue. Who can take care of this?

@rayane-d
Copy link
Contributor

rayane-d commented May 13, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment: https://github.com/Expensify/App/pull/60800/files#r2089568220

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion: N/A

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

  • N/A

Test:

  1. Launch the Expensify app.
  2. Go to any chat.
  3. Submit an expense to the chat.
  4. Go to Reports.
  5. Long-press on the expense.
  6. Tap on the dropdown.
  7. Tap Delete.
  8. Confirm
  9. Verify that the expense is deleted after the confirmation modal is closed.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot removed the Overdue label May 13, 2025
@CortneyOfstad
Copy link
Contributor

@rayane-d — it looks like the checklist was copied, but not filled out. Can you please fill out the checklist as soon as you can so there is no delay in payment? Thanks!

@CortneyOfstad
Copy link
Contributor

Bump @rayane-d ^^^

@rayane-d
Copy link
Contributor

@CortneyOfstad Done! Sorry for the delay!

@CortneyOfstad
Copy link
Contributor

Payment Summary

@linhvovan29546 — paid $250 via Upwork
@rayane-d — to be paid $250 via NewDot

Regression Test

https://github.com/Expensify/Expensify/issues/501414

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels May 20, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-05-13] [Due for payment 2025-05-08] [$250] Reports - Unable to delete expense in Reports [Due for payment 2025-05-27] [Due for payment 2025-05-13] [Due for payment 2025-05-08] [$250] Reports - Unable to delete expense in Reports May 20, 2025
Copy link

melvin-bot bot commented May 20, 2025

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

If no regressions arise, payment will be issued on 2025-05-27. 🎊

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

Copy link

melvin-bot bot commented May 20, 2025

@rayane-d @CortneyOfstad @rayane-d The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@rayane-d
Copy link
Contributor

Requested in ND

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests