Skip to content

[$250] Onboarding - Manage my team - Missing Calendly link to book a call #96291

Closed

Description

@applause-bot

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.4.35-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13176677/test-cases/41237662
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11 / Chrome
App Component: Other

Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Sign up for a new account (Without +)
  3. Choose "Manage my team's expenses"
  4. Select company size 11-50 employees
  5. Pick an accounting integration as QBD option
  6. Navigate to #admins room

Expected Result:

Verify the message contains Calendly link to book a call

Actual Result:

Missing message contains Calendly link to book a call

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7209723_1784197137353.96243_-_Onboarding_-_Manage_my_team_-_Missing_Calendly_link_to_book_a_call.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7209723

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mollfpr

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 16, 2026
  2. applause-bot commented on Jul 16, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/e76c81d84baa9eb470a98db22061a0cc27fb15885f013e296f3e1881aee10ad5

  3. MelvinBot commented on Jul 16, 2026

    @MelvinBot
    Contributor

    Updated 2026-07-16: Correcting my earlier conclusion. My first analysis said this was backend-only with no App-side fix — that was wrong. There is a credible client-side (App) root cause, independently identified in aswin-s's proposal.

    Issue Analysis

    Root Cause (App): For MANAGE_TEAM, App intends to defer the entire #admins welcome to the backend's inboxAdminsBespoke variant (the one that carries the Calendly "book a call" link). The optimistic Onyx writes for the welcome message are correctly gated on !shouldDeferOptimisticTasks at ReportUtils.ts:12140 and :12163. But the actual server payload push is not gated — ReportUtils.ts:12278-12280 unconditionally pushes the plain onboardingManageTeamMessage copy ("Your free trial has started… I'm your Expensify account executive", which has no Calendly link — en.ts:3535-3544) into guidedSetupData, which is sent to CompleteGuidedSetup. So even though App means to let the server own the welcome, it still ships a plain, link-less message to the server, which appears to preempt the bespoke Calendly variant. The welcomeSignOffMessage push at ReportUtils.ts:12384 has the same gap.

    Recommended Fix (App): Gate the message push at ReportUtils.ts:12278 with !shouldDeferOptimisticTasks (mirroring the existing guards at 12140 / 12163 / 12357), and apply the same guard to the sign-off push at 12384. For MANAGE_TEAM the client should send no message in guidedSetupData, leaving the whole welcome sequence (including the Calendly link) to the backend, posted idempotently via optimisticConciergeReportActionID. companySize and userReportedIntegration (QBD) are sent independently (Report/index.ts:5586-5587) and are unaffected by this change.

    Confidence: Medium. The unguarded-push asymmetry and the link-less message copy are verified in code. The remaining unverified step is backend behavior — that a message present in guidedSetupData actually suppresses the inboxAdminsBespoke Calendly welcome. Worth confirming with a backend/log check on a repro CompleteGuidedSetup request (11–50 + QBD), or by observing which message actually renders in the room.

    Investigation details & alternatives considered
    • message is truthy for MANAGE_TEAM (built from onboardingManageTeamMessage, OnboardingFlow.ts:334-335), so the if (message) at 12278 is entered.
    • The symptom "plain welcome, no Calendly link" matches the client onboardingManageTeamMessage copy exactly — consistent with the client-supplied message being what lands in the room.
    • Alternative (nabi-ebrahimi's proposal): thread the guide's account.guideDetails.calendarLink into the client message copy. This keeps App generating the welcome rather than deferring to the backend, which conflicts with the existing shouldDeferOptimisticTasks design intent (the server owns the bespoke welcome). The guard-the-push fix is smaller and preserves that design.
    • QBD relevance: QBD requires a Control plan (ReportUtils.ts:12237); the bug is not QBD-specific in App code — it applies to the whole MANAGE_TEAM path. The regression test happened to use QBD + 11–50.

    No open duplicate issues found in Expensify/App.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/96291) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting this analysis.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 16, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 16, 2026
  6. aswin-s commented on Jul 16, 2026

    @aswin-s
    Contributor

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

    When a new user signs up on Web (Windows/Chrome), chooses "Manage my team's expenses", selects company size 11-50, and picks QuickBooks Desktop as the accounting integration, the welcome message that lands in the #admins room is the plain "Your free trial has started" copy with no Calendly link. Expected: for MANAGE_TEAM signups the room should show the bespoke assigned-guide welcome that includes a Calendly link to book a call with the account manager.

    What is the root cause of that problem?

    For engagementChoice === MANAGE_TEAM, prepareOnboardingOnyxData correctly sets shouldDeferOptimisticTasks = true and generates an optimisticConciergeReportActionID so that the backend can idempotently post the inboxAdminsBespoke welcome (the variant that contains the Calendly link). See src/libs/ReportUtils.ts:11779-11780 and src/libs/ReportUtils.ts:11852-11853. However at src/libs/ReportUtils.ts:12278-12280 the client unconditionally pushes {type: 'message', ...textMessage} (built from the client-side onboardingManageTeamMessage copy in src/languages/en.ts:3535-3544, which has no Calendly link) into guidedSetupData, which is then sent to CompleteGuidedSetup at src/libs/actions/Report/index.ts:5584. Because the client instructs the server to post that plain message, the server's inboxAdminsBespoke Calendly variant is preempted or duplicated by the plain welcome and the admins room ends up without the Calendly link.

    A second plain message can also enter guidedSetupData via the welcomeSignOffMessage push near src/libs/ReportUtils.ts:12384. The skipSignOff guard only short-circuits for LOOKING_AROUND; for MANAGE_TEAM the sign-off push is unconditional, so a stale optimistic sign-off action is sent to the server even though inboxAdminsBespoke owns the entire welcome sequence.

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

    1. In src/libs/ReportUtils.ts around line 12277-12280, guard the guidedSetupData.push({type: 'message', ...textMessage}) with !shouldDeferOptimisticTasks (mirroring the existing message && !shouldDeferOptimisticTasks guards at lines 12140 and 12163), so that for MANAGE_TEAM the client does not send the stale/plain message and lets the backend post the inboxAdminsBespoke welcome (which includes the Calendly link) using optimisticConciergeReportActionID.
    // src/libs/ReportUtils.ts ~line 12277
    if (message && !shouldDeferOptimisticTasks) {
        guidedSetupData.push({type: 'message', ...textMessage});
    }
    1. Extend the same guard to the welcomeSignOffMessage push near line 12384. The skipSignOff variable already correctly suppresses this for LOOKING_AROUND, but for MANAGE_TEAM the sign-off must also be suppressed because the backend-owned bespoke welcome does not expect a client-generated sign-off alongside it. The corrected block should read:
    // src/libs/ReportUtils.ts ~line 12384
    if (!skipSignOff && !shouldDeferOptimisticTasks && (!introSelected?.choice || introSelected.choice === CONST.ONBOARDING_CHOICES.TEST_DRIVE_RECEIVER)) {
        optimisticData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
            value: {
                [welcomeSignOffCommentAction.reportActionID]: welcomeSignOffCommentAction as ReportAction,
            },
        });
        guidedSetupData.push({type: 'message', ...welcomeSignOffMessage});
    }

    This ensures neither the plain onboarding message nor the sign-off message is sent to CompleteGuidedSetup when shouldDeferOptimisticTasks is true, leaving the entire welcome sequence to the backend.

    1. Verify that after this change the client still sends companySize and userReportedIntegration to CompleteGuidedSetup (src/libs/actions/Report/index.ts:5586-5587) so the backend can select the correct bespoke variant for 11-50 employees + QBD. Those fields are independent of the guidedSetupData array and are not affected by the guards above.

    2. Add a regression test around prepareOnboardingOnyxData asserting that when engagementChoice === MANAGE_TEAM the returned guidedSetupData contains no {type: 'message'} entry for either the plain onboarding message or the sign-off message, and that optimisticConciergeReportActionID is present in the returned data.

    What alternative solutions did you explore? (Optional)

    Move the Calendly link into the client-side onboardingManageTeamMessage copy in src/languages/*.ts — rejected because the bespoke welcome (guide identity, Calendly URL, integration-specific copy) is owned by the backend and must not be hard-coded per locale on the client.

  7. nabi-ebrahimi commented on Jul 16, 2026

    @nabi-ebrahimi

    Proposal

    What is the root cause of that problem?

    The QuickBooks Desktop choice is being captured correctly in onboarding: the accounting screen includes quickbooksDesktop and stores the selected integration before moving to the interested-features step (source, source), and the final onboarding step forwards that value to completeOnboarding as userReportedIntegration (source). The missing piece is that the guided setup/admin-room message payload never receives the guide’s Calendly URL. onboardingManageTeamMessage is built as static copy without any booking link (source), OnboardingTaskLinks has workspace/accounting/card links but no guide calendar link (source), and prepareOnboardingOnyxData only passes those existing links into the message/task builders (source). For MANAGE_TEAM, App intentionally defers the visible #admins welcome content to the guided-setup/server path (source, source), so the posted message can include the QBD task but has no source value to include the expected Calendly link. The separate header “Schedule call” button works because it reads account.guideDetails.calendarLink directly (source, source), but that data is not wired into the onboarding message.

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

    Thread the existing guide booking URL into the guided setup message data used for the MANAGE_TEAM onboarding flow.

    Add an optional guideCalendarLink field to the onboarding message/task params, pass it into prepareOnboardingOnyxData, and then into the onboardingManageTeamMessage builder. In BaseOnboardingInterestedFeatures, read the same accountGuideDetails via the existing accountGuideDetailsSelector (source) and pass accountGuideDetails?.calendarLink through completeOnboarding for the manage-team completion call. Then update the English manage-team welcome copy to include a booking sentence/link only when guideCalendarLink is present, preserving the current message when the guide has no calendar link.

    Because completeOnboarding already sends guidedSetupData, companySize, userReportedIntegration, and policyID together (source), the fix should keep the source of truth in the existing guided-setup payload rather than changing chat rendering or adding a separate follow-up message. We should also cover this with a focused unit test for MANAGE_TEAM + SMALL + quickbooksDesktop + guideCalendarLink, asserting that the generated guided setup message contains the booking link while the QBD task is still included.

    What alternative solutions did you explore? (Optional)

    I considered relying on the existing header “Schedule call” button, but the regression expectation is specifically for the #admins message to contain the Calendly link, and the header button is rendered from a separate UI path. I also considered a backend-only copy change, but App currently has the guide calendar link in Onyx and is already responsible for building the guided setup message payload, so passing that value through App is the smallest source-of-truth fix.

  8. trasnake87 commented on Jul 16, 2026

    @trasnake87
    Contributor

    Proposal

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

    After onboarding via "Manage my team's expenses" (company size 11-50, an accounting integration like QBD selected), the welcome message posted to the #admins room is missing the Calendly "book a call" link that sales‑eligible admins are supposed to receive.

    What is the root cause of that problem?

    For the MANAGE_TEAM choice, the #admins room welcome is a server‑generated inboxAdminsBespoke message (it contains the Calendly link for sales‑eligible company sizes). The client is only supposed to send the tasks to the backend and let the backend own the message copy. This is stated explicitly in the code:

    // src/libs/ReportUtils.ts:11779-11780
    // Server picks the inboxAdminsBespoke variant at response time, so optimistic writes here would be stale.
    const shouldDeferOptimisticTasks = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM;
    // src/libs/ReportUtils.ts:12276
    // ...a guide is assigned and all messages except tasks are handled by the backend

    Every optimistic write of the client‑side message is correctly gated on !shouldDeferOptimisticTasks (ReportUtils.ts:12140, 12163), and the sign‑off message is gated on the guide‑assigned condition (ReportUtils.ts:12355, 12357). But the message that is actually sent to the server in guidedSetupData is NOT gated:

    // src/libs/ReportUtils.ts:12277-12280
    const guidedSetupData: GuidedSetupData = [];
    if (message) {
        guidedSetupData.push({type: 'message', ...textMessage});
    }

    message here is the generic onboardingManageTeamMessage ("👋 Hey there, I'm your Expensify account executive…", en.ts:3535) — it has no Calendly link. Because the client sends this message in guidedSetupData, the backend treats the welcome as client‑provided and skips posting its inboxAdminsBespoke variant. The result: the plain client message is what lands in #admins, and the Calendly link is dropped. This fires on exactly the reported steps (Manage my team → 11‑50 employees → QBD), which is the sales‑eligible path (getWorkspaceCreatedAnalyticsEvent.ts:9-15,29-30) the bespoke welcome targets. It does not affect Submit/Personal/Chat‑split flows, where shouldDeferOptimisticTasks is false and the client legitimately owns the message.

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

    Gate the guidedSetupData message push on !shouldDeferOptimisticTasks, matching the optimistic/success/failure pushes and the sign‑off handling directly above it, so the backend owns the #admins welcome for MANAGE_TEAM:

    // src/libs/ReportUtils.ts:12277-12280
    const guidedSetupData: GuidedSetupData = [];
    if (message && !shouldDeferOptimisticTasks) {
        guidedSetupData.push({type: 'message', ...textMessage});
    }

    Tasks are still pushed to guidedSetupData (ReportUtils.ts:12353) and the accounting‑integration task filtering is unchanged, so the only behavioral change is that the client stops overriding the bespoke welcome. With no client message present, the backend posts the inboxAdminsBespoke variant containing the Calendly booking link.

    What alternative solutions did you explore? (Optional)

    Adding the Calendly URL to onboardingManageTeamMessage in en.ts. Rejected: the link is sales‑eligibility‑dependent (company size + private email domain) and is deliberately server‑owned; hardcoding it client‑side would show it to non‑eligible users and duplicate the backend copy the deferral logic was built to defer to.

  9. ahmdshrif commented on Jul 16, 2026

    @ahmdshrif
    Contributor

    Proposal

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

    In the "Manage my team" onboarding flow, the onboarding conversation introduces an Expensify account executive but never surfaces the Calendly link/button to actually book a call with them. The user has no way to schedule the call from the onboarding chat.

    What is the root cause of that problem?

    The "Book a call / Schedule a call" affordance is the onboarding help dropdown, which is only rendered when shouldShowGuideBooking is true. That flag is computed in HeaderView and is gated on isAdminRoom(report):

    const shouldShowGuideBooking =
    !!accountGuideDetails &&
    accountGuideDetails?.email !== CONST.EMAIL.CONCIERGE &&
    !!accountGuideDetails?.calendarLink &&
    isAdminRoom(report) &&
    !!canUserPerformWriteAction(report, isReportArchived) &&
    !isChatThread &&
    introSelected?.companySize !== CONST.ONBOARDING_COMPANY_SIZE.MICRO &&
    introSelected?.companySize !== CONST.ONBOARDING_COMPANY_SIZE.MICRO_SMALL;

    The Manage-my-team account-executive message is posted into the onboarding chat (the Concierge/onboarding room used by isChatUsedForOnboarding), not the workspace #admins room. Because that report fails the isAdminRoom(report) check on line 215, shouldShowGuideBooking is false there, so the OnboardingHelpDropdownButton — and its Calendly "Schedule a call" option (OnboardingHelpDropdownButton.tsx, ONBOARDING_HELP.SCHEDULE_CALL) — is never shown in the flow that explicitly promises a specialist call.

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

    Allow the guide-booking button to appear in the onboarding chat, not only in the admin room. Broaden the room gate on line 215 to also accept the onboarding conversation:

    const shouldShowGuideBooking =
        !!accountGuideDetails &&
        accountGuideDetails?.email !== CONST.EMAIL.CONCIERGE &&
        !!accountGuideDetails?.calendarLink &&
        (isAdminRoom(report) || isChatUsedForOnboarding) &&
        !!canUserPerformWriteAction(report, isReportArchived) &&
        !isChatThread &&
        introSelected?.companySize !== CONST.ONBOARDING_COMPANY_SIZE.MICRO &&
        introSelected?.companySize !== CONST.ONBOARDING_COMPANY_SIZE.MICRO_SMALL;

    isChatUsedForOnboarding is already derived in this component (currently below this block via isChatUsedForOnboardingReportUtils around line 291), so hoist that computation above shouldShowGuideBooking. The remaining guards (guide assigned, non-Concierge, has calendarLink, company size) are unchanged, so the Calendly link only shows to users who actually have a bookable account executive.

    Regression: verify the admin room still shows the booking button and that non-manage-team / micro-size flows remain unaffected.

  10. melvin-bot commented on Jul 16, 2026

    @melvin-bot

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

  11. samranahm commented on Jul 16, 2026

    @samranahm
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  12. melvin-bot commented on Jul 16, 2026

    @melvin-bot
  13. 35 remaining items

  14. melvin-bot commented on Aug 14, 2026

    @melvin-bot

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

  15. mollfpr commented on Aug 18, 2026

    @mollfpr
    Contributor

    This looks intentional. On the BE, we run a 50/50 A/B test for 11+ employees between control and inboxAdminsBespoke. Only the inboxAdminBespoke variant posts the bespoke Concierge welcome with the Calendly link. The QA video shows the control variant, so the missing link is a side effect of the experiment.

    Related PR: https://github.com/Expensify/Auth/pull/21785

    @marcochavezf could you confirm this is expected, or should the Calendly link also appear on the control variant? If it's expected, can we close this issue?

  16. mananjadhav commented on Aug 18, 2026

    @mananjadhav
    Collaborator

    Thanks for confirming. Once confirmed we can close it.

  17. marcochavezf commented on Aug 18, 2026

    @marcochavezf
    Contributor

    Ah yes, that's correct, when the user is landed in the #admins room with onboarding tasks, we don't show the Calendly link, so we can close it

  18. mananjadhav commented on Aug 21, 2026

    @mananjadhav
    Collaborator

    @mollfpr @marcochavezf Can we close this issue then?

  19. Beamanator commented on Aug 21, 2026

    @Beamanator
    Contributor

    Before closing, let's see if we need to update a test case or something?

  20. melvin-bot commented on Aug 21, 2026

    @melvin-bot

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

  21. mollfpr commented on Aug 24, 2026

    @mollfpr
    Contributor

    Created request for updating the QA test: https://github.com/Expensify/Expensify/issues/674431. Closing this 🙌

  22. neerajbachani commented on Oct 6, 2026

    @neerajbachani
    Contributor

    Proposal

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

    When a new user completes onboarding via Manage my team's expenses → 11–50 employees → an accounting integration such as QuickBooks Desktop (QBD), the welcome message posted in the #admins room shows the generic "Your free trial has started… / I'm your Expensify account executive" copy without the expected Calendly link to book a call. This reproduces on web (Windows Chrome, macOS Chrome/Safari) in staging and production; mobile platforms were not verified in the report.

    What is the root cause of that problem?

    For MANAGE_TEAM, App deliberately defers the #admins welcome to the server. It sets shouldDeferOptimisticTasks = true, skips every optimistic Onyx write of the welcome/sign-off, and generates optimisticConciergeReportActionID so Auth can post the inboxAdminsBespoke welcome (the variant that carries the Calendly link) idempotently:

    App/src/libs/ReportUtils.ts
    Lines 12330 to 12331 in 380ee96

        // Server picks the inboxAdminsBespoke variant at response time, so optimistic writes here would be stale.
        const shouldDeferOptimisticTasks = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM;

    App/src/libs/ReportUtils.ts

    Lines 12330 to 12331 in 380ee96

    // Server picks the inboxAdminsBespoke variant at response time, so optimistic writes here would be stale.
    const shouldDeferOptimisticTasks = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM;

    App/src/libs/ReportUtils.ts
    Lines 12405 to 12406 in 380ee96

        // Auth needs this ID to post the inboxAdminsBespoke welcome idempotently; the real message comes from the server.
        const optimisticConciergeReportActionID: string | undefined = shouldDeferOptimisticTasks ? rand64() : undefined;

    App/src/libs/ReportUtils.ts

    Lines 12405 to 12406 in 380ee96

    // Auth needs this ID to post the inboxAdminsBespoke welcome idempotently; the real message comes from the server.
    const optimisticConciergeReportActionID: string | undefined = shouldDeferOptimisticTasks ? rand64() : undefined;

    That deferral is applied on the Onyx side — the welcome optimistic push is correctly gated:

    App/src/libs/ReportUtils.ts
    Lines 12693 to 12701 in 380ee96

        if (message && !shouldDeferOptimisticTasks) {
            // Server may return empty guidedSetupData for inboxAdminsBespoke; without a real reportAction, the optimistic entry lingers.
            optimisticData.push({
                onyxMethod: Onyx.METHOD.MERGE,
                key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
                value: {
                    [textCommentAction.reportActionID]: textCommentAction as ReportAction,
                },
            });
        }

    App/src/libs/ReportUtils.ts

    Lines 12693 to 12701 in 380ee96

    if (message && !shouldDeferOptimisticTasks) {
    // Server may return empty guidedSetupData for inboxAdminsBespoke; without a real reportAction, the optimistic entry lingers.
    optimisticData.push({
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
    value: {
    [textCommentAction.reportActionID]: textCommentAction as ReportAction,
    },
    });

    …but it is not applied to the payload actually shipped to CompleteGuidedSetup. Right above assembling guidedSetupData, the code states that for a first-run guide-assigned signup (!introSelected?.choice), the backend owns every message and App should only send tasks — yet it unconditionally pushes the client-authored welcome into the wire payload:

    App/src/libs/ReportUtils.ts
    Lines 12829 to 12833 in 380ee96

        // If we post tasks in the #admins room and introSelected?.choice does not exist, it means that a guide is assigned and all messages except tasks are handled by the backend
        const guidedSetupData: GuidedSetupData = [];
        if (message) {
            guidedSetupData.push({type: 'message', ...textMessage});
        }

    App/src/libs/ReportUtils.ts

    Lines 12829 to 12833 in 380ee96

    // If we post tasks in the #admins room and introSelected?.choice does not exist, it means that a guide is assigned and all messages except tasks are handled by the backend
    const guidedSetupData: GuidedSetupData = [];
    if (message) {
    guidedSetupData.push({type: 'message', ...textMessage});
    }

    The repro path is exactly a first signup (introSelected?.choice is unset), so this comment describes the bug scenario. message here is built from onboardingManageTeamMessage, which is static copy with no Calendly URL:

    App/src/languages/en.ts
    Lines 3589 to 3598 in 380ee96

                onboardingManageTeamMessage: ({isOnboardingFlow = false}: {isOnboardingFlow?: boolean}) =>
                    isOnboardingFlow
                        ? Str.dedent(`
                            # Your free trial has started! Let's get you set up.
                            👋 Hey there, I'm your Expensify account executive. I've already created a workspace to help manage your team's receipts and expenses. To make the most of your 30-day free trial, just follow the remaining setup steps below!
                        `)
                        : Str.dedent(`
                            # Your free trial has started! Let's get you set up.
                            👋 Hey there, I'm your Expensify account executive. Now that you've created a workspace, make the most of your 30-day free trial by following the steps below!
                        `),

    App/src/languages/en.ts

    Lines 3589 to 3598 in 380ee96

    onboardingManageTeamMessage: ({isOnboardingFlow = false}: {isOnboardingFlow?: boolean}) =>
    isOnboardingFlow
    ? Str.dedent(`
    # Your free trial has started! Let's get you set up.
    👋 Hey there, I'm your Expensify account executive. I've already created a workspace to help manage your team's receipts and expenses. To make the most of your 30-day free trial, just follow the remaining setup steps below!
    `)
    : Str.dedent(`
    # Your free trial has started! Let's get you set up.
    👋 Hey there, I'm your Expensify account executive. Now that you've created a workspace, make the most of your 30-day free trial by following the steps below!
    `),

    That {type: 'message'} entry is serialized into guidedSetupData and sent to the server:

    App/src/libs/actions/Report/index.ts
    Lines 5858 to 5866 in 380ee96

        const parameters: CompleteGuidedSetupParams = {
            engagementChoice,
            firstName,
            lastName,
            actorAccountID,
            guidedSetupData: JSON.stringify(guidedSetupData),
            paymentSelected,
            companySize,
            userReportedIntegration,

    const parameters: CompleteGuidedSetupParams = {
    engagementChoice,
    firstName,
    lastName,
    actorAccountID,
    guidedSetupData: JSON.stringify(guidedSetupData),
    paymentSelected,
    companySize,
    userReportedIntegration,

    The same half-deferral affects the sign-off message: optimistic Onyx pushes are gated on !shouldDeferOptimisticTasks (line 12910), but the sign-off is still pushed into guidedSetupData unconditionally (line 12937):

    App/src/libs/ReportUtils.ts
    Lines 12908 to 12938 in 380ee96

        if (!skipSignOff && (!introSelected?.choice || introSelected.choice === CONST.ONBOARDING_CHOICES.TEST_DRIVE_RECEIVER)) {
            // inboxAdminsBespoke may skip welcomeSignOff creation, so the optimistic push would linger as stale state.
            if (!shouldDeferOptimisticTasks) {
                optimisticData.push({
                    ...
                });
            }
            guidedSetupData.push({type: 'message', ...welcomeSignOffMessage});
        }

    App/src/libs/ReportUtils.ts

    Lines 12908 to 12938 in 380ee96

    if (!skipSignOff && (!introSelected?.choice || introSelected.choice === CONST.ONBOARDING_CHOICES.TEST_DRIVE_RECEIVER)) {
    // inboxAdminsBespoke may skip welcomeSignOff creation, so the optimistic push would linger as stale state.
    if (!shouldDeferOptimisticTasks) {
    optimisticData.push({
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
    value: {
    [welcomeSignOffCommentAction.reportActionID]: welcomeSignOffCommentAction as ReportAction,
    },
    });
    successData.push({
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
    value: {
    [welcomeSignOffCommentAction.reportActionID]: {pendingAction: null, isOptimisticAction: null},
    },
    });
    failureData.push({
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${targetChatReportID}`,
    value: {
    [welcomeSignOffCommentAction.reportActionID]: {
    errors: getMicroSecondOnyxErrorWithTranslationKey('report.genericAddCommentFailureMessage'),
    } as ReportAction,
    },
    });
    }
    guidedSetupData.push({type: 'message', ...welcomeSignOffMessage});
    }

    Mechanism: App tells the server to post its own link-less welcome via guidedSetupData while simultaneously reserving optimisticConciergeReportActionID for the server-owned bespoke welcome. The plain client copy that lands in #admins matches onboardingManageTeamMessage verbatim, which is consistent with the server honoring the client-supplied message instead of (or in place of) the inboxAdminsBespoke Calendly variant. QBD is not special-cased in App code beyond setting a Control workspace (requiresControlPlan at line 12790); the regression test happened to use QBD + companySize: '11-50' (CONST.ONBOARDING_COMPANY_SIZE.SMALL), the sales-eligible cohort this bespoke path targets.

    This is a regression in the deferral work introduced around PR #89469 / the inboxAdminsBespoke variant: optimistic writes were deferred, but the outbound guidedSetupData message pushes were left behind. Submit/Personal/Chat-split flows are unaffected because shouldDeferOptimisticTasks is false there.

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

    Apply the same !shouldDeferOptimisticTasks guard to the server payload that already guards the optimistic/success/failure writes, so MANAGE_TEAM sends tasks only and leaves the entire welcome sequence (including the Calendly link) to the backend via optimisticConciergeReportActionID:

    // src/libs/ReportUtils.ts — guidedSetupData assembly (~L12830)
    const guidedSetupData: GuidedSetupData = [];
    if (message && !shouldDeferOptimisticTasks) {
        guidedSetupData.push({type: 'message', ...textMessage});
    }
    // src/libs/ReportUtils.ts — sign-off block (~L12937)
    if (!skipSignOff && !shouldDeferOptimisticTasks && (!introSelected?.choice || introSelected.choice === CONST.ONBOARDING_CHOICES.TEST_DRIVE_RECEIVER)) {
        optimisticData.push(/* ...existing optimistic/success/failure pushes... */);
        guidedSetupData.push({type: 'message', ...welcomeSignOffMessage});
    }

    (shouldDeferOptimisticTasks is already true for every MANAGE_TEAM call, so the sign-off condition simplifies to folding the existing !shouldDeferOptimisticTasks guard into the outer if instead of only wrapping the optimistic pushes.)

    Why this is the best fix covering all repro paths:

    • It completes the deferral contract already documented in-code ("all messages except tasks are handled by the backend") and mirrors the three existing optimistic guards at lines 12693, 12716, and 12910 — one flag, one rule.
    • It is the smallest App diff (two condition changes in prepareOnboardingOnyxData, the single convergence point for every onboarding completion path: useCompleteOnboarding, Policy.createWorkspace, etc.).
    • companySize ('11-50') and userReportedIntegration ('quickbooksDesktop') continue to be sent as independent top-level fields and are untouched, so the server still receives everything it needs to pick the correct bespoke variant.
    • Task entries (guidedSetupData.push(...tasksForParameters) at line 12906) are unchanged.

    Regression / blast radius: Only MANAGE_TEAM payloads change; all other onboarding choices keep sending their client messages. Update the unit test at tests/unit/ReportUtilsTest.ts ("should include text message in guidedSetupData for MANAGE_TEAM…") to instead assert no {type: 'message'} entries when engagementChoice === MANAGE_TEAM, while {type: 'task'} entries and optimisticConciergeReportActionID remain present. Add a contrasting non-MANAGE_TEAM case (e.g. PERSONAL_SPEND) asserting its welcome message is still included, to guard against over-filtering.

    Backend note: C+ review requested confirming the Calendly link is emitted server-side for this cohort (UserAPI::buildBespokeWelcomeMessage). This App change removes the client override that blocks that path; if the link is still missing after this fix, a complementary Web-Expensify change would be needed — but the half-applied deferral in App is a definite, independently fixable defect regardless.

    What alternative solutions did you explore? (Optional)

    • Thread account.guideDetails.calendarLink into onboardingManageTeamMessage (nabi-ebrahimi / KJ21-ENG): Rejected — Calendly eligibility depends on company size, integration tier, and guide assignment; that copy is deliberately server-owned (see PR [Payment due @ChavdaSachin] Onboarding: drop cohort gate now that server generates per-tier welcome #89469, which removed client-side bespoke welcome generation). Duplicating it per locale on the client fights the deferral design.
    • Show the header "Schedule call" button in the onboarding chat (ahmdshrif): Rejected — the regression expects the #admins room message body to contain the link, not a separate header affordance gated on isAdminRoom(report).
    • Backend-only fix (yusufdeveloper2903 / C+ preference): Valid as a follow-up if the server already ignores client messages for inboxAdminsBespoke but omits Calendly for QBD; however it does not address the documented App/server contract violation at line 12829 where App still ships link-less messages it explicitly says the backend should own.
    • Centralized boundary filter (dilshodmackbook): guidedSetupData.filter((item) => item.type !== 'message') at return time when shouldDeferOptimisticTasks — equivalent outcome, slightly broader; the targeted guards above are simpler and match the existing per-push pattern.
    • Inject Calendly into en.ts statically (trasnake87 alternative): Rejected — would show the link to non-eligible cohorts (e.g. micro teams) and reintroduce the client/server drift PR [Payment due @ChavdaSachin] Onboarding: drop cohort gate now that server generates per-tier welcome #89469 removed.

    What specific scenarios should we cover in automated tests?

    • When engagementChoice === MANAGE_TEAM, prepareOnboardingOnyxData returns no {type: 'message'} entries in guidedSetupData (neither welcome nor sign-off), but still returns task entries and a defined optimisticConciergeReportActionID.
    • When engagementChoice === PERSONAL_SPEND (or any non-deferred choice), guidedSetupData does contain the welcome {type: 'message'} entry — guards against over-filtering.
    • completeOnboarding / COMPLETE_GUIDED_SETUP request for MANAGE_TEAM + companySize '11-50' + userReportedIntegration 'quickbooksDesktop' still carries companySize, userReportedIntegration, and optimisticConciergeReportActionID as top-level fields independent of guidedSetupData messages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions