Skip to content

[Due for payment 2025-03-21] [Due for payment 2025-03-17] [$250] iOS - Reports - App crashes after deleting workspace when it is selected in workspace switcher #57984

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
2 of 8 tasks
mitarachim opened this issue Mar 7, 2025 · 29 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@mitarachim
Copy link

mitarachim commented Mar 7, 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.10-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
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: Mac 15.3 / Chrome
App Component: Search

Action Performed:

Precondition:

  • There is at least one workspace.
  1. Launch ND or hybrid app.
  2. Go to Settings > Workspaces.
  3. Go to Reports.
  4. Open workspace switcher.
  5. Select a workspace.
  6. Go to Settings.
  7. Tap 3-dot menu for the workspace from Step 5.
  8. Delete the workspace.

Expected Result:

App will not crash.

Actual Result:

App crashes.

On web, the deleted workspace remains selected in the workspace switcher when going back to Reports after deleting the workspace.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6763672_1741330652459.ScreenRecording_03-07-2025_14-54-42_1.mp4

Bug6763672_1741330781766!Expensify-2025-03-07-145452.txt

Bug6763672_1741331098195.web.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021897966159811981264
  • Upwork Job ID: 1897966159811981264
  • Last Price Increase: 2025-03-07
Issue OwnerCurrent Issue Owner: @adelekennedy
@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 Mar 7, 2025
Copy link

melvin-bot bot commented Mar 7, 2025

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

Copy link

melvin-bot bot commented Mar 7, 2025

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

Copy link

melvin-bot bot commented Mar 7, 2025

Triggered auto assignment to @adelekennedy (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 removed the Daily KSv2 label Mar 7, 2025
Copy link
Contributor

github-actions bot commented Mar 7, 2025

👋 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.

@nkdengineer
Copy link
Contributor

Proposal

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

App crashes.

What is the root cause of that problem?

We have 2 problems here

  1. App crashes when deleting workspace because after deleting the active workspace ID, we call resetPolicyIDInNavigationState and crash because lastPolicyRoute.params is undefined here

if (policyIDToDelete === activeWorkspaceID) {
setActiveWorkspaceID(undefined);
resetPolicyIDInNavigationState();
}

  1. After deleting that workspace, go back to the search screen and we will still see that workspace on the switch button. Because we use policyID here from route.params and it is not updated when we deleting the workspace

activeWorkspaceID={policyID}

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

  1. We should add new check here
    if (!lastPolicyRoute || !lastPolicyRoute.params) {
        return;
    }
  1. We should use activeWorkspaceID from hook useActiveWorkpsace instead of policyID

activeWorkspaceID={policyID}

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

None

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.

@nkdengineer
Copy link
Contributor

@Beamanator I can help take a quick PR if needed.

@Beamanator
Copy link
Contributor

Thanks @nkdengineer please do submit a PR 🙏

@Beamanator Beamanator added External Added to denote the issue can be worked on by a contributor and removed DeployBlocker Indicates it should block deploying the API labels Mar 7, 2025
@melvin-bot melvin-bot bot changed the title iOS - Reports - App crashes after deleting workspace when it is selected in workspace switcher [$250] iOS - Reports - App crashes after deleting workspace when it is selected in workspace switcher Mar 7, 2025
Copy link

melvin-bot bot commented Mar 7, 2025

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

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

melvin-bot bot commented Mar 7, 2025

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

@Beamanator Beamanator removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 7, 2025
@Beamanator
Copy link
Contributor

@allgandalf is going to check this out too, to see if it relates to the [Better Expense Report View] proj

@rayane-d
Copy link
Contributor

rayane-d commented Mar 7, 2025

3. After deleting that workspace, go back to the search screen and we will still see that workspace on the switch button. Because we use policyID here from route.params and it is not updated when we deleting the workspace
3. We should use activeWorkspaceID from hook useActiveWorkpsace instead of policyID

@nkdengineer - I believe we still need to use policyID from the search query on the search page. Instead of using activeWorkspaceID, we should figure out how to update the policyID param to undefined when the workspace is deleted.

Did you determine why lastPolicyRoute.params is undefined? It should contain the parameters of the search query.

@nkdengineer
Copy link
Contributor

thanks @rayane-d. I'm checking now

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 10, 2025
@melvin-bot melvin-bot bot changed the title [$250] iOS - Reports - App crashes after deleting workspace when it is selected in workspace switcher [Due for payment 2025-03-17] [$250] iOS - Reports - App crashes after deleting workspace when it is selected in workspace switcher Mar 10, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 10, 2025
Copy link

melvin-bot bot commented Mar 10, 2025

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

Copy link

melvin-bot bot commented Mar 10, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.10-6 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-03-17. 🎊

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

  • @rayane-d requires payment through NewDot Manual Requests
  • @nkdengineer requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 10, 2025

@rayane-d @adelekennedy @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]

@adelekennedy

This comment has been minimized.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Mar 14, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-03-17] [$250] iOS - Reports - App crashes after deleting workspace when it is selected in workspace switcher [Due for payment 2025-03-21] [Due for payment 2025-03-17] [$250] iOS - Reports - App crashes after deleting workspace when it is selected in workspace switcher Mar 14, 2025
Copy link

melvin-bot bot commented Mar 14, 2025

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

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

  • @rayane-d requires payment through NewDot Manual Requests
  • @nkdengineer requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Mar 14, 2025

@rayane-d @adelekennedy @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

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: [Better Expense Report View] Add new navigator to allow for new SearchMoneyRequestReport screen #57607 (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: 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:

  • There is at least one workspace.

Test:

  1. Open the app.
  2. Go to Settings > Workspaces.
  3. Go to Reports.
  4. Open workspace switcher.
  5. Select a workspace.
  6. Go to Settings.
  7. Tap 3-dot menu for the workspace from Step 5.
  8. Delete the workspace.
  9. Verify that the app will not crash.

Do we agree 👍 or 👎

@rayane-d
Copy link
Contributor

@adelekennedy Could you please post a payment summary? Thanks

@adelekennedy
Copy link

Contributor+: @rayane-d owed $250 via NewDot
Contributor: @nkdengineer owed $250 via Upwork

Copy link

melvin-bot bot commented Mar 21, 2025

Payment Summary

Upwork Job

BugZero Checklist (@adelekennedy)

  • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1897966159811981264/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@melvin-bot melvin-bot bot added the Overdue label Mar 21, 2025
@adelekennedy
Copy link

@nkdengineer bump to accept the offer in Upwork!

@melvin-bot melvin-bot bot removed the Overdue label Mar 21, 2025
@nkdengineer
Copy link
Contributor

@adelekennedy Accepted, ty!

@melvin-bot melvin-bot bot added the Overdue label Mar 23, 2025
@adelekennedy
Copy link

all set here

@garrettmknight
Copy link
Contributor

$250 approved for @rayane-d

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

No branches or pull requests

7 participants