From d2c751e11b34bc4741446c99441d293127bebd9c Mon Sep 17 00:00:00 2001 From: truph01 Date: Fri, 17 Jul 2026 10:17:28 +0700 Subject: [PATCH 1/5] refactor: thread session to isSupportAuthToken --- src/FullstoryInitHandler.tsx | 5 ++- src/libs/Fullstory/common.ts | 2 +- src/libs/Fullstory/index.native.ts | 6 +-- src/libs/Fullstory/index.ts | 8 ++-- src/libs/Fullstory/types.ts | 8 ++-- src/libs/actions/Session/index.ts | 47 +++++++++++++--------- src/pages/settings/InitialSettingsPage.tsx | 2 +- 7 files changed, 43 insertions(+), 35 deletions(-) diff --git a/src/FullstoryInitHandler.tsx b/src/FullstoryInitHandler.tsx index 7f9e86a45a48..8c00c5baaca7 100644 --- a/src/FullstoryInitHandler.tsx +++ b/src/FullstoryInitHandler.tsx @@ -14,9 +14,10 @@ import ONYXKEYS from './ONYXKEYS'; */ function FullstoryInitHandler() { const [userMetadata] = useOnyx(ONYXKEYS.USER_METADATA); + const [session] = useOnyx(ONYXKEYS.SESSION); useEffect(() => { - FS.init(userMetadata); + FS.init(userMetadata, session); FS.getSessionURL() .then((url) => { if (!url) { @@ -29,7 +30,7 @@ function FullstoryInitHandler() { error: error instanceof Error ? error.message : String(error), }); }); - }, [userMetadata]); + }, [userMetadata, session]); return null; } diff --git a/src/libs/Fullstory/common.ts b/src/libs/Fullstory/common.ts index 595aa8793d48..0eeade8aac11 100644 --- a/src/libs/Fullstory/common.ts +++ b/src/libs/Fullstory/common.ts @@ -68,7 +68,7 @@ const getChatFSClass: GetChatFSClass = (report) => { return CONST.FULLSTORY.CLASS.UNMASK; }; -const shouldInitializeFullstory: ShouldInitialize = (userMetadata, envName) => { +const shouldInitializeFullstory: ShouldInitialize = (userMetadata, envName, _session) => { const isTestEmail = userMetadata.email !== undefined && userMetadata.email.startsWith('fullstory') && userMetadata.email.endsWith(CONST.EMAIL.QA_DOMAIN); if ((CONST.ENVIRONMENT.PRODUCTION !== envName && !isTestEmail) || Str.extractEmailDomain(userMetadata.email ?? '') === CONST.EXPENSIFY_PARTNER_NAME) { return false; diff --git a/src/libs/Fullstory/index.native.ts b/src/libs/Fullstory/index.native.ts index 2442afc993cf..19fec5a94d00 100644 --- a/src/libs/Fullstory/index.native.ts +++ b/src/libs/Fullstory/index.native.ts @@ -11,7 +11,7 @@ const FS: Fullstory = { getChatFSClass, - init: (userMetadata) => FS.consentAndIdentify(userMetadata), + init: (userMetadata, session) => FS.consentAndIdentify(userMetadata, session), onReady: async () => FullStory.onReady(), @@ -25,7 +25,7 @@ const FS: Fullstory = { FullStory.identify(String(localMetadata.accountID), localMetadata); }, - consentAndIdentify: (userMetadata) => { + consentAndIdentify: (userMetadata, session) => { // On the first subscribe for UserMetadata, this function will be called. We need // to confirm that we actually have any value here before proceeding. if (!userMetadata?.accountID) { @@ -37,7 +37,7 @@ const FS: Fullstory = { // after the init function since this function is also called on updates for // UserMetadata onyx key. getEnvironment().then((envName: string) => { - if (!FS.shouldInitialize(userMetadata, envName)) { + if (!FS.shouldInitialize(userMetadata, envName, session)) { return; } diff --git a/src/libs/Fullstory/index.ts b/src/libs/Fullstory/index.ts index 41339ec4b215..d216e038cf03 100644 --- a/src/libs/Fullstory/index.ts +++ b/src/libs/Fullstory/index.ts @@ -19,7 +19,7 @@ const FS: Fullstory = { getChatFSClass, - init: () => {}, + init: (_userMetadata, _session) => {}, onReady: async () => new Promise((resolve) => { @@ -36,7 +36,7 @@ const FS: Fullstory = { } }), - shouldInitialize: (userMetadata, envName) => shouldInitializeFullstory(userMetadata, envName) && !isSupportAuthToken(), + shouldInitialize: (userMetadata, envName, session) => shouldInitializeFullstory(userMetadata, envName, session) && !isSupportAuthToken(session), consent: (shouldConsent) => FullStory(CONST.FULLSTORY.OPERATION.SET_IDENTITY, {consent: shouldConsent}), @@ -52,7 +52,7 @@ const FS: Fullstory = { }); }, - consentAndIdentify: (userMetadata) => { + consentAndIdentify: (userMetadata, session) => { // On the first subscribe for UserMetadata, this function will be called. We need // to confirm that we actually have any value here before proceeding. if (!userMetadata?.accountID) { @@ -64,7 +64,7 @@ const FS: Fullstory = { // after the init function since this function is also called on updates for // UserMetadata onyx key. getEnvironment().then((envName: string) => { - if (!FS.shouldInitialize(userMetadata, envName)) { + if (!FS.shouldInitialize(userMetadata, envName, session)) { // On web, if we started FS at some point in a browser, it will run forever. So let's shut it down if we don't want it to run. if (isInitialized()) { FullStory(CONST.FULLSTORY.OPERATION.SHUTDOWN); diff --git a/src/libs/Fullstory/types.ts b/src/libs/Fullstory/types.ts index 133534479c61..4e3cd5c256d1 100644 --- a/src/libs/Fullstory/types.ts +++ b/src/libs/Fullstory/types.ts @@ -1,5 +1,5 @@ import type CONST from '@src/CONST'; -import type {OnyxInputOrEntry, Report, UserMetadata} from '@src/types/onyx'; +import type {OnyxInputOrEntry, Report, Session, UserMetadata} from '@src/types/onyx'; import type {OnyxEntry} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; @@ -27,7 +27,7 @@ interface FSPageLikeConstructor { type GetChatFSClass = (report: OnyxInputOrEntry) => FSClass; -type ShouldInitialize = (userMetadata: UserMetadata, envName: string) => boolean; +type ShouldInitialize = (userMetadata: UserMetadata, envName: string, session: OnyxEntry) => boolean; type Fullstory = { /** @@ -43,7 +43,7 @@ type Fullstory = { /** * Initializes Fullstory. */ - init: (userMetadata: OnyxEntry) => void; + init: (userMetadata: OnyxEntry, session: OnyxEntry) => void; /** * Executes a function when the Fullstory library is ready, either by initialization or by observing the start event. @@ -68,7 +68,7 @@ type Fullstory = { /** * Initializes the Fullstory metadata with the provided metadata information. */ - consentAndIdentify: (userMetadata: OnyxEntry) => void; + consentAndIdentify: (userMetadata: OnyxEntry, session: OnyxEntry) => void; /** * Sets the identity as anonymous using the Fullstory library. diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index f909e17b8c57..59999a6617e8 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -83,7 +83,7 @@ import updateSessionAuthTokens from './updateSessionAuthTokens'; const INVALID_TOKEN = 'pizza'; -let session: Session = {}; +let deprecatedSession: Session = {}; let authPromiseResolver: ((value: boolean) => void) | null = null; let isHybridAppSetupFinished = false; @@ -92,25 +92,32 @@ let hasSwitchedAccountInHybridMode = false; Onyx.connect({ key: ONYXKEYS.SESSION, callback: (value) => { - session = value ?? {}; + deprecatedSession = value ?? {}; - if (!session.creationDate) { - session.creationDate = new Date().getTime(); + if (!deprecatedSession.creationDate) { + deprecatedSession.creationDate = new Date().getTime(); } - if (session.authToken && authPromiseResolver) { + if (deprecatedSession.authToken && authPromiseResolver) { authPromiseResolver(true); authPromiseResolver = null; } - if (CONFIG.IS_HYBRID_APP && isHybridAppSetupFinished && session.authToken && !isAnonymousUser(value)) { - HybridAppModule.sendAuthToken({authToken: session.authToken}); + if (CONFIG.IS_HYBRID_APP && isHybridAppSetupFinished && deprecatedSession.authToken && !isAnonymousUser(value)) { + HybridAppModule.sendAuthToken({authToken: deprecatedSession.authToken}); } }, }); +let fullstorySession: Session = {}; +// Use connectWithoutView because it is only for fullstory initialization +Onyx.connectWithoutView({ + key: ONYXKEYS.SESSION, + callback: (value) => (fullstorySession = value ?? {}), +}); + // Use connectWithoutView because it is only for fullstory initialization Onyx.connectWithoutView({ key: ONYXKEYS.USER_METADATA, - callback: Fullstory.consentAndIdentify, + callback: (value) => Fullstory.consentAndIdentify(value, fullstorySession), }); let stashedSession: Session = {}; @@ -139,12 +146,12 @@ Onyx.connectWithoutView({ }, }); -function isSupportAuthToken(): boolean { - return session.authTokenType === CONST.AUTH_TOKEN_TYPES.SUPPORT; +function isSupportAuthToken(session: OnyxEntry = deprecatedSession): boolean { + return session?.authTokenType === CONST.AUTH_TOKEN_TYPES.SUPPORT; } function isSupportalSession(): boolean { - return isSupportAuthToken() || !!session?.isSupportAuthTokenUsed; + return isSupportAuthToken() || !!deprecatedSession?.isSupportAuthTokenUsed; } /** @@ -305,7 +312,7 @@ function callSAMLSignOut(params: LogOutParams, authToken: string): Promise): boolean { - return (sessionParam?.authTokenType ?? session.authTokenType) === CONST.AUTH_TOKEN_TYPES.ANONYMOUS; + return (sessionParam?.authTokenType ?? deprecatedSession.authTokenType) === CONST.AUTH_TOKEN_TYPES.ANONYMOUS; } function hasStashedSession(stashedSessionParam: Session | undefined, stashedCredentialsParam: Credentials | undefined): boolean { @@ -316,7 +323,7 @@ function hasStashedSession(stashedSessionParam: Session | undefined, stashedCred * Checks if the user has authToken */ function hasAuthToken(): boolean { - return !!session.authToken; + return !!deprecatedSession.authToken; } /** @@ -378,7 +385,7 @@ function signOutAndRedirectToSignIn(shouldResetToHome?: boolean, shouldStashSess // session. const signOutPromise: Promise> = !shouldRestoreStashedSession && !shouldStashSession - ? signOut({autoGeneratedLogin: credentials?.autoGeneratedLogin, signedInWithSAML: !!session.signedInWithSAML, authToken: session.authToken}) + ? signOut({autoGeneratedLogin: credentials?.autoGeneratedLogin, signedInWithSAML: !!deprecatedSession.signedInWithSAML, authToken: deprecatedSession.authToken}) : Promise.resolve(); // The function redirectToSignIn will clear the whole storage, so let's create our onyx params @@ -391,7 +398,7 @@ function signOutAndRedirectToSignIn(shouldResetToHome?: boolean, shouldStashSess if (!isSupportal && shouldStashSession) { onyxSetParams = { [ONYXKEYS.STASHED_CREDENTIALS]: credentials, - [ONYXKEYS.STASHED_SESSION]: session, + [ONYXKEYS.STASHED_SESSION]: deprecatedSession, }; } @@ -413,7 +420,7 @@ function signOutAndRedirectToSignIn(shouldResetToHome?: boolean, shouldStashSess newDotCurrentAccountEmail: stashedSession.email ?? '', authToken: stashedSession.authToken ?? '', policyID: '', - accountID: session.accountID ? String(session.accountID) : '', + accountID: deprecatedSession.accountID ? String(deprecatedSession.accountID) : '', }); hasSwitchedAccountInHybridMode = true; } @@ -620,8 +627,8 @@ function beginSignIn(email: string) { */ function buildOnyxDataToCleanUpAnonymousUser(): OnyxUpdate { const data: Record = {}; - if (session.authTokenType === CONST.AUTH_TOKEN_TYPES.ANONYMOUS && session.accountID) { - data[session.accountID] = null; + if (deprecatedSession.authTokenType === CONST.AUTH_TOKEN_TYPES.ANONYMOUS && deprecatedSession.accountID) { + data[deprecatedSession.accountID] = null; } return { onyxMethod: Onyx.METHOD.MERGE, @@ -719,7 +726,7 @@ function setupNewDotAfterTransitionFromOldDot(hybridAppSettings: HybridAppSettin const stashedData = hybridApp?.delegateAccessData?.isDelegateAccess ? { [ONYXKEYS.STASHED_CREDENTIALS]: credentials, - [ONYXKEYS.STASHED_SESSION]: session, + [ONYXKEYS.STASHED_SESSION]: deprecatedSession, } : { [ONYXKEYS.STASHED_CREDENTIALS]: {}, @@ -1446,7 +1453,7 @@ function clearTwoFactorAuthSecretKey() { */ function waitForUserSignIn(): Promise { return new Promise((resolve) => { - if (session.authToken) { + if (deprecatedSession.authToken) { resolve(true); } else { authPromiseResolver = resolve; diff --git a/src/pages/settings/InitialSettingsPage.tsx b/src/pages/settings/InitialSettingsPage.tsx index 2880085ddeba..cf9bda4fb0af 100755 --- a/src/pages/settings/InitialSettingsPage.tsx +++ b/src/pages/settings/InitialSettingsPage.tsx @@ -395,7 +395,7 @@ function InitialSettingsPage({currentUserPersonalDetails}: InitialSettingsPagePr * Return a list of menu items data for general section * @returns object with translationKey, style and items for the general section */ - const signOutTranslationKey = isSupportAuthToken() && hasStashedSession(stashedSession, stashedCredentials) ? 'initialSettingsPage.restoreStashed' : 'initialSettingsPage.signOut'; + const signOutTranslationKey = isSupportAuthToken(session) && hasStashedSession(stashedSession, stashedCredentials) ? 'initialSettingsPage.restoreStashed' : 'initialSettingsPage.signOut'; const generalMenuItemsData: Menu = { sectionStyle: { ...styles.pt4, From 4b557837d31e05a5c4ac6682e3b006b922d24771 Mon Sep 17 00:00:00 2001 From: truph01 Date: Fri, 17 Jul 2026 10:28:50 +0700 Subject: [PATCH 2/5] fix: add test --- tests/actions/SessionTest.ts | 29 +++++++++++++++++++ tests/unit/FullstoryTest.ts | 56 ++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 tests/unit/FullstoryTest.ts diff --git a/tests/actions/SessionTest.ts b/tests/actions/SessionTest.ts index a79583a62ae2..15f60192a113 100644 --- a/tests/actions/SessionTest.ts +++ b/tests/actions/SessionTest.ts @@ -766,4 +766,33 @@ describe('Session', () => { expect(session?.signedInWithSAML).toBe(false); }); }); + + describe('isSupportAuthToken', () => { + beforeEach(() => { + jest.restoreAllMocks(); + }); + + test('returns true when session has support authTokenType', () => { + const session: Session = {authTokenType: CONST.AUTH_TOKEN_TYPES.SUPPORT, authToken: 'token', accountID: 1, creationDate: Date.now()}; + expect(SessionUtil.isSupportAuthToken(session)).toBe(true); + }); + + test('returns false when session has anonymous authTokenType', () => { + const session: Session = {authTokenType: CONST.AUTH_TOKEN_TYPES.ANONYMOUS, authToken: 'token', accountID: 1, creationDate: Date.now()}; + expect(SessionUtil.isSupportAuthToken(session)).toBe(false); + }); + + test('returns false when session has no authTokenType', () => { + const session: Session = {authToken: 'token', accountID: 1, creationDate: Date.now()}; + expect(SessionUtil.isSupportAuthToken(session)).toBe(false); + }); + + test('returns false when session is undefined', () => { + expect(SessionUtil.isSupportAuthToken(undefined)).toBe(false); + }); + + test('returns false when session is null', () => { + expect(SessionUtil.isSupportAuthToken(null)).toBe(false); + }); + }); }); diff --git a/tests/unit/FullstoryTest.ts b/tests/unit/FullstoryTest.ts new file mode 100644 index 000000000000..4874ce9705e0 --- /dev/null +++ b/tests/unit/FullstoryTest.ts @@ -0,0 +1,56 @@ +import {isSupportAuthToken} from '@libs/actions/Session'; +import {shouldInitializeFullstory} from '@libs/Fullstory/common'; + +import CONST from '@src/CONST'; +import type {Session, UserMetadata} from '@src/types/onyx'; + +const regularSession: Session = {authToken: 'token', accountID: 1, creationDate: Date.now()}; +const supportSession: Session = {authTokenType: CONST.AUTH_TOKEN_TYPES.SUPPORT, authToken: 'supportToken', accountID: 2, creationDate: Date.now()}; + +describe('Fullstory', () => { + describe('shouldInitializeFullstory', () => { + const productionEnv = CONST.ENVIRONMENT.PRODUCTION; + + test('returns true for production environment with non-expensify email', () => { + const metadata: UserMetadata = {accountID: 1, email: 'user@example.com'}; + expect(shouldInitializeFullstory(metadata, productionEnv, regularSession)).toBe(true); + }); + + test('returns false for non-production environment', () => { + const metadata: UserMetadata = {accountID: 1, email: 'user@example.com'}; + expect(shouldInitializeFullstory(metadata, CONST.ENVIRONMENT.DEV, regularSession)).toBe(false); + }); + + test('returns false for expensify partner email in production', () => { + const metadata: UserMetadata = {accountID: 1, email: 'user@expensify.com'}; + expect(shouldInitializeFullstory(metadata, productionEnv, regularSession)).toBe(false); + }); + + test('returns true for fullstory QA test email in non-production', () => { + const metadata: UserMetadata = {accountID: 1, email: `fullstory-test${CONST.EMAIL.QA_DOMAIN}`}; + expect(shouldInitializeFullstory(metadata, CONST.ENVIRONMENT.DEV, regularSession)).toBe(true); + }); + }); + + describe('shouldInitialize with isSupportAuthToken', () => { + test('isSupportAuthToken returns true for support session', () => { + expect(isSupportAuthToken(supportSession)).toBe(true); + }); + + test('isSupportAuthToken returns false for regular session', () => { + expect(isSupportAuthToken(regularSession)).toBe(false); + }); + + test('Fullstory should not initialize when session is support token', () => { + const metadata: UserMetadata = {accountID: 1, email: 'user@example.com'}; + const result = shouldInitializeFullstory(metadata, CONST.ENVIRONMENT.PRODUCTION, supportSession) && !isSupportAuthToken(supportSession); + expect(result).toBe(false); + }); + + test('Fullstory should initialize when session is not support token', () => { + const metadata: UserMetadata = {accountID: 1, email: 'user@example.com'}; + const result = shouldInitializeFullstory(metadata, CONST.ENVIRONMENT.PRODUCTION, regularSession) && !isSupportAuthToken(regularSession); + expect(result).toBe(true); + }); + }); +}); From 297fd3dfc96f194ffcb4d8c2fc47ce9ad8abfc85 Mon Sep 17 00:00:00 2001 From: truph01 Date: Fri, 17 Jul 2026 10:35:03 +0700 Subject: [PATCH 3/5] fix: remove session from useEffect dep --- src/FullstoryInitHandler.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FullstoryInitHandler.tsx b/src/FullstoryInitHandler.tsx index 8c00c5baaca7..4eb1405a40ab 100644 --- a/src/FullstoryInitHandler.tsx +++ b/src/FullstoryInitHandler.tsx @@ -30,7 +30,8 @@ function FullstoryInitHandler() { error: error instanceof Error ? error.message : String(error), }); }); - }, [userMetadata, session]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [userMetadata]); return null; } From e275d10991155d5889ab922ab0fd22e1916bc23d Mon Sep 17 00:00:00 2001 From: truph01 Date: Fri, 17 Jul 2026 10:50:10 +0700 Subject: [PATCH 4/5] fix: type --- src/libs/Fullstory/common.ts | 2 +- src/libs/Fullstory/index.ts | 2 +- tests/actions/SessionTest.ts | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libs/Fullstory/common.ts b/src/libs/Fullstory/common.ts index 0eeade8aac11..595aa8793d48 100644 --- a/src/libs/Fullstory/common.ts +++ b/src/libs/Fullstory/common.ts @@ -68,7 +68,7 @@ const getChatFSClass: GetChatFSClass = (report) => { return CONST.FULLSTORY.CLASS.UNMASK; }; -const shouldInitializeFullstory: ShouldInitialize = (userMetadata, envName, _session) => { +const shouldInitializeFullstory: ShouldInitialize = (userMetadata, envName) => { const isTestEmail = userMetadata.email !== undefined && userMetadata.email.startsWith('fullstory') && userMetadata.email.endsWith(CONST.EMAIL.QA_DOMAIN); if ((CONST.ENVIRONMENT.PRODUCTION !== envName && !isTestEmail) || Str.extractEmailDomain(userMetadata.email ?? '') === CONST.EXPENSIFY_PARTNER_NAME) { return false; diff --git a/src/libs/Fullstory/index.ts b/src/libs/Fullstory/index.ts index d216e038cf03..78dd0c75567b 100644 --- a/src/libs/Fullstory/index.ts +++ b/src/libs/Fullstory/index.ts @@ -19,7 +19,7 @@ const FS: Fullstory = { getChatFSClass, - init: (_userMetadata, _session) => {}, + init: () => {}, onReady: async () => new Promise((resolve) => { diff --git a/tests/actions/SessionTest.ts b/tests/actions/SessionTest.ts index 15f60192a113..e1b4518331b0 100644 --- a/tests/actions/SessionTest.ts +++ b/tests/actions/SessionTest.ts @@ -790,9 +790,5 @@ describe('Session', () => { test('returns false when session is undefined', () => { expect(SessionUtil.isSupportAuthToken(undefined)).toBe(false); }); - - test('returns false when session is null', () => { - expect(SessionUtil.isSupportAuthToken(null)).toBe(false); - }); }); }); From fc0285b1632c8fe2891f9ddc33daaffaf7474204 Mon Sep 17 00:00:00 2001 From: truph01 Date: Sat, 18 Jul 2026 17:23:48 +0700 Subject: [PATCH 5/5] fix: move fullstory stuff to FullStory folder --- src/libs/Fullstory/index.ts | 14 ++++++++++++++ src/libs/actions/Session/index.ts | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/libs/Fullstory/index.ts b/src/libs/Fullstory/index.ts index 78dd0c75567b..cbfb4e20af99 100644 --- a/src/libs/Fullstory/index.ts +++ b/src/libs/Fullstory/index.ts @@ -2,8 +2,11 @@ import {isSupportAuthToken} from '@userActions/Session'; import CONST from '@src/CONST'; import getEnvironment from '@src/libs/Environment/getEnvironment'; +import ONYXKEYS from '@src/ONYXKEYS'; +import type {Session} from '@src/types/onyx'; import {FullStory, init, isInitialized} from '@fullstory/browser'; +import Onyx from 'react-native-onyx'; import type {FSPageLike, Fullstory} from './types'; @@ -135,4 +138,15 @@ const FS: Fullstory = { }, }; +let fullstorySession: Session = {}; +Onyx.connectWithoutView({ + key: ONYXKEYS.SESSION, + callback: (value) => (fullstorySession = value ?? {}), +}); + +Onyx.connectWithoutView({ + key: ONYXKEYS.USER_METADATA, + callback: (value) => FS.consentAndIdentify(value, fullstorySession), +}); + export default FS; diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index de02eabb04ef..5fba39146abf 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -22,7 +22,6 @@ import {READ_COMMANDS, SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs import asyncOpenURL from '@libs/asyncOpenURL'; import * as ErrorUtils from '@libs/ErrorUtils'; import FraudProtection from '@libs/FraudProtection'; -import Fullstory from '@libs/Fullstory'; import getPlatform from '@libs/getPlatform'; import HttpUtils from '@libs/HttpUtils'; import Log from '@libs/Log'; @@ -107,19 +106,6 @@ Onyx.connect({ }, }); -let fullstorySession: Session = {}; -// Use connectWithoutView because it is only for fullstory initialization -Onyx.connectWithoutView({ - key: ONYXKEYS.SESSION, - callback: (value) => (fullstorySession = value ?? {}), -}); - -// Use connectWithoutView because it is only for fullstory initialization -Onyx.connectWithoutView({ - key: ONYXKEYS.USER_METADATA, - callback: (value) => Fullstory.consentAndIdentify(value, fullstorySession), -}); - let stashedSession: Session = {}; Onyx.connectWithoutView({ key: ONYXKEYS.STASHED_SESSION,