Skip to content

[Due for payment 2025-11-19] [$250] Reports - Create report button opens workspace selector when default workspace is expired #72883

Closed

Description

@lanitochka17

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.2.33-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): sjdonisjonsidjosij@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Admin account is expired and has not been renewed
  • Admin creates a workspace and invites member to the workspace
  • The member has the invited workspace as default workspace
  • The member account does not have any expense
  • Perform the steps as the invited member
  1. Go to staging.new.expensify.com
  2. Open FAB > Create report
    → Restricted action page opens
  3. Go to Reports > Submit
  4. Click Create report button on the empty state

Expected Result:

Restricted action page will open

Actual Result:

Workspace selector opens, even when the invited (and expired) workspace is the only workspace

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6977852_1760710230897.14.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021980277291655472724
  • Upwork Job ID: 1980277291655472724
  • Last Price Increase: 2025-10-27
  • Automatic offers:
    • FitseTLT | Contributor | 109338083
Issue OwnerCurrent Issue Owner: @Gonals

Activity

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

    @melvin-bot

    Triggered auto assignment to @abekkala (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. FitseTLT commented on Oct 17, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Reports - Create report button opens workspace selector when default workspace is expired

    What is the root cause of that problem?

    We are missing the code that check if shouldRestrictUserBillableActions like here

    if (!shouldRestrictUserBillableActions(workspaceIDForReportCreation)) {
    const createdReportID = createNewReport(currentUserPersonalDetails, isASAPSubmitBetaEnabled, hasViolations, workspaceIDForReportCreation);
    Navigation.setNavigationActionToMicrotaskQueue(() => {
    Navigation.navigate(
    isSearchTopmostFullScreenRoute()
    ? ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: createdReportID, backTo: Navigation.getActiveRoute()})
    : ROUTES.REPORT_WITH_ID.getRoute(createdReportID, undefined, undefined, Navigation.getActiveRoute()),
    {forceReplace: isReportInSearch},
    );
    });
    } else {
    Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(workspaceIDForReportCreation));

    here

    App/src/libs/SearchUIUtils.ts

    Lines 1937 to 1946 in ea72aea

    if (workspaceIDForReportCreation && !shouldRestrictUserBillableActions(workspaceIDForReportCreation) && personalDetails) {
    const createdReportID = createNewReport(personalDetails, isASAPSubmitBetaEnabled, hasViolations, workspaceIDForReportCreation);
    Navigation.setNavigationActionToMicrotaskQueue(() => {
    Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: createdReportID, backTo: Navigation.getActiveRoute()}));
    });
    return;
    }
    // If the user's default workspace is personal and the user has more than one group workspace, which is paid and has chat enabled, or a chosen workspace is past the grace period, we need to redirect them to the workspace selection screen
    Navigation.navigate(ROUTES.NEW_REPORT_WORKSPACE_SELECTION.getRoute());

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

    We should check shouldRestrictUserBillableActions and navigate ROUTES.RESTRICTED_ACTION like here

    Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(workspaceIDForReportCreation));

    We should check for other create Report buttons and do the same

    IF needed we can also implement the case where if the workspaceIDForReportCreation is expired but there are other policies to select we are navigating to workspace selection list here

    if (!workspaceIDForReportCreation || (shouldRestrictUserBillableActions(workspaceIDForReportCreation) && groupPoliciesWithChatEnabled.length > 1)) {
    // If we couldn't guess the workspace to create the report, or a guessed workspace is past it's grace period and we have other workspaces to choose from
    Navigation.navigate(ROUTES.NEW_REPORT_WORKSPACE_SELECTION.getRoute());
    return;
    }

    What alternative solutions did you explore? (Optional)

  4. gijoe0295 commented on Oct 17, 2025

    @gijoe0295
    Contributor

    Proposal

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

    Create report button opens workspace selector when default workspace is expired

    What is the root cause of that problem?

    We already check if the policy has shouldRestrictUserBillableActions, but we don't open the restricted action page:

    App/src/libs/SearchUIUtils.ts

    Lines 1930 to 1936 in 5681000

    if (workspaceIDForReportCreation && !shouldRestrictUserBillableActions(workspaceIDForReportCreation) && personalDetails) {
    const createdReportID = createNewReport(personalDetails, isASAPSubmitBetaEnabled, hasViolations, workspaceIDForReportCreation);
    Navigation.setNavigationActionToMicrotaskQueue(() => {
    Navigation.navigate(ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID: createdReportID, backTo: Navigation.getActiveRoute()}));
    });
    return;
    }

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

    Add a check below the above snippet to open restricted action page if user has 1 only group policy and it's restricted:

    if (workspaceIDForReportCreation && groupPoliciesWithChatEnabled.length === 1) {
      Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(workspaceIDForReportCreation));
      return;
    }
    

    What alternative solutions did you explore? (Optional)

    NA

  5. abbasifaizan70 commented on Oct 19, 2025

    @abbasifaizan70
    Contributor

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

    When a member tries to create a report and their only workspace has an expired admin account, the workspace selector screen opens unnecessarily. Since there's only one workspace available, the user has to select it first before being shown the restricted action page. This creates an extra navigation step when the system should directly show the restricted action page.

    What is the root cause of that problem?

    In FloatingActionButtonAndPopover.tsx (around line 501) and EmptySearchView.tsx (around line 329), the condition for showing the workspace selector is:

    if (!workspaceIDForReportCreation || (shouldRestrictUserBillableActions(workspaceIDForReportCreation) && groupPoliciesWithChatEnabled.length > 1))

    This condition navigates to the workspace selector whenever workspaceIDForReportCreation is not initially set, regardless of how many workspaces are available. When a user has only one workspace that isn't their active policy, workspaceIDForReportCreation remains undefined at this point, triggering the workspace selector unnecessarily.

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

    We should update the logic to handle single-workspace scenarios before showing the selector.

    Changes needed in both FloatingActionButtonAndPopover.tsx (~line 501) and EmptySearchView.tsx (~line 329):

    Replace the current condition:

    if (!workspaceIDForReportCreation || (shouldRestrictUserBillableActions(workspaceIDForReportCreation) && groupPoliciesWithChatEnabled.length > 1)) {
        Navigation.navigate(ROUTES.NEW_REPORT_WORKSPACE_SELECTION.getRoute());
        return;
    }

    With:

    // If no workspace determined but multiple available, show selector
    if (!workspaceIDForReportCreation && groupPoliciesWithChatEnabled.length > 1) {
        Navigation.navigate(ROUTES.NEW_REPORT_WORKSPACE_SELECTION.getRoute());
        return;
    }
    
    // If no workspace determined but only one available, use it
    if (!workspaceIDForReportCreation && groupPoliciesWithChatEnabled.length === 1) {
        workspaceIDForReportCreation = groupPoliciesWithChatEnabled.at(0)?.id;
    }
    
    // If workspace is restricted and there are other options, show selector
    if (workspaceIDForReportCreation && shouldRestrictUserBillableActions(workspaceIDForReportCreation) && groupPoliciesWithChatEnabled.length > 1) {
        Navigation.navigate(ROUTES.NEW_REPORT_WORKSPACE_SELECTION.getRoute());
        return;
    }

    This ensures that when a user has only one workspace available (even if restricted), the system uses that workspace and directly navigates to the appropriate page (either creating a report or showing the restricted action page), without the unnecessary workspace selector step.

    What alternative solutions did you explore?

    Alternative 1: Modify the workspace selector page to auto-navigate when only one workspace exists

    • Rejected because: This would add logic in the wrong place and still cause an unnecessary render/navigation cycle

    Alternative 2: Set workspaceIDForReportCreation earlier in the flow by changing the conditions at lines 489-494

    • Rejected because: This would require broader changes to the workspace selection logic and could affect other flows where the active policy check is intentional

    Alternative 3: Add the single-workspace check only after both conditions fail

    • Rejected because: This wouldn't prevent the workspace selector from opening; it would just be a fallback that doesn't solve the navigation issue
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 20, 2025
  7. melvin-bot commented on Oct 20, 2025

    @melvin-bot
  8. changed the title [-]Reports - Create report button opens workspace selector when default workspace is expired[/-] [+][$250] Reports - Create report button opens workspace selector when default workspace is expired[/+] on Oct 20, 2025
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 20, 2025
  10. melvin-bot commented on Oct 20, 2025

    @melvin-bot

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

  11. 25 remaining items

  12. changed the title [-][$250] Reports - Create report button opens workspace selector when default workspace is expired[/-] [+][Due for payment 2025-11-19] [$250] Reports - Create report button opens workspace selector when default workspace is expired[/+] on Nov 12, 2025
  13. melvin-bot commented on Nov 12, 2025

    @melvin-bot

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

  14. melvin-bot commented on Nov 12, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.54-1 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-11-19. 🎊

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

  15. melvin-bot commented on Nov 12, 2025

    @melvin-bot

    @jjcoffee / @FitseTLT 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]

  16. abekkala commented on Nov 17, 2025

    @abekkala
    Contributor

    PAYMENT SUMMARY FOR NOV 19

    • Fix: @FitseTLT [$250, if no regressions] payment via Upwork - OFFER
    • PR Review: @jjcoffee [$250, if no regressions] payment via NewDot
      please complete checklist
  17. jjcoffee commented on Nov 18, 2025

    @jjcoffee
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Precondition:

    • Admin account is expired and has not been renewed
    • Admin creates a workspace and invites member to the workspace
    • The member has the invited workspace as the only (default) workspace.
    • The member account does not have any expense.
    • Perform the steps as the invited member

    Test:

    1. Go to Reports > Submit
    2. Click Create report button on the empty state
    3. Verify the Restricted action page opens

    Do we agree 👍 or 👎

  18. abekkala commented on Nov 19, 2025

    @abekkala
    Contributor

    @jjcoffee did this one have a regression? It looks like on the same day Nov 12 it was deployed to Prod but then also went back to deployed to staging with no other production update?

  19. jjcoffee commented on Nov 20, 2025

    @jjcoffee
    Contributor

    @abekkala Hmm weird, I'm guessing there must have been some automation issue there as there were no regressions that I'm aware of and there's nothing noted on the deploy issue.

  20. trjExpensify commented on Nov 20, 2025

    @trjExpensify
    Contributor

    approved $250 for @jjcoffee.

  21. abekkala commented on Nov 21, 2025

    @abekkala
    Contributor

    @FitseTLT payment sent via Upwork and contract ended - thank you! 🎉

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions