-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add another illegal id #17325
fix: add another illegal id #17325
Conversation
const CASE_SENSITIVE_ILLEGAL_IDS = new Set([ | ||
'[object Object]', | ||
'NaN', | ||
'None', | ||
'none', | ||
'null', | ||
'"null"', | ||
'0', | ||
'"0"', | ||
'undefined', | ||
'"undefined"', | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we want to do all of these single or double quoted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered about that... looking in the DB we only see them double quoted, but I guess that doesn't mean we'd never see them single quoted 🤔
@@ -245,7 +259,7 @@ export class PersonState { | |||
this.teamId, | |||
this.timestamp | |||
) | |||
} else if (this.event.event === '$identify' && this.eventProperties['$anon_distinct_id']) { | |||
} else if (this.event.event === '$identify' && '$anon_distinct_id' in this.eventProperties) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing for every illegal id showed that even though we check for the empty string you couldn't get into this branch of the code if the anon distinct id was the empty string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd update the tests & there's a failure to look into
@tiina303 I updated the tests... and it turns out we make assumptions about casing that clashed with my change. E.g. we do allow Decided to unwind my casing change rather than go deeper into the rabbit hole. If you're happy with that I'll merge this later on today 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E.g. we do allow Nan as an illegal id.
why? Should we?
If we query
(while investigating something else
We note that some teams send
"null"
as distinct id (i.e. double quote null double quote as a string)We shouldn't allow this