Repository navigation
[Due for payment 2025-05-30] [$250] Track expense - To field shows "Unavailable workspace" when sharing expense with accountant #61582
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on May 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.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); Line 9419 in 9ab3535
const {expenseChatReportID, policyID, policyName} = createDraftWorkspace(); App/src/libs/actions/Policy/Policy.ts
Line 2141 in 9ab3535
const workspaceName = policyName || generateDefaultWorkspaceName(policyOwnerEmail); The workspace name is generated based on
emailparameter orsessionEmailthat is obtained fromOnyx.connect. In our case, we don't pass any parameters tocreateDraftWorkspacefunction, then we usesessionEmailto generate the workspace name.
App/src/libs/actions/Policy/Policy.ts
Line 1613 in 9ab3535
const emailParts = email ? email.split('@') : sessionEmail.split('@'); The problem is that the
Onyx.connectonly 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 thensessionEmailis empty, and this function returns an empty workspace name.It leads the UI to show
Unavailable workspaceas fallbackApp/src/libs/actions/Policy/Policy.ts
Line 199 in 9ab3535
sessionEmail = val?.email ?? ''; What changes do you think we should make in order to solve the problem?
We can pass
policyOwnerEmailascurrentUserEmail. TheReportUtilsfile is called frequently when the app is initialized then we can ensure the data is available.const {expenseChatReportID, policyID, policyName} = createDraftWorkspace(currentUserEmail);Line 9419 in 9ab3535
const {expenseChatReportID, policyID, policyName} = createDraftWorkspace(); To be safer, we can get the session data via
OnyxonIOURequestStepAccountantand pass it down tocreateDraftWorkspaceAndNavigateToConfirmationScreen, and then pass it tocreateDraftWorkspacefunctioncreateDraftWorkspaceAndNavigateToConfirmationScreen(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.
@adelekennedy Huh... This is 4 days overdue. Who can take care of this?
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on May 14, 2025 - 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 Job added to Upwork: https://www.upwork.com/jobs/~021922513020562998329
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on May 14, 2025 Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann (
External)15 remaining items
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:
- @DylanDylann requires payment through NewDot Manual Requests
- @mkzie2 requires payment automatic offer (Contributor)
@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]
@adelekennedy Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
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 👎
@DylanDylann for the checklist above!
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:
- Login to a new account
- Select Track and budget expenses during onboarding.
- Complete the onboarding.
- Open self DM from search icon.
- Track a manual expense in self DM.
- Tap Share it with my accountant.
- Enter any email and select the user.
- Verify that the workspace's name is shown correctly on the confirmation page
Do we agree 👍 or 👎
Payment Summary
Contributor: @mkzie2 paid $250 via Upwork
Contributor+: @DylanDylann due $250 via NewDot$250 approved for @DylanDylann
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:
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:
Screenshots/Videos
bug.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @adelekennedy