Skip to content

[Due for payment 2025-05-30] [$250] Track expense - To field shows "Unavailable workspace" when sharing expense with accountant #61582

Description

@vincdargento

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.1.41-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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): skbskhis@gmail.com
Issue reported by: Applause Internal Team
Device used: iPhone 15 Pro Max / iOS 18.4
App Component: Money Requests

Action Performed:

  1. Launch Expensify app.
  2. Log in with a new Gmail account.
  3. Select Track and budget expenses during onboarding.
  4. Complete the onboarding.
  5. Open self DM from search icon.
  6. Track a manual expense in self DM.
  7. Tap Share it with my accountant.
  8. Enter any email and select the user.

Expected Result:

To field will show the correct workspace name on the confirmation page.

Actual Result:

To field shows "Unavailable workspace" on the confirmation page.

This only happens when submitting expense to the accountant for the first time.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021922513020562998329
  • Upwork Job ID: 1922513020562998329
  • Last Price Increase: 2025-05-14
  • Automatic offers:
    • mkzie2 | Contributor | 107324430
Issue OwnerCurrent Issue Owner: @adelekennedy

Activity

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

    @melvin-bot

    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.

  3. mkzie2 commented on May 7, 2025

    @mkzie2
    Contributor

    Proposal

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

    To field shows "Unavailable workspace" on the confirmation page.

    What is the root cause of that problem?

    We create a draft workspace after entering an accountant

    createDraftWorkspaceAndNavigateToConfirmationScreen(transactionID, action);

    const {expenseChatReportID, policyID, policyName} = createDraftWorkspace();

    const workspaceName = policyName || generateDefaultWorkspaceName(policyOwnerEmail);

    The workspace name is generated based on email parameter or sessionEmail that is obtained from Onyx.connect. In our case, we don't pass any parameters to createDraftWorkspace function, then we use sessionEmail to generate the workspace name.

    const emailParts = email ? email.split('@') : sessionEmail.split('@');

    The problem is that the Onyx.connect only starts triggering if we call any function in this file. In our case, this is the first time we call a function inside this file, and then sessionEmail is empty, and this function returns an empty workspace name.

    It leads the UI to show Unavailable workspace as fallback

    sessionEmail = val?.email ?? '';

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

    We can pass policyOwnerEmail as currentUserEmail. The ReportUtils file is called frequently when the app is initialized then we can ensure the data is available.

    const {expenseChatReportID, policyID, policyName} = createDraftWorkspace(currentUserEmail);
    

    const {expenseChatReportID, policyID, policyName} = createDraftWorkspace();

    To be safer, we can get the session data via Onyx on IOURequestStepAccountant and pass it down to createDraftWorkspaceAndNavigateToConfirmationScreen, and then pass it to createDraftWorkspace function

    createDraftWorkspaceAndNavigateToConfirmationScreen(transactionID, action);

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

    This is an UI issue

    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.

  4. melvin-bot commented on May 13, 2025

    @melvin-bot

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

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 14, 2025
  6. changed the title [-]Track expense - To field shows "Unavailable workspace" when sharing expense with accountant[/-] [+][$250] Track expense - To field shows "Unavailable workspace" when sharing expense with accountant[/+] on May 14, 2025
  7. melvin-bot commented on May 14, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 14, 2025
  9. melvin-bot commented on May 14, 2025

    @melvin-bot

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

  10. DylanDylann commented on May 15, 2025

    @DylanDylann
    Contributor

    @mkzie2's proposal looks good to me

    🎀👀🎀 C+ reviewed

  11. 15 remaining items

  12. melvin-bot commented on May 23, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.50-0 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-30. 🎊

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

  13. melvin-bot commented on May 23, 2025

    @melvin-bot

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

  14. melvin-bot commented on Jun 2, 2025

    @melvin-bot

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

  15. adelekennedy commented on Jun 2, 2025

    @adelekennedy
    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 👎

  16. adelekennedy commented on Jun 2, 2025

    @adelekennedy
    Contributor

    @DylanDylann for the checklist above!

  17. DylanDylann commented on Jun 3, 2025

    @DylanDylann
    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: Long time ago, I can't find exactly that cause this problem

    • [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.

    • [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. Login to a new account
    2. Select Track and budget expenses during onboarding.
    3. Complete the onboarding.
    4. Open self DM from search icon.
    5. Track a manual expense in self DM.
    6. Tap Share it with my accountant.
    7. Enter any email and select the user.
    8. Verify that the workspace's name is shown correctly on the confirmation page

    Do we agree 👍 or 👎

  18. adelekennedy commented on Jun 6, 2025

    @adelekennedy
    Contributor

    Payment Summary

    Contributor: @mkzie2 paid $250 via Upwork
    Contributor+: @DylanDylann due $250 via NewDot

  19. JmillsExpensify commented on Aug 7, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @DylanDylann

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions