mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 07:39:02 +02:00
Merge pull request #5302 from overleaf/ta-identify-identity
Skip Identify Job When userId Equal analyticsId GitOrigin-RevId: 11eac0905dd0060df3556484db7ba301aba55375
This commit is contained in:
committed by
Copybot
parent
2b591b8221
commit
dc94293f4d
@@ -15,7 +15,7 @@ const analyticsUserPropertiesQueue = Queues.getAnalyticsUserPropertiesQueue()
|
||||
const ONE_MINUTE_MS = 60 * 1000
|
||||
|
||||
function identifyUser(userId, analyticsId, isNewUser) {
|
||||
if (!userId || !analyticsId) {
|
||||
if (!userId || !analyticsId || userId === analyticsId) {
|
||||
return
|
||||
}
|
||||
if (_isAnalyticsDisabled() || _isSmokeTestUser(userId)) {
|
||||
|
||||
@@ -70,6 +70,16 @@ describe('AnalyticsManager', function () {
|
||||
this.AnalyticsManager.identifyUser(this.fakeUserId, '')
|
||||
sinon.assert.notCalled(this.analyticsEventsQueue.add)
|
||||
})
|
||||
|
||||
it('userId or analyticsId is missing', function () {
|
||||
this.AnalyticsManager.identifyUser(this.fakeUserId, undefined)
|
||||
sinon.assert.notCalled(this.analyticsEventsQueue.add)
|
||||
})
|
||||
|
||||
it('userId equal analyticsId', function () {
|
||||
this.AnalyticsManager.identifyUser(this.fakeUserId, this.fakeUserId)
|
||||
sinon.assert.notCalled(this.analyticsEventsQueue.add)
|
||||
})
|
||||
})
|
||||
|
||||
describe('queues the appropriate message for', function () {
|
||||
|
||||
Reference in New Issue
Block a user