Skip to content

[HOLD for payment 2024-08-14] [$250] Search - Delete modal message changes to ".. these expenses" briefly when clicking Cancel #45447

Closed

Description

@m-natarajan

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


Issue found when validating #45143
Version Number: 9.0.7-4
Reproducible in staging?: y
Reproducible in production?: n
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: applause internal team
Slack conversation:

Action Performed:

Precondition:

  • User has at least one unpaid expense.
  1. Go to staging.new.expensify.com
  2. Go to Search.
  3. Click on the checkbox next to one expense (one only, important)
  4. Click on the dropdown.
  5. Click Delete.
  6. Note that the modal message is "Are you sure that you want to delete this expense?"
  7. Click Cancel.
  8. Note that the modal message changes to "Are you sure that you want to delete these expenses?" quickly before it disappears.

Expected Result:

The delete modal message should be consistent and not change when clicking Cancel button.

Actual Result:

The delete modal message changes from "Are you sure that you want to delete this expense?" to "Are you sure that you want to delete these expenses?" after clicking Cancel button.

This issue only happens when one expense is selected.

Workaround:

unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6543389_1721092571591.20240716_091035.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01086f676b97015a4f
  • Upwork Job ID: 1815203340945056905
  • Last Price Increase: 2024-07-22
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 103247059
Issue OwnerCurrent Issue Owner: @slafortune

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Jul 16, 2024
  2. melvin-bot commented on Jul 16, 2024

    @melvin-bot

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

  3. melvin-bot commented on Jul 16, 2024

    @melvin-bot

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

  4. github-actions commented on Jul 16, 2024

    @github-actions
    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.
  5. neonbhai commented on Jul 16, 2024

    @neonbhai
    Contributor

    Proposal

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

    Search - Delete modal message changes to ".. these expenses" briefly when clicking Cancel

    What is the root cause of that problem?

    When deletign expenses we clear the selected items.

    const handleDeleteExpenses = () => {
    if (selectedItemsToDelete.length === 0) {
    return;
    }
    clearSelectedItems();
    setDeleteExpensesConfirmModalVisible(false);
    SearchActions.deleteMoneyRequestOnSearch(hash, selectedItemsToDelete);
    };

    This changes the translation from pural to singular notation for a second. This causes the text change

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

    We will clear selected options after we have hidden the modal here

  6. Krishna2323 commented on Jul 16, 2024

    @Krishna2323
    Contributor

    Proposal

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

    Search - Delete modal message changes to ".. these expenses" briefly when clicking Cancel

    What is the root cause of that problem?

    The delete options are cleared before the close animation happens.

    const handleOnCancelConfirmModal = () => {
    setSelectedItemsToDelete([]);
    setDeleteExpensesConfirmModalVisible(false);
    };

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

    Use interaction manager to clear delete options after animation.

        const handleOnCancelConfirmModal = () => {
            setDeleteExpensesConfirmModalVisible(false);
            InteractionManager.runAfterInteractions(() => {
                setSelectedItemsToDelete([]);
            });
        };

    Do the same with handleOnSelectDeleteOption function.

    const handleOnSelectDeleteOption = (itemsToDelete: string[]) => {
    setSelectedItemsToDelete(itemsToDelete);
    setDeleteExpensesConfirmModalVisible(true);
    };

    What alternative solutions did you explore? (Optional)

    We can use setTimeout instead of InteractionManager.

  7. tienifr commented on Jul 16, 2024

    @tienifr
    Contributor

    Proposal

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

    • The delete modal message changes from "Are you sure that you want to delete this expense?" to "Are you sure that you want to delete these expenses?" after clicking Cancel button.

    What is the root cause of that problem?

    • The delete modal message is "Are you sure that you want to delete this expense?" or "Are you sure that you want to delete these expenses?" based on the count value:

      deleteExpense: ({count}: DeleteExpenseTranslationParams = {count: 1}) => `Delete ${Str.pluralize('expense', 'expenses', count)}`,

    • In case of the bug, when selecting one transaction, then click on "Delete" button in header, the delete modal is displayed. Here, we call:

      setSelectedItemsToDelete(itemsToDelete);

      so the selectedItemsToDelete.length is 1, so "Are you sure that you want to delete this expense?" is displayed.

    • Then if we click on "Cancel" button, we call:

      setSelectedItemsToDelete([]);

      so the selectedItemsToDelete.length is 0.

    • Here, when the modal is still displayed for a while before fully disappearing, the modal is displayed as "Are you sure that you want to delete these expenses?".

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

    What alternative solutions did you explore? (Optional)

    NA

  8. 28 remaining items

  9. bernhardoj commented on Jul 24, 2024

    @bernhardoj
    Contributor

    PR is ready

    cc: @abdulrahuman5196

  10. added
    Weekly
    Awaiting Payment
    and removed
    Weekly
    on Aug 7, 2024
  11. changed the title [-][$250] Search - Delete modal message changes to ".. these expenses" briefly when clicking Cancel[/-] [+][HOLD for payment 2024-08-14] [$250] Search - Delete modal message changes to ".. these expenses" briefly when clicking Cancel[/+] on Aug 7, 2024
  12. melvin-bot commented on Aug 7, 2024

    @melvin-bot

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

  13. removed
    Reviewing
    on Aug 7, 2024
  14. melvin-bot commented on Aug 7, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.17-2 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 2024-08-14. 🎊

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

  15. melvin-bot commented on Aug 7, 2024

    @melvin-bot

    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:

    • [@abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
    • [@abdulrahuman5196] 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:
    • [@abdulrahuman5196] A discussion in #expensify-bugs 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:
    • [@abdulrahuman5196] Determine if we should create a regression test for this bug.
    • [@abdulrahuman5196] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@slafortune] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  16. abdulrahuman5196 commented on Aug 14, 2024

    @abdulrahuman5196
    Contributor

    The PR that introduced the bug has been identified. Link to the PR:
    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:
    A discussion in #expensify-bugs 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:

    https://github.com/Expensify/App/pull/45143/files#r1717120388

    Determine if we should create a regression test for this bug.

    Yes.

    If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

    1. Open Search page
    2. Click on the checkbox next to one of the expenses (one only, important)
    3. Click on the dropdown
    4. Click Delete
    5. Note that the confirmation message is "Are you sure that you want to delete this expense?"
    6. Click Cancel
    7. Verify the confirmation message doesn't change to "Are you sure that you want to delete these expenses?"
  17. slafortune commented on Aug 14, 2024

    @slafortune
    Contributor

    @abdulrahuman5196 Role C+ is due payment through NewDot Manual Requests - $250
    @bernhardoj Role Contributor requires payment through NewDot Manual Requests - $250

  18. JmillsExpensify commented on Aug 14, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @abdulrahuman5196

  19. bernhardoj commented on Aug 15, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  20. JmillsExpensify commented on Aug 21, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugEngineeringExternalWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions