Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jest/setupMockFullstoryLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function mockFSLibrary() {
consentAndIdentify: jest.fn(),
anonymize: jest.fn(),
getSessionId: jest.fn().mockResolvedValue(undefined),
getSessionURL: jest.fn().mockResolvedValue(undefined),
};
});
}
6 changes: 3 additions & 3 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ function Expensify() {
useEffect(() => {
// Initialize Fullstory lib
FS.init(userMetadata);
FS.getSessionId().then((sessionId) => {
if (!sessionId) {
FS.getSessionURL().then((url) => {
if (!url) {
return;
}
Sentry.setContext(CONST.TELEMETRY.CONTEXT_FULLSTORY, {sessionId});
Sentry.setContext(CONST.TELEMETRY.CONTEXT_FULLSTORY, {url});
});
}, [userMetadata]);

Expand Down
4 changes: 4 additions & 0 deletions src/libs/Fullstory/index.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const FS: Fullstory = {
getSessionId: () => {
return FullStory.getCurrentSession();
},

getSessionURL: () => {
return FullStory.getCurrentSessionURL();
},
};

export default FS;
7 changes: 7 additions & 0 deletions src/libs/Fullstory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ const FS: Fullstory = {
}
return FullStory('getSessionAsync', {format: 'id'});
},

getSessionURL: async () => {
if (!isInitialized()) {
return;
}
return FullStory('getSessionAsync', {format: 'url'});
},
};

export default FS;
5 changes: 5 additions & 0 deletions src/libs/Fullstory/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ type Fullstory = {
* Returns the current FullStory session ID.
*/
getSessionId: () => Promise<string | undefined>;

/**
* Returns the current FullStory session URL.
*/
getSessionURL: () => Promise<string | undefined>;
};

/**
Expand Down
Loading