Skip to content

Consolidate the default-workspace eligibility rule across report and expense flows #105701

Open

Description

@MelvinBot

Problem

The App uses three different checks to decide whether a workspace can be the default destination for a new report or expense. They give different answers for archived, join-pending and pending-delete workspaces, so the same user can get a different default depending on which flow they start from.

Check Used by What it checks
canCreateReportOnPolicy Create report flows (via getGroupPoliciesWhereReportCanBeCreated) Not join-pending, paid or Submit workspace, shouldShowPolicy, can create expenses, not Teachers Unite
isEligibleDefaultExpensePolicy inside useDefaultExpensePolicy About 20 flows that need a default expense workspace Group workspace, isPolicyAccessible, can create expenses, not Teachers Unite
isPolicyValidForMovingExpenses Moving expenses to a new report Member not pending delete (skipped when employeeList is empty), can create expenses, group workspace, workspace not pending delete, not Teachers Unite, plus per diem / time filters

Expected

One shared "can this workspace be the default" rule that all three call sites use. Flow-specific filters (for example, per diem and time tracking for moving expenses) stay as extra checks on top of the shared rule.

Scope

  • Pick one definition for archived, join-pending and pending-delete workspaces and apply it everywhere.
  • About 20 flows depend on useDefaultExpensePolicy, so this needs its own PR and a full QA pass across those flows.
  • This is a code-quality refactor with small behaviour fixes for edge cases. It does not change the domain preferred-workspace logic shipped in Fix/align workspace selector logic v2.

Follow-up to Create report workspace selector ignores domain restrictions and misfires on the FAB, item 4 in this comment. trjExpensify approved spinning it out here.

Activity

  1. added
    Daily
    and removed
    Weekly
    on Nov 3, 2026
  2. huult commented on Nov 6, 2026

    @huult
    Contributor

    @jmusial, do you have a timeline for when you'll start working on this?

  3. jmusial commented on Nov 6, 2026

    @jmusial
    Contributor

    I think next week. Got couple perf issues that take priority.

  4. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    @jmusial, @huult Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  5. huult commented on Nov 10, 2026

    @huult
    Contributor

    @jmusial, @huult Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

    It's not overdue. @jmusial is currently working on another higher-priority ticket.

  6. jmusial commented on Nov 10, 2026

    @jmusial
    Contributor

    I'll try to get the PR out today

  7. jmusial commented on Nov 10, 2026

    @jmusial
    Contributor

    Got draft PR out here. Didn't manage to record all the vids yet but the web is there.
    @trjExpensify could you take a look @ the changes & vid and confirm that they are ok ?

  8. huult commented on Nov 16, 2026

    @huult
    Contributor
  9. expensify-chore-bot commented on Nov 19, 2026

    @expensify-chore-bot

    @jmusial, @huult Whoops! This issue is 2 days overdue. Let's get this updated quick!

  10. huult commented on Nov 22, 2026

    @huult
    Contributor

    Got draft PR out here. Didn't manage to record all the vids yet but the web is there. @trjExpensify could you take a look @ the changes & vid and confirm that they are ok ?

    @trjExpensify Could you take a look when you have a chance? Thanks!

  11. expensify-chore-bot commented on Nov 25, 2026

    @expensify-chore-bot

    @jmusial, @huult Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  12. huult commented on Nov 26, 2026

    @huult
    Contributor

    @trjExpensify, could you please check @jmusial's comment?

  13. trjExpensify commented on Nov 27, 2026

    @trjExpensify
    Contributor

    Oh sorry, I just found this thread in trash for some reason. 🤔 Looking at the PR now.

  14. added
    Reviewing
    Weekly
    and removed
    Daily
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ReviewingTaskWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions