From 0b034c43fb40c4dc80086e8e3d10d13c1902e6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Tue, 7 Apr 2026 13:54:35 -0600 Subject: [PATCH 1/2] Phase 1: bypass suggestedFollowups beta for MANAGE_TEAM + MICRO cohort Co-Authored-By: Claude Opus 4.6 (1M context) --- src/libs/ReportUtils.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index fa4eb376dbc63..f3295ef7a91c1 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -11725,8 +11725,11 @@ function prepareOnboardingOnyxData({ // Only the MANAGE_TEAM onboarding action uses the #admins room (with a guide); TRACK_WORKSPACE uses Concierge. Excludes emails that have a '+'. const shouldPostTasksInAdminsRoom = isPostingTasksInAdminsRoom(engagementChoice); - // When posting to admins room and the user is in the suggestedFollowups beta, we skip tasks in favor of backend-generated followups. - const shouldUseFollowupsInsteadOfTasks = shouldPostTasksInAdminsRoom && Permissions.isBetaEnabled(CONST.BETAS.SUGGESTED_FOLLOWUPS, betas, betaConfiguration); + // Phase 1 cohort (MANAGE_TEAM + MICRO company size) bypasses the beta gate — the backend + // handles gating via NVP, so all MICRO users get followups without needing the beta flag. + const isPhase1Cohort = companySize === CONST.ONBOARDING_COMPANY_SIZE.MICRO; + // When posting to admins room and the user is in the suggestedFollowups beta (or Phase 1 cohort), we skip tasks in favor of backend-generated followups. + const shouldUseFollowupsInsteadOfTasks = shouldPostTasksInAdminsRoom && (Permissions.isBetaEnabled(CONST.BETAS.SUGGESTED_FOLLOWUPS, betas, betaConfiguration) || isPhase1Cohort); const adminsChatReport = deprecatedAllReports?.[`${ONYXKEYS.COLLECTION.REPORT}${adminsChatReportID}`]; const targetChatReport = shouldPostTasksInAdminsRoom ? (adminsChatReport ?? {reportID: adminsChatReportID, policyID: onboardingPolicyID, chatType: CONST.REPORT.CHAT_TYPE.POLICY_ADMINS}) From 0c14d62a1eb7ee9a122c6eb6dcac85264785d52b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Tue, 7 Apr 2026 16:20:42 -0600 Subject: [PATCH 2/2] Fix test: use non-MICRO company size for without-beta test path The test for "without suggestedFollowups beta" was using MICRO company size, but our change makes MICRO + MANAGE_TEAM users bypass the beta gate. Changed to SMALL so the test still validates the beta gate for non-cohort users. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/unit/ReportUtilsTest.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/ReportUtilsTest.ts b/tests/unit/ReportUtilsTest.ts index 061ada5226b55..f1a1a1c77d0a7 100644 --- a/tests/unit/ReportUtilsTest.ts +++ b/tests/unit/ReportUtilsTest.ts @@ -779,9 +779,10 @@ describe('ReportUtils', () => { }, adminsChatReportID, selectedInterestedFeatures: ['areCompanyCardsEnabled'], - companySize: CONST.ONBOARDING_COMPANY_SIZE.MICRO, + companySize: CONST.ONBOARDING_COMPANY_SIZE.SMALL, }); - // Without the beta, tasks SHOULD be generated (old behavior) + // Without the beta, tasks SHOULD be generated (old behavior) — uses SMALL (not MICRO) + // because MICRO + MANAGE_TEAM users bypass the beta gate and get followups directly expect(result?.guidedSetupData).toHaveLength(3); const taskReportIDs = result?.guidedSetupData.reduce((acc, item) => {