Skip to content

[Due for payment 2025-05-20] [$250] iOS - Workspace - Unable to delete workspace, app freezes after tapping Delete workspace #61040

Closed

Description

@jponikarchuk

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.1.33-3
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
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): dhidjdjdkd@gmail.com
Issue reported by: Applause Internal Team
Device used: iPhone 15 Pro Max / iOS 18.4
App Component: Workspace Settings

Action Performed:

  1. Launch Expensify app.
  2. Log in with a new Gmail account.
  3. Select Something else during onboarding and complete the flow.
  4. Go to Account > Workspaces.
  5. Create a new workspace.
  6. Tap app back button to return to workspace list.
  7. Tap 3-dot menu.
  8. Tap Delete workspace.

Expected Result:

Confirmation modal to delete workspace will show up.

Actual Result:

Confirmation modal to delete workspace does not show up.
After tapping Delete workspace, tapping any button on the same page is not responsive.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021917225435968213171
  • Upwork Job ID: 1917225435968213171
  • Last Price Increase: 2025-05-06
  • Automatic offers:
    • daledah | Contributor | 107203490
Issue OwnerCurrent Issue Owner: @maddylewis

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 29, 2025
  2. melvin-bot commented on Apr 29, 2025

    @melvin-bot

    Triggered auto assignment to @maddylewis (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. daledah commented on Apr 29, 2025

    @daledah
    Contributor

    Proposal

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

    Confirmation modal to delete workspace does not show up.
    After tapping Delete workspace, tapping any button on the same page is not responsive.

    What is the root cause of that problem?

    When pressing "Delete workspace", we open the Delete modal immediately without waiting for the popover menu to close. This behaviour creates a race condition where the modal Onyx values are all set to false when popover menu closes, but Delete modal still opens

    Image

    So on screen, the Delete modal is not shown but the invisible overlay still exists, blocking user from interacting with any other components under.

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

    We should close the popover menu before opening delete modal

    setIsDeleteModalOpen(true);

                close(() => {
                    setIsDeleteModalOpen(true);
                });
    Screen.Recording.2025-04-29.at.19.01.12.mov

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

    It's a modal race condition so I don't think we need a test

    What alternative solutions did you explore? (Optional)

    NA

    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.

  4. bernhardoj commented on Apr 29, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Can't delete workspace.

    What is the root cause of that problem?

    When we try to delete a workspace and shouldCalculateBillNewDot is true, it will calculate the bill first

    onSelected: () => {
    if (loadingSpinnerIconIndex !== null) {
    return;
    }
    if (isSupportalAction) {
    setIsSupportalActionRestrictedModalOpen(true);
    return;
    }
    setPolicyIDToDelete(item.policyID);
    setPolicyNameToDelete(item.title);
    if (shouldCalculateBillNewDot) {
    setIsDeletingPaidWorkspace(true);
    calculateBillNewDot();
    setLoadingSpinnerIconIndex(index);
    return;
    }
    setIsDeleteModalOpen(true);
    },
    shouldKeepModalOpen: shouldCalculateBillNewDot,
    shouldCallAfterModalHide: !shouldCalculateBillNewDot,
    });

    Only after the calculate bill completes, we close the current modal,

    useEffect(() => {
    if (isLoadingBill) {
    return;
    }
    resetLoadingSpinnerIconIndex?.();
    if (!threeDotsMenuRef.current?.isPopupMenuVisible) {
    return;
    }
    threeDotsMenuRef?.current?.hidePopoverMenu();
    }, [isLoadingBill, resetLoadingSpinnerIconIndex]);

    and then show the delete confirm modal.

    useEffect(() => {
    if (!isDeletingPaidWorkspaceRef.current || isLoadingBill) {
    return;
    }
    if (!shouldBillWhenDowngrading) {
    setIsDeleteModalOpen(true);

    However, on iOS, if we want to show a modal from another modal, we need to wait for the previous modal to close first. That's why we have the shouldCallAfterModalHide. We set it to false if shouldCalculateBillNewDot is true, because we don't want to close the modal yet until the calculation is complete.

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

    To fix this, after completing the calculation, we need to close the previous modal first using Modal.close.

    We can add it into usePayAndDowngrade hook.

    close(() => setIsDeleteModalOpen(true));
    

    We can optionally do it using a props because usePayAndDowngrade is used in overview page too which doesn't need it.

    Or to make it cleaner, we can update the setIsDeleteModalOpen props to be a calculate complete callback, but doesn't need pay when downgrading. So, we can use it like:

    const showDeleteModal = useCallback(() => {
        close(() => setIsDeleteModalOpen(true));
    }, []);
    const {...} = usePayAndDowngrade(showDeleteModal);
    

    Then, we can remove the modal hide from here.

    useEffect(() => {
    if (isLoadingBill) {
    return;
    }
    resetLoadingSpinnerIconIndex?.();
    if (!threeDotsMenuRef.current?.isPopupMenuVisible) {
    return;
    }
    threeDotsMenuRef?.current?.hidePopoverMenu();
    }, [isLoadingBill, resetLoadingSpinnerIconIndex]);

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

    N/A

  5. github-actions commented on Apr 29, 2025

    @github-actions
    Contributor

    ⚠️ @bernhardoj Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 29, 2025
  7. changed the title [-]iOS - Workspace - Unable to delete workspace, app freezes after tapping Delete workspace[/-] [+][$250] iOS - Workspace - Unable to delete workspace, app freezes after tapping Delete workspace[/+] on Apr 29, 2025
  8. melvin-bot commented on Apr 29, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 29, 2025
  10. melvin-bot commented on Apr 29, 2025

    @melvin-bot

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

  11. melvin-bot commented on May 5, 2025

    @melvin-bot

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

  12. 17 remaining items

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on May 13, 2025
  14. changed the title [-][$250] iOS - Workspace - Unable to delete workspace, app freezes after tapping Delete workspace[/-] [+][Due for payment 2025-05-20] [$250] iOS - Workspace - Unable to delete workspace, app freezes after tapping Delete workspace[/+] on May 13, 2025
  15. melvin-bot commented on May 13, 2025

    @melvin-bot

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

  16. melvin-bot commented on May 13, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.44-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-20. 🎊

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

  17. melvin-bot commented on May 13, 2025

    @melvin-bot

    @shubham1206agra @maddylewis @shubham1206agra 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]

  18. maddylewis commented on May 20, 2025

    @maddylewis
    Contributor

    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:

    • [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:

    • [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.

    Regression Test Proposal Template
    • [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:

    Test:

    Do we agree 👍 or 👎

  19. maddylewis commented on May 20, 2025

    @maddylewis
    Contributor

    Payments + Final To-Dos

  20. shubham1206agra commented on May 20, 2025

    @shubham1206agra
    Contributor

    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/59070/files#r2098477678

    • [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: Not Required

    • [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

    Test:

    1. Create a WS
    2. Go to Workspace list page
    3. Click 3-dot menu of the created workspace
    4. Click delete workspace
    5. Verify that: Confirmation modal to delete workspace shows up.
    6. Click Delete
    7. Verify that: WS is deleted, user can interact with screen normally.

    Do we agree 👍 or 👎

  21. garrettmknight commented on Jun 19, 2025

    @garrettmknight
    Contributor

    $250 approved for @shubham1206agra

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions