Skip to content

[Due for payment 2025-09-17] [$250] Onboarding - "Trial: 30 days left" banner shown on #admins and Concierge chat for "Track" user #68235

Closed

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.91-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: https://test-management.browserstack.com/projects/2219752/folder/13176677/test-cases/41236545
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: MacBook Air 15.5 Chrome, iPhone 15 iOS 18.5 Safari
App Component: Left Hand Navigation (LHN)

Action Performed:

  1. Sign in to ND with a brand new gmail account without +
  2. On the onboarding select "Track and budget" option
  3. On the "Stay organized with a workspace" click "Create workspace"
  4. Complete the onboarding
  5. Observe the #admins and Concierge chat in LHN - there are a trial banner on each of them
  6. Open the Concierge chat - the banner disappears (if not, refresh the page)

Expected Result:

"Trial: 30 days left" banner is shown one time in the LHN

Actual Result:

"Trial: 30 days left" banner is shown on #admins and Concierge chat. After opening Concierge chat the banner disappears

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/~021954941495578711028
  • Upwork Job ID: 1954941495578711028
  • Last Price Increase: 2025-08-25
  • Automatic offers:
    • samranahm | Contributor | 108544528
Issue OwnerCurrent Issue Owner: @ikevin127

Activity

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

    @melvin-bot

    Triggered auto assignment to @isabelastisser (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. samranahm commented on Aug 8, 2025

    @samranahm
    Contributor

    Proposal

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

    Onboarding - "Trial: 30 days left" banner shown on #admins and Concierge chat for "Track" user

    What is the root cause of that problem?

    we display the banner based on isChatUsedForOnboarding here

    {isChatUsedForOnboarding && <FreeTrial badgeStyles={[styles.mnh0, styles.pl2, styles.pr2, styles.ml1, styles.flexShrink1]} />}

    inside isChatUsedForOnboarding we check for onboarding.chatReportID

    App/src/libs/ReportUtils.ts

    Lines 10780 to 10782 in 26c38db

    if (onboarding && !isEmptyObject(onboarding) && onboarding.chatReportID) {
    return onboarding.chatReportID === optionOrReport?.reportID;
    }

    but onboarding is not available immediately and we reach to final return statement

    App/src/libs/ReportUtils.ts

    Lines 10789 to 10791 in 26c38db

    return onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !currentUserEmail?.includes('+')
    ? isAdminRoom(optionOrReport)
    : ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));

    here we check the user choose MANAGE_TEAM return admin room else concierge chat for all other onboardingPurposeSelected that is the reason we get the banner on concierge chat instead of just admin room

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

    we should explicitly check where we are going to post the tasks like we did here

    App/src/libs/ReportUtils.ts

    Lines 10199 to 10201 in 26c38db

    const shouldPostTasksInAdminsRoom =
    [CONST.ONBOARDING_CHOICES.MANAGE_TEAM, CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE].includes(engagementChoice as PostTasksInAdminsRoomOnboardingChoices) &&
    !currentUserEmail?.includes('+');

    and create a new util shouldPostTasksInAdminsRoom in ReportUtils that we will use in prepareOnboardingOnyxData and isChatUsedForOnboarding

    function shouldPostTasksInAdminsRoom(engagementChoice?: OnboardingPurpose) {
        return (
            engagementChoice !== undefined &&
            [CONST.ONBOARDING_CHOICES.MANAGE_TEAM, CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE].includes(engagementChoice as 'newDotManageTeam' | 'newDotTrackWorkspace') &&
            !currentUserEmail?.includes('+')
        );
    }

    and use shouldPostTasksInAdminsRoom in default return to prevent getting the ConciergeChatReport as onboarding when shouldPostTasksInAdminsRoom

    const isPostingTaskInAdminsRoom = shouldPostTasksInAdminsRoom(onboardingPurposeSelected);
    
    
    
    return onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !currentUserEmail?.includes('+')
        ? isAdminRoom(optionOrReport)
        : !isPostingTaskInAdminsRoom && ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));

    here

    App/src/libs/ReportUtils.ts

    Lines 10789 to 10791 in 26c38db

    return onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !currentUserEmail?.includes('+')
    ? isAdminRoom(optionOrReport)
    : ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));

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

    N/A

    What alternative solutions did you explore? (Optional)

    we should explicitly check tasks destination and update the final return

    App/src/libs/ReportUtils.ts

    Lines 10788 to 10791 in 26c38db

    // Guides and onboarding tasks are posted to the #admins room to facilitate the onboarding process.
    return onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !currentUserEmail?.includes('+')
    ? isAdminRoom(optionOrReport)
    : ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));

    to

    // Guides and onboarding tasks are posted to the #admins room to facilitate the onboarding process.
    return shouldPostTasksInAdminsRoom(onboardingPurposeSelected) ? isAdminRoom(optionOrReport) : ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));

    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. FitseTLT commented on Aug 8, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Onboarding - "Trial: 30 days left" banner shown on #admins and Concierge chat for "Track" user

    What is the root cause of that problem?

    In the function, isChatUsedForOnboarding we use onboarding value from file subscription so the badge first appears on the concierge when onboarding.chatReportID didn't exist and then when the value is set by the completeOnboarding the badge will also appear on the admin room (onboarding chat report)

    App/src/libs/ReportUtils.ts

    Lines 10777 to 10791 in b743652

    function isChatUsedForOnboarding(optionOrReport: OnyxEntry<Report> | OptionData, onboardingPurposeSelected?: OnboardingPurpose): boolean {
    // onboarding can be an empty object for old accounts and accounts created from olddot
    if (onboarding && !isEmptyObject(onboarding) && onboarding.chatReportID) {
    return onboarding.chatReportID === optionOrReport?.reportID;
    }
    if (isEmptyObject(onboarding)) {
    return (optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport);
    }
    // Onboarding guides are assigned to signup with emails that do not contain a '+' and select the "Manage my team's expenses" intent.
    // Guides and onboarding tasks are posted to the #admins room to facilitate the onboarding process.
    return onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !currentUserEmail?.includes('+')
    ? isAdminRoom(optionOrReport)
    : ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));
    }

    const isChatUsedForOnboarding = isChatUsedForOnboardingReportUtils(report, onboardingPurpose);

    and the change in value of onboarding doesn't cause a re-render on the concierge LHN (because of file subscription of onboarding value used in the function) so the badge will also remain on concierge until next re-render

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

    BTW the code below

    App/src/libs/ReportUtils.ts

    Lines 10787 to 10791 in 5479138

    // Onboarding guides are assigned to signup with emails that do not contain a '+' and select the "Manage my team's expenses" intent.
    // Guides and onboarding tasks are posted to the #admins room to facilitate the onboarding process.
    return onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !currentUserEmail?.includes('+')
    ? isAdminRoom(optionOrReport)
    : ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));

    was added in here as the comment describes to show the badge on the onboarding admin room for the cases we post onboarding tasks to the onboarding admin room but at the time of its implementation onboarding tasks to the onboarding admin room were only created for MANAGE_TEAM with emails that donot have + but after that in here we added engagementChoice of TRACK_WORKSPACE to the condition

    App/src/libs/ReportUtils.ts

    Lines 10199 to 10201 in 5479138

    const shouldPostTasksInAdminsRoom =
    [CONST.ONBOARDING_CHOICES.MANAGE_TEAM, CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE].includes(engagementChoice as PostTasksInAdminsRoomOnboardingChoices) &&
    !currentUserEmail?.includes('+');

    but isChatUsedForOnboarding was not updated properly to align with it
    We should create a single util shouldPostTasksInAdminsRoom

    function shouldPostTasksInAdminsRoom(engagementChoice) {
        return [CONST.ONBOARDING_CHOICES.MANAGE_TEAM, CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE].includes(engagementChoice) && !currentUserEmail?.includes('+');
    }
    

    and use it in both places here

    App/src/libs/ReportUtils.ts

    Lines 10199 to 10201 in 5479138

    const shouldPostTasksInAdminsRoom =
    [CONST.ONBOARDING_CHOICES.MANAGE_TEAM, CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE].includes(engagementChoice as PostTasksInAdminsRoomOnboardingChoices) &&
    !currentUserEmail?.includes('+');

    and in here

    App/src/libs/ReportUtils.ts

    Lines 10787 to 10791 in 5479138

    // Onboarding guides are assigned to signup with emails that do not contain a '+' and select the "Manage my team's expenses" intent.
    // Guides and onboarding tasks are posted to the #admins room to facilitate the onboarding process.
    return onboardingPurposeSelected === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !currentUserEmail?.includes('+')
    ? isAdminRoom(optionOrReport)
    : ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));

    We will check isAdminRoom if shouldPostTasksInAdminsRoom is true to show the badge on the onboarding admin chat for the case of shouldPostTasksInAdminsRoom

        return shouldPostTasksInAdminsRoom(onboardingPurposeSelected) ? isAdminRoom(optionOrReport) : ((optionOrReport as OptionData)?.isConciergeChat ?? isConciergeChatReport(optionOrReport));
    
    

    But currently we determine whether we shouldPostTasksInAdminsRoom is when we completeOnboarding so in the mean time after creating the workspace (while the choice is PERSONAL_SPEND) the badge is appearing on the concierge temporarily so to avoid that we can return false in isChatUsedForOnboarding if we haven't completed onboarding onboarding?.hasCompletedGuidedSetupFlow and determined whether or not we have created the tasks in admin room. But another alternative is until we complete onboarding we set ONBOARDING_ADMINS_CHAT_REPORT_ID when we created the workspace

    if (shouldCreateWorkspace) {
    setOnboardingAdminsChatReportID(adminsChatReportID);

    so we can use that value as a fallback to onboarding.chatReportID until data is ready or use it to avoid the badge displaying on the concierge.

    In addition to that we will need to pass onboarding as a param to isChatUsedForOnboarding by getting the value from useOnyx subscription so that it re-renders value when changes.

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

    N / A

    What alternative solutions did you explore? (Optional)

  5. samranahm commented on Aug 9, 2025

    @samranahm
    Contributor

    @FitseTLT In believe that based on contributing guides, instead of deleting the original proposal and create a new one after another member post a proposal, we should edit the original one to keep the things transparent. wasn't your original proposal was just about passing the onboarding from onyx because currently it's not updated when we finish onboarding.

  6. samranahm commented on Aug 9, 2025

    @samranahm
    Contributor

    Proposal updated

    Updates

    • Using currentUserEmail from onyx values instead of passing the param
    • Added alternative solution
  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 11, 2025
  8. changed the title [-]Onboarding - "Trial: 30 days left" banner shown on #admins and Concierge chat for "Track" user[/-] [+][$250] Onboarding - "Trial: 30 days left" banner shown on #admins and Concierge chat for "Track" user[/+] on Aug 11, 2025
  9. melvin-bot commented on Aug 11, 2025

    @melvin-bot
  10. melvin-bot commented on Aug 11, 2025

    @melvin-bot

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

  11. 45 remaining items

  12. melvin-bot commented on Sep 10, 2025

    @melvin-bot

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

  13. melvin-bot commented on Sep 10, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.8-4 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-09-17. 🎊

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

  14. melvin-bot commented on Sep 10, 2025

    @melvin-bot

    @ikevin127 @isabelastisser 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]

  15. isabelastisser commented on Sep 12, 2025

    @isabelastisser
    Contributor

    BugZero Checklist:

    • ikevin127 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:
    • ikevin127 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:

    • ikevin127 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:

    • ** ikevin127** 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. ikevin127 commented on Sep 12, 2025

    @ikevin127
    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: N/A - Result of the original design

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

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

    1. Sign up with an email that does not contain + (non-testing email).
    2. In onboarding modal choose Track and budget expenses.
    3. Create workspace (via onboarding flow) and complete the onboarding.
    4. Verify that tasks are posted in the #admins chat report as opposed to Concierge.
    5. Verify that the LHN Trial: 30 days left! badge appears on the #admins chat report as opposed to Concierge.
    Image

    Do we agree 👍 or 👎.

  17. isabelastisser commented on Sep 15, 2025

    @isabelastisser
    Contributor

    Payment summary:

    @ikevin127 requires payment through NewDot Manual Requests for C+ review $250
    @samranahm paid in Upwork automatic offer (Contributor) $250

  18. samranahm commented on Sep 22, 2025

    @samranahm
    Contributor

    Due for payment

  19. isabelastisser commented on Sep 22, 2025

    @isabelastisser
    Contributor

    All set!

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