App icon indicating copy to clipboard operation
App copied to clipboard

[$175] [Auto] [EX-50] "Your free trial has started!" welcome message Not displayed in admin room

Open applause-bot[bot] opened this issue 1 month ago • 28 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.25-0 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/13176668/test-cases/41236540 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: web App Component: Other

Action Performed:

  1. Open the link www.staging.new.expensify.com
  2. Sign up with new email address without +
  3. Select the intent "Manage my team's expenses"
  4. Choose 10–50 as the team size
  5. On the ""Select the features you want" modal:"" modal, ensure all default features are selected >> Uncheck Accounting
  6. Select all all optional (additional) features ("Travel", "Rules", "Distance rates", "Expensify Cards", "Tags", "Per Diem" "Time") >> Click Continue
  7. Complete the remaining onboarding setup
  8. Navigate to Workspace settings , ensure WS plan type is "Control"
  9. Navigate to #admins room
  10. Verify "Your free trial has started!" welcome message displayed
  11. Repeat steps several times if not reproduced

Expected Result:

"Your free trial has started!" welcome message should be displayed

Actual Result:

"Your free trial has started!" welcome message is not displayed

Workaround:

Unknown

Platforms:

  • [ ] Android: App
  • [ ] Android: mWeb Chrome
  • [ ] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [x] MacOS: Chrome Safari

Screenshots/Videos

https://github.com/user-attachments/assets/7a659606-a34b-4ec2-80e6-e9094ff577ef

View all open jobs on GitHub

Applause Internal Information Exported by: Julia Ponikarchuk Bug ID: 7299495

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

applause-bot[bot] avatar Oct 29 '26 18:10 applause-bot[bot]

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

applause-bot[bot] avatar Oct 29 '26 18:10 applause-bot[bot]

Issue Analysis

Root Cause: This appears to be a backend/internal issue. A separate internal investigation is needed.

The App never posts "Your free trial has started!" to #admins itself for the "Manage my team's expenses" intent. It sends the text to the backend in CompleteGuidedSetup, and the backend decides which welcome message to post, if any. The App shows only what comes back.

Recommended Fix: No App change recommended. The fix is outside the App repo, so please escalate to an internal engineer with backend access.

Investigation details

What the App does (public code, SHA dd9296e)

Ruled out on the App side

  • Feature selection or Control upgrade race: the selected features and the Control plan go into one CreateWorkspace call. completeOnboarding waits for that write before it calls CompleteGuidedSetup. No separate upgrade call can race the message.
  • Accounting unchecked: this only removes the accounting tasks. The message stays.

Things to check on the tester side

  • Emails containing + post onboarding to the Concierge DM, not #admins: src/libs/ReportUtils.ts:14262-14266. The repro already says "without +", so this probably doesn't apply.
  • For an affected account, check the CompleteGuidedSetup response. Note the returned onboarding variant and whether it posted a comment to the #admins report.

Related issues


Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.


view run

MelvinBot avatar Oct 29 '26 18:10 MelvinBot

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

melvin-bot[bot] avatar Oct 29 '26 18:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022115876929620283351

melvin-bot[bot] avatar Oct 29 '26 18:10 melvin-bot[bot]

Proposal:

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

When completing guided onboarding with the "Manage my team's expenses" intent (MANAGE_TEAM), selecting workspace features that configure a Control plan, and navigating to the #admins room, the "Your free trial has started!" welcome message is intermittently not displayed.

What is the root cause of that problem?

  1. Client-side optimistic deferral: In src/libs/ReportUtils.ts:13498-13500, optimistic writes for the welcome message are explicitly suppressed for the MANAGE_TEAM flow:

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

    Because shouldDeferOptimisticTasks is true, lines 13904–13912 and 13926–13934 in ReportUtils.ts do not push textCommentAction (onboardingManageTeamMessage from src/languages/en.ts:4309) to optimisticData or successData.

  2. Delegation to Auth backend: Instead of writing locally, the App generates optimisticConciergeReportActionID (ReportUtils.ts:13575) and passes it along with guidedSetupData to the CompleteGuidedSetup command (src/libs/actions/Report/index.ts:6547). The App relies entirely on the server to create and return the welcome reportAction for the #admins room.

  3. A/B Variant dependency explains the intermittent reproduction: As defined in src/types/onyx/OnboardingRHPVariant.ts:8, Expensify uses the inboxAdminsBespoke variant ("Bespoke welcome message delivered in #admins room instead of onboarding tasks"). Because the server assigns this variant per-user dynamically, users assigned to the bespoke variant (or when Auth backend omits the welcome reportAction for the selected Control features) receive no standard "Your free trial has started!" reportAction from the server.

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

There are two potential paths depending on internal architecture intent:

  • Option A (Backend / Auth fix or Test Case update — Recommended): This behavior is largely by design on the App client following PR #91685 ("Update MANAGE_TEAM onboarding: skip stale optimistic writes and navigate from API response"). If the welcome message is expected to appear in all cases:

    1. Auth's backend handler for CompleteGuidedSetup needs to ensure the welcome reportAction is created and returned in the response for this onboarding feature combination.
    2. Alternatively, if inboxAdminsBespoke intentionally replaces or omits this message, the Applause regression test case [41236540] needs to be updated to account for A/B variant assignments.
  • Option B (App frontend fallback reconciliation): If the team wants the App to guarantee the welcome message on the client without waiting on the server: In src/hooks/useCompleteOnboarding.ts and src/libs/actions/Report/index.ts, inspect extractRHPVariantFromResponse(response). If the returned variant is control (not inboxAdminsBespoke), and no welcome reportAction was returned in response.onyxData, dispatch a client-side action adding onboardingMessages[CONST.ONBOARDING_CHOICES.MANAGE_TEAM].message to #admins room. This avoids the stale optimistic write problem that PR #91685 resolved while ensuring the message is never missing.

What alternative solutions did you explore? (Optional)

Re-enabling optimistic writes unconditionally in prepareOnboardingOnyxData (shouldDeferOptimisticTasks = false): Rejected because it directly reverts the fix in PR #91685 and causes stale / duplicate reportActions when the server assigns the inboxAdminsBespoke variant.

What automated tests can you add to prevent this from re-occurring?

In tests/unit/ReportUtilsTest.ts and tests/unit/OnboardingFlowTest.ts:

  • Verify prepareOnboardingOnyxData correctly populates optimisticConciergeReportActionID for MANAGE_TEAM.
  • If Option B is adopted, add a unit test in tests/unit/useCompleteOnboardingTest.ts verifying fallback welcome action generation when CompleteGuidedSetup responds with control variant.

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~014bb7d4c250a1fe03

Abdibaye avatar Oct 29 '26 19:10 Abdibaye

⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.

melvin-bot[bot] avatar Oct 29 '26 19:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~014bb7d4c250a1fe03

Abdibaye avatar Oct 29 '26 19:10 Abdibaye

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 29 '26 19:10 melvin-bot[bot]

Proposal

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

When signing up with a new email, choosing "Manage my team's expenses", selecting 10-50 team size, and enabling workspace features, the "Your free trial has started!" welcome message is intermittently missing when navigating to the #admins room.

What is the root cause of that problem?

  1. In src/libs/ReportUtils.ts:13550-13552, optimistic writes are explicitly deferred for MANAGE_TEAM onboarding:
    const shouldDeferOptimisticTasks = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM;
    
    Because shouldDeferOptimisticTasks is true, lines 13955-13965 suppress adding textCommentAction ("# Your free trial has started! Let's get you set up.") to optimisticData and successData. The client delegates message creation to the server via guidedSetupData in CompleteGuidedSetup (src/libs/ReportUtils.ts:14112-14115).
  2. In src/hooks/useCompleteOnboarding.ts:138-142 and src/libs/navigateAfterOnboarding.ts:139-148, when the server assigns the account to the CONST.ONBOARDING_RHP_VARIANT.HOME_PAGE_NO_RHP (homePageNoRHP) experiment arm, onboarding is routed to /home (ROUTES.HOME) rather than #admins, and the server does not return a report action for the #admins welcome message.
  3. Consequently, when the user manually navigates to #admins, the room renders in its empty state because optimistic task/message insertion was deferred by shouldDeferOptimisticTasks and no #admins welcome message was returned in response.onyxData.

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

In src/hooks/useCompleteOnboarding.ts (or inside completeOnboarding in src/libs/actions/Report/index.ts), reconcile the #admins welcome message when shouldDeferOptimisticTasks is active and the server response for CompleteGuidedSetup omits the #admins welcome action (such as under HOME_PAGE_NO_RHP):

  1. In src/libs/ReportUtils.ts, keep shouldDeferOptimisticTasks for the checklist tasks so bespoke server task variants are not overwritten, or include the deterministic textCommentAction ("# Your free trial has started! Let's get you set up.") for adminsChatReportID when shouldPostTasksInAdminsRoom is true so #admins always contains the welcome header regardless of which RHP experiment variant is selected.
  2. Add a unit test in tests/unit/ReportUtilsTest.ts verifying that prepareOnboardingOnyxData for CONST.ONBOARDING_CHOICES.MANAGE_TEAM preserves the #admins welcome message action while still deferring bespoke checklist tasks.

What alternative solutions did you explore? (Optional)

  • Setting shouldDeferOptimisticTasks = false for all tasks: Explored and rejected because it reintroduces stale optimistic task lists before the server picks the inboxAdminsBespoke variant (regressing PR #91685).

duongynhi000005-oss avatar Nov 01 '26 18:11 duongynhi000005-oss

@aimane-chnaif Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 04 '26 00:11 melvin-bot[bot]

@aimane-chnaif Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 04 '26 02:11 melvin-bot[bot]

@aimane-chnaif Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 04 '26 03:11 melvin-bot[bot]

@aimane-chnaif 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Nov 05 '26 21:11 melvin-bot[bot]

Not reproducible

Image

aimane-chnaif avatar Nov 06 '26 20:11 aimane-chnaif

📣 @ronanchnlps-bit! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 07 '26 10:11 melvin-bot[bot]

Proposal

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

When signing up with a new email address (without +), selecting the "Manage my team's expenses" (CONST.ONBOARDING_CHOICES.MANAGE_TEAM) intent, choosing team size 10–50, configuring workspace features that create a Control plan workspace, and navigating to the #admins room, the "Your free trial has started! Let's get you set up." welcome message is intermittently not displayed.

What is the root cause of that problem?

  1. Client-side deferral of textCommentAction for MANAGE_TEAM in prepareOnboardingOnyxData (src/libs/ReportUtils.ts, lines 13740, 14118, 14145–14175, 14235–14245): In prepareOnboardingOnyxData:

e5ash avatar Nov 07 '26 15:11 e5ash

Proposal

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

When signing up with a new account, selecting the "Manage my team's expenses" onboarding intent (MANAGE_TEAM), choosing team size 10–50, selecting optional workspace features (Control plan), and navigating to the #admins room, the "Your free trial has started!" welcome message is not displayed in #admins.

What is the root cause of that problem?

  1. In src/libs/ReportUtils.ts (lines 13547–13552), buildOptimisticOnboardingData sets: const shouldDeferOptimisticTasks = engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM;. As noted in the code comment (// Server picks the inboxAdminsBespoke variant at response time, so optimistic writes here would be stale), when shouldDeferOptimisticTasks is true, the client intentionally skips pushing textCommentAction (onboardingManageTeamMessage, which starts with "# Your free trial has started! Let's get you set up." in src/languages/en.ts:4309) into optimisticData and successData (lines 13952–13985).
  2. Instead, the client passes optimisticConciergeReportActionID and guidedSetupData (containing the welcome message payload) to the backend CompleteGuidedSetup API command (src/libs/actions/Report/index.ts, line 6547), delegating creation of the #admins welcome message to the server based on the assigned onboardingRHPVariant.
  3. When the server assigns the new account to the CONST.ONBOARDING_RHP_VARIANT.HOME_PAGE_NO_RHP (homePageNoRHP) experiment arm (handled in src/hooks/useCompleteOnboarding.ts:138-142 and src/libs/navigateAfterOnboarding.ts:139-148), post-onboarding navigation routes the user to /home (ROUTES.HOME) rather than #admins, and the backend omits posting the bespoke #admins trial welcome message.

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

  1. Because the decision of whether to post the #admins welcome message during MANAGE_TEAM onboarding is controlled on the backend inside CompleteGuidedSetup (and varies by the server-assigned onboardingRHPVariant), no frontend change in Expensify/App should override shouldDeferOptimisticTasks.
  2. Either escalate to a backend engineer if CompleteGuidedSetup is intended to always post the trial welcome message in #admins even under the homePageNoRHP variant, or update BrowserStack test case 41236540 to account for the homePageNoRHP onboarding experiment variant.

What alternative solutions did you explore? (Optional)

We considered removing shouldDeferOptimisticTasks in src/libs/ReportUtils.ts so the client always writes the standard onboardingManageTeamMessage optimistically, but that would conflict with the server's inboxAdminsBespoke message variant and produce duplicate or stale welcome messages in #admins.

ghost avatar Nov 08 '26 15:11 ghost

📣 @jeff-graham-ai! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 08 '26 15:11 melvin-bot[bot]

@aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Nov 09 '26 22:11 melvin-bot[bot]

@aimane-chnaif Eep! 4 days overdue now. Issues have feelings too...

melvin-bot[bot] avatar Nov 11 '26 21:11 melvin-bot[bot]