mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
Merge pull request #4256 from overleaf/ab-analytics-manager-nullcheck-userid
Add null checks on userId to all AnalyticsManager functions GitOrigin-RevId: ca4d50c9309aadf0145fd5135bbdecb7d297ea6f
This commit is contained in:
committed by
Copybot
parent
7df57174ca
commit
a0dd439e2c
@@ -7,6 +7,9 @@ const analyticsEditingSessionsQueue = Queues.getAnalyticsEditingSessionsQueue()
|
||||
const analyticsUserPropertiesQueue = Queues.getAnalyticsUserPropertiesQueue()
|
||||
|
||||
function identifyUser(userId, oldUserId) {
|
||||
if (!userId || !oldUserId) {
|
||||
return
|
||||
}
|
||||
if (isAnalyticsDisabled() || isSmokeTestUser(userId)) {
|
||||
return
|
||||
}
|
||||
@@ -22,6 +25,9 @@ function identifyUser(userId, oldUserId) {
|
||||
}
|
||||
|
||||
function recordEvent(userId, event, segmentation) {
|
||||
if (!userId) {
|
||||
return
|
||||
}
|
||||
if (isAnalyticsDisabled() || isSmokeTestUser(userId)) {
|
||||
return
|
||||
}
|
||||
@@ -37,6 +43,9 @@ function recordEvent(userId, event, segmentation) {
|
||||
}
|
||||
|
||||
function updateEditingSession(userId, projectId, countryCode) {
|
||||
if (!userId) {
|
||||
return
|
||||
}
|
||||
if (isAnalyticsDisabled() || isSmokeTestUser(userId)) {
|
||||
return
|
||||
}
|
||||
@@ -61,6 +70,9 @@ function updateEditingSession(userId, projectId, countryCode) {
|
||||
}
|
||||
|
||||
function setUserProperty(userId, propertyName, propertyValue) {
|
||||
if (!userId) {
|
||||
return
|
||||
}
|
||||
if (isAnalyticsDisabled() || isSmokeTestUser(userId)) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user