Skip to content

Commit

Permalink
Fix bug where loaded event is not sent when no user ID (#106090)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover authored Jul 19, 2021
1 parent 59b56e5 commit ab010ae
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions x-pack/plugins/cloud/public/fullstory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ export const initializeFullStory = async ({
try {
// This needs to be called syncronously to be sure that we populate the user ID soon enough to make sessions merging
// across domains work
if (!userId) return;
// Do the hashing here to keep it at clear as possible in our source code that we do not send literal user IDs
const hashedId = sha256(userId.toString());
fullStory.identify(hashedId);
if (userId) {
// Do the hashing here to keep it at clear as possible in our source code that we do not send literal user IDs
const hashedId = sha256(userId.toString());
fullStory.identify(hashedId);
}
} catch (e) {
// eslint-disable-next-line no-console
console.error(`[cloud.full_story] Could not call FS.identify due to error: ${e.toString()}`, e);
Expand Down

0 comments on commit ab010ae

Please sign in to comment.