fix(identify): reject string "undefined" and "null" in identify() and be more clear when rejecting#3285
Merged
marandaneto merged 1 commit intomainfrom Mar 27, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
Reviews (2): Last reviewed commit: "fix(identify): reject string "undefined"..." | Re-trigger Greptile |
Contributor
Contributor
|
Size Change: +1.19 kB (+0.02%) Total Size: 6.57 MB
ℹ️ View Unchanged
|
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
marandaneto
reviewed
Mar 26, 2026
a92d947 to
a75c443
Compare
dustinbyrne
approved these changes
Mar 26, 2026
Contributor
dustinbyrne
left a comment
There was a problem hiding this comment.
Looks good. One minor comment worth addressing before merging.
a75c443 to
ee2af2c
Compare
ee2af2c to
ba26655
Compare
marandaneto
approved these changes
Mar 26, 2026
- Expand isDistinctIdStringLike to include "undefined" and "null" - Add _validateIdentifyId type guard that narrows string | undefined - All invalid distinct IDs now use logger.critical (always visible) instead of logger.error (debug-only) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ba26655 to
740166b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
posthog.identify(`${undefinedVar}`), JS coercesundefinedto the string"undefined", which passes all existing validation and silently identifies the user as literal"undefined"_validateIdentifyIdnow rejects"undefined","null", and whitespace-only strings in addition to the existing checkslogger.critical(always visible in console) instead oflogger.error(debug-only)Test plan
undefined,null,""," ",false,"undefined","null"are all rejected with critical log🤖 Generated with Claude Code