Skip to content

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

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
1 of 8 tasks
jponikarchuk opened this issue Apr 29, 2025 · 23 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@jponikarchuk
Copy link

jponikarchuk commented Apr 29, 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.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): [email protected]
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
@jponikarchuk jponikarchuk added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

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.

@daledah
Copy link
Contributor

daledah commented Apr 29, 2025

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.

@bernhardoj
Copy link
Contributor

bernhardoj commented Apr 29, 2025

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

Copy link
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).

@maddylewis maddylewis added the External Added to denote the issue can be worked on by a contributor label Apr 29, 2025
@melvin-bot melvin-bot bot 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 Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

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

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

melvin-bot bot commented Apr 29, 2025

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

Copy link

melvin-bot bot commented May 5, 2025

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

@melvin-bot melvin-bot bot added the Overdue label May 5, 2025
@shubham1206agra
Copy link
Contributor

@daledah's proposal looks good to me.

🎀👀🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label May 6, 2025
Copy link

melvin-bot bot commented May 6, 2025

Triggered auto assignment to @neil-marcellini, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@bernhardoj
Copy link
Contributor

Any thoughts on my proposal? I think I provided a more complete proposal.

@shubham1206agra
Copy link
Contributor

Your changes was optional, and I don't think it was that critical. So I chose the first proposal in line.

Copy link

melvin-bot bot commented May 6, 2025

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@neil-marcellini
Copy link
Contributor

@daledah's proposal looks good to me.

🎀👀🎀 C+ reviewed

Agreed, hiring

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 6, 2025
Copy link

melvin-bot bot commented May 6, 2025

📣 @daledah 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added the Weekly KSv2 label May 7, 2025
@daledah
Copy link
Contributor

daledah commented May 7, 2025

@shubham1206agra PR is ready.

@maddylewis
Copy link
Contributor

@shubham1206agra - plz review @daledah 's PR when you have a chance - ty!

@shubham1206agra
Copy link
Contributor

@maddylewis PR is on staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 13, 2025
@melvin-bot melvin-bot bot 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 May 13, 2025
Copy link

melvin-bot bot commented May 13, 2025

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

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

melvin-bot bot commented May 13, 2025

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:

Copy link

melvin-bot bot commented May 13, 2025

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 20, 2025
@maddylewis
Copy link
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 👎

@maddylewis
Copy link
Contributor

maddylewis commented May 20, 2025

Payments + Final To-Dos

@shubham1206agra
Copy link
Contributor

shubham1206agra commented May 20, 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/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 👎

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants