App icon indicating copy to clipboard operation
App copied to clipboard

Track Expenses-The "To" field is not auto-filled with a new workspace

Open IuliiaHerets opened this issue 1 year ago • 4 comments

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.0.72-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/cases/view/2990404 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team

Action Performed:

Steps:

  1. Use a new expensifail account
  2. Submit a track expense in the self DM
  3. On the actionable whisper options of a track expense, click on "Share it with your accountant"
  4. Create a new workspace
  5. Go back to self DM and click on "Share it with your accountant"

Expected Result:

The "To" field is auto-filled with a new workspace.

Actual Result:

The "To" field is not auto-filled with a new workspace. Instead, a RHP is displayed to find a workspace when the user has no one.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/09c92586-3f88-423b-821f-73e02073b58f

View all open jobs on GitHub

IuliiaHerets avatar Dec 06 '24 17:12 IuliiaHerets

Triggered auto assignment to @stephanieelliott (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.

melvin-bot[bot] avatar Dec 06 '24 17:12 melvin-bot[bot]

From the OP I don't see any problem because the user has deleted the workspace immediately after they created it @IuliiaHerets please take a 👀 again

FitseTLT avatar Dec 06 '24 17:12 FitseTLT

Edited by proposal-police: This proposal was edited at 2024-12-06 19:35:53 UTC.

Proposal

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

When user selects Share it with your accountant, the To field is not filled(Workspace is not selected)

What is the root cause of that problem?

  1. if user has a workspace then we are not creating a draft workspace https://github.com/Expensify/App/blob/5f143b53347336728f22b1f860406a2a3bc332dc/src/libs/ReportUtils.ts#L8257
  2. the issue is that when user deletes a workspace, it is still counted here https://github.com/Expensify/App/blob/5f143b53347336728f22b1f860406a2a3bc332dc/src/libs/ReportUtils.ts#L8215-L8217
  3. we are only creating a draft workspace if user has no workspaces https://github.com/Expensify/App/blob/5f143b53347336728f22b1f860406a2a3bc332dc/src/libs/ReportUtils.ts#L8262 the main issue is that we are not filtering out the archived workspace

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

modify this: https://github.com/Expensify/App/blob/5f143b53347336728f22b1f860406a2a3bc332dc/src/libs/ReportUtils.ts#L8215-L8217 to remove the archived workspaces by using !!PolicyUtils.getPolicyRole(policy, currentUserLogin) && as:

  const filteredPolicies = Object.values(allPolicies ?? {}).filter(
        (policy) =>
            policy &&
            !!PolicyUtils.getPolicyRole(policy, currentUserLogin) &&
            policy.type !== CONST.POLICY.TYPE.PERSONAL &&
            policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
    );

https://github.com/user-attachments/assets/4aac9d02-3a68-4f90-a854-39b3080a1b9f

Shahidullah-Muffakir avatar Dec 06 '24 18:12 Shahidullah-Muffakir

This issue has the same RCA as https://github.com/Expensify/App/issues/53659 and should be solved.

Tony-MK avatar Dec 07 '24 22:12 Tony-MK

This will be fixed in https://github.com/Expensify/App/issues/53659.

jjcoffee avatar Dec 09 '24 11:12 jjcoffee

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

melvin-bot[bot] avatar Dec 10 '24 09:12 melvin-bot[bot]

Closing based on this discussion -- we're not prioritizing non-onboarding Track bugs. But it sounds like this will be resolved soon anyway as part of https://github.com/Expensify/App/issues/53659

stephanieelliott avatar Dec 11 '24 00:12 stephanieelliott