Skip to content

Commit

Permalink
chore: nit pick log message
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Feb 6, 2024
1 parent d555d67 commit 97950d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions functional_tests/identify.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'regenerator-runtime/runtime'
import { waitFor } from '@testing-library/dom'
import { v4 } from 'uuid'
import { getRequests } from './mock-server'
import { createPosthogInstance } from './posthog-instance'
import { logger } from '../src/utils/logger'

jest.mock('../src/utils/logger')

test('identify sends a identify event', async () => {
const token = v4()
const posthog = await createPosthogInstance(token)
Expand All @@ -29,7 +30,7 @@ test('identify sends a identify event', async () => {
})

test('identify sends an engage request if identify called twice with the same distinct id and with $set/$set_once', async () => {
// The intention here is to reduce the number of unncecessary $identify
// The intention here is to reduce the number of unnecessary $identify
// requests to process.
const token = v4()
const posthog = await createPosthogInstance(token)
Expand Down
4 changes: 3 additions & 1 deletion src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,8 +1302,10 @@ export class PostHog {
return logger.uninitializedWarning('posthog.identify')
}
if (_isNumber(new_distinct_id)) {
logger.error('The first argument to posthog.identify was a number, but it should be a string.')
new_distinct_id = (new_distinct_id as number).toString()
logger.warn(
'The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.'
)
}

//if the new_distinct_id has not been set ignore the identify event
Expand Down

0 comments on commit 97950d2

Please sign in to comment.