From 2814fb95bc400a012bfd0127660843bf6617ab00 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 12 Mar 2026 14:41:59 +0530 Subject: [PATCH 1/3] Part 4 - Thread betas through getGuidedSetupDataForOpenReport to prepareOnboardingOnyxData Signed-off-by: krishna2323 --- .../MoneyRequestReportActionsList.tsx | 5 +++-- .../AppNavigator/AuthScreensInitHandler.tsx | 3 ++- src/libs/actions/Report/index.ts | 15 ++++++++++---- src/pages/NewChatConfirmPage.tsx | 14 +++++++++++-- .../Search/SearchMoneyRequestReportPage.tsx | 5 +++-- src/pages/Share/ShareDetailsPage.tsx | 2 ++ src/pages/TransactionDuplicate/Review.tsx | 5 +++-- src/pages/inbox/ReportScreen.tsx | 20 +++++++++++++++---- .../BaseReportActionContextMenu.tsx | 1 + .../report/ContextMenu/ContextMenuActions.tsx | 5 +++-- src/pages/inbox/report/ReportActionsList.tsx | 5 +++-- .../withReportAndReportActionOrNotFound.tsx | 2 +- .../inbox/report/withReportOrNotFound.tsx | 2 +- .../request/step/IOURequestStepDistance.tsx | 2 +- .../step/IOURequestStepDistanceMap.tsx | 2 +- .../step/withWritableReportOrNotFound.tsx | 3 ++- .../routes/TransactionReceiptModalContent.tsx | 3 ++- .../ReportAddAttachmentModalContent/index.tsx | 5 +++-- .../report/ReportAttachmentModalContent.tsx | 5 +++-- tests/actions/ReportTest.ts | 4 ++-- 20 files changed, 75 insertions(+), 33 deletions(-) diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx index 9d36a095ee32b..c660d932d9385 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx @@ -167,6 +167,7 @@ function MoneyRequestReportActionsList({ const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT); const isTryNewDotNVPDismissed = !!tryNewDot?.classicRedirect?.dismissed; const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const {isDelegateAccessRestricted} = useDelegateNoAccessState(); const {showDelegateNoAccessModal} = useDelegateNoAccessActions(); @@ -732,7 +733,7 @@ function MoneyRequestReportActionsList({ setIsFloatingMessageCounterVisible(false); if (!hasNewestReportAction) { - openReport({reportID: report.reportID, introSelected}); + openReport({reportID: report.reportID, introSelected, betas}); reportScrollManager.scrollToEnd(); return; } @@ -740,7 +741,7 @@ function MoneyRequestReportActionsList({ reportScrollManager.scrollToEnd(); readActionSkipped.current = false; readNewestAction(report.reportID, !!reportMetadata?.hasOnceLoadedReportActions); - }, [setIsFloatingMessageCounterVisible, hasNewestReportAction, reportScrollManager, report.reportID, reportMetadata?.hasOnceLoadedReportActions]); + }, [setIsFloatingMessageCounterVisible, hasNewestReportAction, reportScrollManager, report.reportID, reportMetadata?.hasOnceLoadedReportActions, introSelected, betas]); const scrollToNewTransaction = useCallback( (pageY: number) => { diff --git a/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx b/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx index cdab34aaa0e7a..0ab9fe8ec596d 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx @@ -51,6 +51,7 @@ function AuthScreensInitHandler() { const [session] = useOnyx(ONYXKEYS.SESSION); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const [initialLastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector}); @@ -122,7 +123,7 @@ function AuthScreensInitHandler() { } else if (SessionUtils.didUserLogInDuringSession()) { const reportID = getReportIDFromLink(initialURL ?? null); if (reportID && !isAuthenticatedAtStartup) { - Report.openReport({reportID, introSelected}); + Report.openReport({reportID, introSelected, betas}); // Don't want to call `openReport` again when logging out and then logging in setIsAuthenticatedAtStartup(true); } diff --git a/src/libs/actions/Report/index.ts b/src/libs/actions/Report/index.ts index 410d95d1e7dbe..582a9125627f5 100644 --- a/src/libs/actions/Report/index.ts +++ b/src/libs/actions/Report/index.ts @@ -316,6 +316,9 @@ type OpenReportActionParams = { /** The current user's account ID */ currentUserAccountID?: number; + + /** Beta features list */ + betas?: OnyxEntry; }; type PregeneratedResponseParams = { @@ -1165,7 +1168,7 @@ type GuidedSetupDataForOpenReport = { * Returns the onyx data arrays and guidedSetupData string to include in the API parameters, * or undefined if no guided setup is needed. */ -function getGuidedSetupDataForOpenReport(introSelected: OnyxEntry): GuidedSetupDataForOpenReport | undefined { +function getGuidedSetupDataForOpenReport(introSelected: OnyxEntry, betas: OnyxEntry): GuidedSetupDataForOpenReport | undefined { const isInviteOnboardingComplete = introSelected?.isInviteOnboardingComplete ?? false; const isOnboardingCompleted = onboarding?.hasCompletedGuidedSetupFlow ?? false; @@ -1199,6 +1202,7 @@ function getGuidedSetupDataForOpenReport(introSelected: OnyxEntry engagementChoice: choice, onboardingMessage, companySize: introSelected?.companySize as OnboardingCompanySize, + betas, }); if (!onboardingData) { @@ -1244,6 +1248,7 @@ function openReport(params: OpenReportActionParams) { optimisticSelfDMReport, currentUserLogin, currentUserAccountID, + betas, } = params; if (!reportID) { return; @@ -1465,7 +1470,7 @@ function openReport(params: OpenReportActionParams) { }); } - const guidedSetup = getGuidedSetupDataForOpenReport(introSelected); + const guidedSetup = getGuidedSetupDataForOpenReport(introSelected, betas); if (guidedSetup) { optimisticData.push(...guidedSetup.optimisticData); successData.push(...guidedSetup.successData); @@ -1644,6 +1649,7 @@ function createGroupChat( currentUserLogin: string, introSelected: OnyxEntry, avatar?: File | CustomRNImageManipulatorResult, + betas?: OnyxEntry, ) { const optimisticReport = { reportName: CONST.REPORT.DEFAULT_REPORT_NAME, @@ -1804,7 +1810,7 @@ function createGroupChat( } // Preserve guided setup data when creating group chats - const guidedSetup = getGuidedSetupDataForOpenReport(introSelected); + const guidedSetup = getGuidedSetupDataForOpenReport(introSelected, betas); if (guidedSetup) { optimisticData.push(...guidedSetup.optimisticData); successData.push(...guidedSetup.successData); @@ -1975,12 +1981,13 @@ function navigateToAndCreateGroupChat( introSelected: OnyxEntry, avatarUri?: string, avatarFile?: File | CustomRNImageManipulatorResult | undefined, + betas?: OnyxEntry, ) { const participantAccountIDs = PersonalDetailsUtils.getAccountIDsByLogins(userLogins); // If we are creating a group chat then participantAccountIDs is expected to contain currentUserAccountID const newChat = buildOptimisticGroupChatReport(participantAccountIDs, reportName, avatarUri ?? '', optimisticReportID, CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN); - createGroupChat(newChat.reportID, userLogins, newChat, currentUserLogin, introSelected, avatarFile); + createGroupChat(newChat.reportID, userLogins, newChat, currentUserLogin, introSelected, avatarFile, betas); navigateToReport(newChat.reportID); } diff --git a/src/pages/NewChatConfirmPage.tsx b/src/pages/NewChatConfirmPage.tsx index f07192c6fda58..589a20fb9c03e 100644 --- a/src/pages/NewChatConfirmPage.tsx +++ b/src/pages/NewChatConfirmPage.tsx @@ -44,6 +44,7 @@ function NewChatConfirmPage() { const [newGroupDraft, newGroupDraftMetaData] = useOnyx(ONYXKEYS.NEW_GROUP_CHAT_DRAFT); const [allPersonalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const icons = useMemoizedLazyExpensifyIcons(['Camera']); @@ -101,8 +102,17 @@ function NewChatConfirmPage() { } const logins: string[] = (newGroupDraft.participants ?? []).map((participant) => participant.login).filter((login): login is string => !!login); - navigateToAndCreateGroupChat(logins, newGroupDraft.reportName ?? '', personalData.login ?? '', optimisticReportID.current, introSelected, newGroupDraft.avatarUri ?? '', avatarFile); - }, [newGroupDraft, avatarFile, personalData.login, introSelected]); + navigateToAndCreateGroupChat( + logins, + newGroupDraft.reportName ?? '', + personalData.login ?? '', + optimisticReportID.current, + introSelected, + newGroupDraft.avatarUri ?? '', + avatarFile, + betas, + ); + }, [newGroupDraft, avatarFile, personalData.login, introSelected, betas]); const stashedLocalAvatarImage = newGroupDraft?.avatarUri; diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index 2426db655a680..690565e2ffb76 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -158,6 +158,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.chatReportID}`); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const {reportActions: unfilteredReportActions} = usePaginatedReportActions(reportIDFromRoute); const {transactions: allReportTransactions, violations: allReportViolations} = useTransactionsAndViolationsForReport(reportIDFromRoute); const reportActions = useMemo(() => getFilteredReportActionsForReportView(unfilteredReportActions), [unfilteredReportActions]); @@ -247,7 +248,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { return; } - openReport({reportID: reportIDFromRoute, introSelected}); + openReport({reportID: reportIDFromRoute, introSelected, betas}); isInitialMountRef.current = false; // oneTransactionID dependency handles the case when deleting a transaction: @@ -256,7 +257,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { // For more details see https://github.com/Expensify/App/pull/80107 // We don't want this hook to re-run on the every report change // eslint-disable-next-line react-hooks/exhaustive-deps - }, [reportIDFromRoute, transactionThreadReportID, oneTransactionID]); + }, [reportIDFromRoute, transactionThreadReportID, oneTransactionID, betas]); useEffect(() => { hasCreatedLegacyThreadRef.current = false; diff --git a/src/pages/Share/ShareDetailsPage.tsx b/src/pages/Share/ShareDetailsPage.tsx index 0bb1a4b77e608..fd11ae357ad2a 100644 --- a/src/pages/Share/ShareDetailsPage.tsx +++ b/src/pages/Share/ShareDetailsPage.tsx @@ -54,6 +54,7 @@ function ShareDetailsPage({route}: ShareDetailsPageProps) { const [currentAttachment] = useOnyx(ONYXKEYS.SHARE_TEMP_FILE); const [validatedFile] = useOnyx(ONYXKEYS.VALIDATED_FILE_OBJECT); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const reportAttributesDerived = useReportAttributes(); const personalDetails = usePersonalDetails(); @@ -157,6 +158,7 @@ function ShareDetailsPage({route}: ShareDetailsPageProps) { introSelected, participantLoginList: displayReport.participantsList?.filter((u) => u.accountID !== personalDetail.accountID).map((u) => u.login ?? '') ?? [], newReportObject: report, + betas, }); } if (report.reportID) { diff --git a/src/pages/TransactionDuplicate/Review.tsx b/src/pages/TransactionDuplicate/Review.tsx index 9d1afd5436b77..cca57d80a8555 100644 --- a/src/pages/TransactionDuplicate/Review.tsx +++ b/src/pages/TransactionDuplicate/Review.tsx @@ -72,6 +72,7 @@ function TransactionDuplicateReview() { const originalTransactionIDsListRef = useRef(null); const [transactionIDsList = getEmptyArray()] = useOnyx(ONYXKEYS.TRANSACTION_THREAD_NAVIGATION_TRANSACTION_IDS); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const onPreviewPressed = useCallback( (reportID: string) => { @@ -115,8 +116,8 @@ function TransactionDuplicateReview() { if (!route.params.threadReportID || report?.reportID) { return; } - openReport({reportID: route.params.threadReportID, introSelected}); - }, [report?.reportID, route.params.threadReportID, introSelected]); + openReport({reportID: route.params.threadReportID, introSelected, betas}); + }, [report?.reportID, route.params.threadReportID, introSelected, betas]); useEffect(() => { if (!transactionID) { diff --git a/src/pages/inbox/ReportScreen.tsx b/src/pages/inbox/ReportScreen.tsx index faf4e4cf44e47..75c3441f9ca15 100644 --- a/src/pages/inbox/ReportScreen.tsx +++ b/src/pages/inbox/ReportScreen.tsx @@ -176,6 +176,7 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr const [reportMetadata = defaultReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${getNonEmptyStringOnyxID(reportOnyx?.policyID)}`); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const [onboarding] = useOnyx(ONYXKEYS.NVP_ONBOARDING); const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); @@ -578,8 +579,19 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr } } - openReport({reportID: reportIDFromRoute, introSelected, reportActionID: reportActionIDFromRoute}); - }, [reportMetadata.isOptimisticReport, report, isOffline, isLoadingApp, introSelected, isOnboardingCompleted, isInviteOnboardingComplete, reportIDFromRoute, reportActionIDFromRoute]); + openReport({reportID: reportIDFromRoute, introSelected, reportActionID: reportActionIDFromRoute, betas}); + }, [ + reportMetadata.isOptimisticReport, + report, + isOffline, + isLoadingApp, + introSelected, + isOnboardingCompleted, + isInviteOnboardingComplete, + reportIDFromRoute, + reportActionIDFromRoute, + betas, + ]); useEffect(() => { if (!isAnonymousUser) { @@ -704,12 +716,12 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr if (!shouldUseNarrowLayout || !isFocused || prevIsFocused || !isChatThread(report) || !isHiddenForCurrentUser(report) || isTransactionThreadView) { return; } - openReport({reportID, introSelected}); + openReport({reportID, introSelected, betas}); // We don't want to run this useEffect every time `report` is changed // Excluding shouldUseNarrowLayout from the dependency list to prevent re-triggering on screen resize events. // eslint-disable-next-line react-hooks/exhaustive-deps - }, [prevIsFocused, report?.participants, isFocused, isTransactionThreadView, reportID]); + }, [prevIsFocused, report?.participants, isFocused, isTransactionThreadView, reportID, introSelected, betas]); useEffect(() => { // We don't want this effect to run on the first render. diff --git a/src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx b/src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx index cdd2b00540366..cec67f178b81d 100755 --- a/src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx +++ b/src/pages/inbox/report/ContextMenu/BaseReportActionContextMenu.tsx @@ -401,6 +401,7 @@ function BaseReportActionContextMenu({ translate, harvestReport, introSelected, + betas, isDelegateAccessRestricted, showDelegateNoAccessModal, currentUserAccountID: currentUserPersonalDetails?.accountID, diff --git a/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx b/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx index f4d00e325f3c3..64f447c9705de 100644 --- a/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx @@ -283,6 +283,7 @@ type ContextMenuActionPayload = { translate: LocalizedTranslate; harvestReport?: OnyxEntry; introSelected: OnyxEntry; + betas: OnyxEntry; isDelegateAccessRestricted?: boolean; showDelegateNoAccessModal?: () => void; currentUserPersonalDetails: ReturnType; @@ -507,11 +508,11 @@ const ContextMenuActions: ContextMenuAction[] = [ icon: 'Pencil', shouldShow: ({type, reportAction, isArchivedRoom, isChronosReport, moneyRequestAction}) => type === CONST.CONTEXT_MENU_TYPES.REPORT_ACTION && (canEditReportAction(reportAction) || canEditReportAction(moneyRequestAction)) && !isArchivedRoom && !isChronosReport, - onPress: (closePopover, {reportID, reportAction, draftMessage, moneyRequestAction, introSelected}) => { + onPress: (closePopover, {reportID, reportAction, draftMessage, moneyRequestAction, introSelected, betas}) => { if (isMoneyRequestAction(reportAction) || isMoneyRequestAction(moneyRequestAction)) { const editExpense = () => { const childReportID = reportAction?.childReportID; - openReport({reportID: childReportID, introSelected}); + openReport({reportID: childReportID, introSelected, betas}); Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(childReportID)); }; if (closePopover) { diff --git a/src/pages/inbox/report/ReportActionsList.tsx b/src/pages/inbox/report/ReportActionsList.tsx index b483433b35307..a7aba0f5e5c77 100644 --- a/src/pages/inbox/report/ReportActionsList.tsx +++ b/src/pages/inbox/report/ReportActionsList.tsx @@ -219,6 +219,7 @@ function ReportActionsList({ const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT); const isTryNewDotNVPDismissed = !!tryNewDot?.classicRedirect?.dismissed; const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const [isScrollToBottomEnabled, setIsScrollToBottomEnabled] = useState(false); const [actionIdToHighlight, setActionIdToHighlight] = useState(''); const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${report.reportID}`); @@ -659,14 +660,14 @@ function ReportActionsList({ if (!Navigation.getReportRHPActiveRoute()) { Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID, undefined, undefined, backTo)); } - openReport({reportID: report.reportID, introSelected}); + openReport({reportID: report.reportID, introSelected, betas}); reportScrollManager.scrollToBottom(); return; } reportScrollManager.scrollToBottom(); readActionSkipped.current = false; readNewestAction(report.reportID, !!reportMetadata?.hasOnceLoadedReportActions); - }, [setIsFloatingMessageCounterVisible, hasNewestReportAction, reportScrollManager, report.reportID, backTo, introSelected, reportMetadata?.hasOnceLoadedReportActions]); + }, [setIsFloatingMessageCounterVisible, hasNewestReportAction, reportScrollManager, report.reportID, backTo, introSelected, reportMetadata?.hasOnceLoadedReportActions, betas]); /** * Calculates the ideal number of report actions to render in the first render, based on the screen height and on diff --git a/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx b/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx index 9dc2865a76b1e..8d722eb84561a 100644 --- a/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx +++ b/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx @@ -67,7 +67,7 @@ export default function { - openReport({reportID, introSelected, reportActionID}); - }, [reportID, introSelected, reportActionID]); + openReport({reportID, introSelected, reportActionID, betas}); + }, [reportID, introSelected, reportActionID, betas]); // Close the modal if user loses write access (e.g., admin switches "Who can post" to Admins only) useEffect(() => { diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx index fdafd9c7c8975..be7fc3d58f80a 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx @@ -28,6 +28,7 @@ function ReportAttachmentModalContent({route, navigation}: AttachmentModalScreen canEvict: false, }); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); + const [betas] = useOnyx(ONYXKEYS.BETAS); const reportActionID = useMemo(() => attachmentID?.split('_')?.[0], [attachmentID]); const originalReportID = useOriginalReportID(reportID, reportActionID ? (reportActions?.[reportActionID ?? CONST.DEFAULT_NUMBER_ID] ?? {reportActionID}) : undefined); @@ -56,8 +57,8 @@ function ReportAttachmentModalContent({route, navigation}: AttachmentModalScreen }, [isOffline, reportActionReportID, isLoadingApp, report, reportMetadata?.isLoadingInitialReportActions, shouldFetchReport]); const fetchReport = useCallback(() => { - openReport({reportID: reportActionReportID, introSelected, reportActionID}); - }, [reportActionReportID, introSelected, reportActionID]); + openReport({reportID: reportActionReportID, introSelected, reportActionID, betas}); + }, [reportActionReportID, introSelected, reportActionID, betas]); useEffect(() => { if (!reportActionReportID || !shouldFetchReport) { diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index 8cb7f83161cf2..aad7b3b7a3417 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -5603,7 +5603,7 @@ describe('actions/Report', () => { await waitForBatchedUpdates(); const introSelected: OnyxTypes.IntroSelected = {choice: CONST.ONBOARDING_CHOICES.ADMIN, isInviteOnboardingComplete: true}; - const result = Report.getGuidedSetupDataForOpenReport(introSelected); + const result = Report.getGuidedSetupDataForOpenReport(introSelected, undefined); expect(result).toBeUndefined(); }); @@ -5613,7 +5613,7 @@ describe('actions/Report', () => { await waitForBatchedUpdates(); const introSelected: OnyxTypes.IntroSelected = {choice: CONST.ONBOARDING_CHOICES.ADMIN, isInviteOnboardingComplete: false}; - const result = Report.getGuidedSetupDataForOpenReport(introSelected); + const result = Report.getGuidedSetupDataForOpenReport(introSelected, undefined); expect(result).toBeDefined(); expect(result?.guidedSetupData).toBeDefined(); From 614c2539ad04383b57c8b9570933f7c7aeb3c69d Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Thu, 12 Mar 2026 15:31:16 +0530 Subject: [PATCH 2/3] Add TODO comments for removing optional betas param after buildPolicyData cleanup. Signed-off-by: krishna2323 --- src/libs/actions/Report/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report/index.ts b/src/libs/actions/Report/index.ts index 582a9125627f5..f99a8167520ab 100644 --- a/src/libs/actions/Report/index.ts +++ b/src/libs/actions/Report/index.ts @@ -317,7 +317,7 @@ type OpenReportActionParams = { /** The current user's account ID */ currentUserAccountID?: number; - /** Beta features list */ + /** Beta features list. TODO: Remove optional (?) once buildPolicyData is updated (https://github.com/Expensify/App/issues/66417) */ betas?: OnyxEntry; }; @@ -1649,6 +1649,7 @@ function createGroupChat( currentUserLogin: string, introSelected: OnyxEntry, avatar?: File | CustomRNImageManipulatorResult, + // TODO: Remove optional (?) once buildPolicyData is updated (https://github.com/Expensify/App/issues/66417) betas?: OnyxEntry, ) { const optimisticReport = { @@ -1981,6 +1982,7 @@ function navigateToAndCreateGroupChat( introSelected: OnyxEntry, avatarUri?: string, avatarFile?: File | CustomRNImageManipulatorResult | undefined, + // TODO: Remove optional (?) once buildPolicyData is updated (https://github.com/Expensify/App/issues/66417) betas?: OnyxEntry, ) { const participantAccountIDs = PersonalDetailsUtils.getAccountIDsByLogins(userLogins); From 29877d0973c0eb1d715047ed93c526a1342edab3 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Fri, 13 Mar 2026 11:00:45 +0530 Subject: [PATCH 3/3] add betas test. Signed-off-by: krishna2323 --- tests/actions/ReportTest.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index aad7b3b7a3417..0c9e44f991c72 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -5621,6 +5621,22 @@ describe('actions/Report', () => { expect(result?.successData).toBeDefined(); expect(result?.failureData).toBeDefined(); }); + + it('should return guided setup data when betas are explicitly passed', async () => { + await setupUserWithConciergeChat(); + await Onyx.merge(ONYXKEYS.NVP_ONBOARDING, {hasCompletedGuidedSetupFlow: false}); + await waitForBatchedUpdates(); + + const introSelected: OnyxTypes.IntroSelected = {choice: CONST.ONBOARDING_CHOICES.ADMIN, isInviteOnboardingComplete: false}; + const betas: OnyxTypes.Beta[] = [CONST.BETAS.SUGGESTED_FOLLOWUPS]; + const result = Report.getGuidedSetupDataForOpenReport(introSelected, betas); + + expect(result).toBeDefined(); + expect(result?.guidedSetupData).toBeDefined(); + expect(result?.optimisticData).toBeDefined(); + expect(result?.successData).toBeDefined(); + expect(result?.failureData).toBeDefined(); + }); }); describe('createTransactionThreadReport', () => {