SDK-563 pass configurable preferUserId through tryUser to setUserID/setEmail - #582
Open
joaodordio wants to merge 2 commits into
Open
SDK-563 pass configurable preferUserId through tryUser to setUserID/setEmail#582joaodordio wants to merge 2 commits into
joaodordio wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #582 +/- ##
=======================================
Coverage 74.43% 74.43%
=======================================
Files 57 57
Lines 2742 2742
Branches 821 821
=======================================
Hits 2041 2041
Misses 700 700
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Lock in the tryUser handoff so identify-time /users/update respects an explicit preferUserId, matching the Care.com fix path.
joaodordio
force-pushed
the
SDK-563-pt2/pass-config-preferUserId-to-tryUser
branch
from
August 7, 2026 12:41
940a48f to
aaeb652
Compare
joaodordio
enabled auto-merge (squash)
August 7, 2026 13:38
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
Pass
preferUserIdthroughtryUsersosetUserID/ JWTsetEmailcan opt out of identify-time user creation (SDK-563 pt2).🎟️ Jira Ticket: SDK-563
📖 Description
Follow-up to #578 / 2.3.0.
That release made
preferUserIdconfigurable onupdateUser,updateCart, andtrackPurchase, butsetUserID/ JWTsetEmailstill calledtryUser()→updateUser({}), which forcedpreferUserId: true. Care.com (email-based project) hit this on identify and got placeholder / duplicate profiles.This PR:
preferUserIdarg throughsetUserIDand JWTsetEmailintotryUser→updateUser({ preferUserId })undefined→true) so callers that omit it behave as beforetrueand explicitfalseon non-JWTsetUserID, JWTsetUserID, and JWTsetEmailUsage Care validated:
🧪 How to test?
yarn jest --config jest.config.js src/authorization/authorization.test.ts -t preferUserIdsetUserID('test-id', undefined, false)and confirm/users/updatebody haspreferUserId: falsesetUserID('test-id')with no third arg and confirm/users/updatestill sendspreferUserId: true🧾 Changelog
CHANGELOG Unreleased entry added for the
tryUserhandoff (SDK-563).📹 Loom recording if applicable
N/A
🐞 Github Issues solved
N/A
📚 Docs PR if applicable
https://github.com/Iterable/iterable-docs/pull/1574 (
docs/sdk/august-release)