Skip to content

Commit 57ff0e4

Browse files
committed
Fix onboarding loop for Track/Personal Spend path when Concierge report not in collection
When getChatByParticipants fails to find the Concierge 1:1 chat in deprecatedAllReports (common for brand-new accounts during onboarding), fall back to using the module-level conciergeReportIDOnyxConnect which is populated via Onyx.connect to CONCIERGE_REPORT_ID. Without this fallback, prepareOnboardingOnyxData returns undefined, completeOnboarding bails out without sending COMPLETE_GUIDED_SETUP, hasCompletedGuidedSetupFlow stays false, but navigateAfterOnboarding still dismisses the modal. The OnboardingGuard then redirects back, creating an infinite loop. Made-with: Cursor
1 parent 80b61a0 commit 57ff0e4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/libs/ReportUtils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11728,9 +11728,12 @@ function prepareOnboardingOnyxData({
1172811728
// When posting to admins room and the user is in the suggestedFollowups beta, we skip tasks in favor of backend-generated followups.
1172911729
const shouldUseFollowupsInsteadOfTasks = shouldPostTasksInAdminsRoom && Permissions.isBetaEnabled(CONST.BETAS.SUGGESTED_FOLLOWUPS, betas, betaConfiguration);
1173011730
const adminsChatReport = deprecatedAllReports?.[`${ONYXKEYS.COLLECTION.REPORT}${adminsChatReportID}`];
11731+
const conciergeChat =
11732+
getChatByParticipants([CONST.ACCOUNT_ID.CONCIERGE, deprecatedCurrentUserAccountID ?? CONST.DEFAULT_NUMBER_ID], deprecatedAllReports, false) ??
11733+
(conciergeReportIDOnyxConnect ? {reportID: conciergeReportIDOnyxConnect} : undefined);
1173111734
const targetChatReport = shouldPostTasksInAdminsRoom
1173211735
? (adminsChatReport ?? {reportID: adminsChatReportID, policyID: onboardingPolicyID, chatType: CONST.REPORT.CHAT_TYPE.POLICY_ADMINS})
11733-
: getChatByParticipants([CONST.ACCOUNT_ID.CONCIERGE, deprecatedCurrentUserAccountID ?? CONST.DEFAULT_NUMBER_ID], deprecatedAllReports, false);
11736+
: conciergeChat;
1173411737
const {reportID: targetChatReportID = '', policyID: targetChatPolicyID = ''} = targetChatReport ?? {};
1173511738
const targetChatType = targetChatReport?.chatType;
1173611739

0 commit comments

Comments
 (0)