mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:03:42 -05: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:
parent
07e5d1ba90
commit
92f34757f7
2 changed files with 11 additions and 1 deletions
|
@ -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 () {
|
||||
|
|
Loading…
Reference in a new issue