Skip to content

[Due for payment 2025-11-18] [$250] iOS - Track - Unavailable workspace is shown instead of the expense title #71019

Closed

Description

@jponikarchuk

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: v9.2.16-3
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-859/folder/13176877/41237356/907089505
Email or phone of affected tester (no customers): n/a
Issue reported by: Applause Internal Team
Device used: iPhone 13 iOS 18.6 Hybrid
App Component: User Settings

Action Performed:

Precondition:
Log in with Expensifail account.
Account has no workspace.
Account has self DM.

  1. Open the app
    2.With a user that has no workspaces - You can delete all WS to execute this TC
    3.Submit a track expense in the self DM
    4.On the actionable whisper options of a track expense Click on Share it with your accountant
    5.Select an accountant
    6.Verify the "To" field is filled with a "new" workspace
    7.Enter a merchant, Category and create the expense

Expected Result:

Correct expense title is displayed after sharing an expense with an accountant

Actual Result:

Unavailable workspace is shown instead of the expense title. The correct title appears after opening expense details.

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

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021970363780967230980
  • Upwork Job ID: 1970363780967230980
  • Last Price Increase: 2025-10-07
Issue OwnerCurrent Issue Owner: @kadiealexander

Activity

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

    @melvin-bot

    Triggered auto assignment to @jliexpensify (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. jliexpensify commented on Sep 22, 2025

    @jliexpensify
    Contributor

    Android <> iOS swapsies

  4. bernhardoj commented on Sep 23, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Unavailable workspace is shown on the report preview and also I see it in IOU confirm page too. (the OP issue happens on all platform)

    What is the root cause of that problem?

    For the IOU confirm page, we get the participant (WS) report with getReportOrDraftReport.

    const report = getReportOrDraftReport(participant.reportID);

    We get the report draft data from the Onyx.connect.

    App/src/libs/ReportUtils.ts

    Lines 1179 to 1183 in 8aa2d21

    function getReportOrDraftReport(reportID: string | undefined, searchReports?: SearchReport[]): OnyxEntry<Report> | SearchReport {
    const searchReport = searchReports?.find((report) => report.reportID === reportID);
    const onyxReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
    return searchReport ?? onyxReport ?? allReportsDraft?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT}${reportID}`];
    }

    App/src/libs/ReportUtils.ts

    Lines 960 to 965 in 8aa2d21

    let allReportsDraft: OnyxCollection<Report>;
    Onyx.connect({
    key: ONYXKEYS.COLLECTION.REPORT_DRAFT,
    waitForCollectionCallback: true,
    callback: (value) => (allReportsDraft = value),
    });

    The draft data is initially empty and it won't rerender since we don't subscribe to it.

    return participant.accountID ? getParticipantsOption(participant, personalDetails) : getReportOption(participant, reportAttributesDerived);

    For the report preview issue, when we submit it to accountant, we optimistically create a new report preview and we get the policy name.

    reportName: `${policyName} owes ${formattedTotal}`,

    App/src/libs/ReportUtils.ts

    Lines 6245 to 6246 in 8aa2d21

    const report = chatReportID ? getReport(chatReportID, allReports) : undefined;
    const policyName = getPolicyName({report});

    However, the report is undefined because the report (new optimistic policy expense chat) is still in reportDraft collection but we tried to get it from the report collection.

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

    First, update the getReportOrDraftReportt to accept a reportDrafts collection. Then, we pass it down from
    IOURequestStepConfirmation -> getReportOption -> getReportOrDraftReport

    const [reportDrafts] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT, {canBeMissing: true});
    

    return participant.accountID ? getParticipantsOption(participant, personalDetails) : getReportOption(participant, reportAttributesDerived);
    }) ?? [],
    [transaction?.participants, iouType, personalDetails, reportAttributesDerived],
    );

    (make sure to add reportDrafts to the useMemo deps too.

    Next, use getRpeortOrDraftReport in buildOptimisticExpenseReport.

    App/src/libs/ReportUtils.ts

    Lines 6245 to 6246 in 8aa2d21

    const report = chatReportID ? getReport(chatReportID, allReports) : undefined;
    const policyName = getPolicyName({report});

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

    We can test requestMoney with a chat report that is in the reportDrafts collection and make sure the report name has the correct value.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 23, 2025
  6. changed the title [-]iOS - Track - Unavailable workspace is shown instead of the expense title[/-] [+][$250] iOS - Track - Unavailable workspace is shown instead of the expense title[/+] on Sep 23, 2025
  7. melvin-bot commented on Sep 23, 2025

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

    @melvin-bot

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

  10. 55 remaining items

  11. melvin-bot commented on Nov 11, 2025

    @melvin-bot

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

  12. melvin-bot commented on Nov 11, 2025

    @melvin-bot

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

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

    • @hungvu193 requires payment through NewDot Manual Requests
    • @bernhardoj requires payment through NewDot Manual Requests
  13. melvin-bot commented on Nov 11, 2025

    @melvin-bot

    @hungvu193 / @bernhardoj @kadiealexander 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. hungvu193 commented on Nov 14, 2025

    @hungvu193
    Contributor

    BugZero Checklist:

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

    • [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: N/A

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

    Precondition:

    • Account has no workspace
    • Account has selfDM

    Test:

    1. Open the app
    2. With a user that has no workspaces - You can delete all WS to execute this TC
    3. Submit a track expense in the self DM
    4. On the actionable whisper options of a track expense Click on Share it with your accountant
    5. Select an accountant
    6. Verify the "To" field is filled with a "new" workspace
    7. Enter a merchant, Category and create the expense
    8. Verify that the correct expense title is displayed after sharing an expense with an accountant

    Do we agree 👍 or 👎

    Testrail issue: https://github.com/Expensify/Expensify/issues/569145

  15. kadiealexander commented on Nov 18, 2025

    @kadiealexander
    Contributor

    Payment Summary

  16. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Nov 18, 2025
  17. bernhardoj commented on Nov 18, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  18. quinthar commented on Nov 19, 2025

    @quinthar
    Contributor

    Approved $250 to @getusha

  19. garrettmknight commented on Nov 21, 2025

    @garrettmknight
    Contributor

    $250 approved for @hungvu193

  20. garrettmknight commented on Nov 21, 2025

    @garrettmknight
    Contributor

    $250 approved for @bernhardoj

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