fix: Support more identities in search#93
Merged
rmi22186 merged 2 commits intodevelopmentfrom May 5, 2026
Merged
Conversation
`@mparticle/web-sdk` 2.66.0 ships its own public types entry, which TypeScript prefers over `@types/mparticle__web-sdk`, so the previous `UserIdentities` import (only present in DT) no longer resolves. Switch to the SDK's `IUserIdentities` and thread it through `replaceOtherIdentityWithEmailsha256`, `WorkspaceIdSyncSearcher`, and the workspace-search identifier collection. Also collapse `FilteredUser` to a type alias of `IMParticleUser`. The previous interface redeclared `getMPID` and `getUserIdentities`, both of which are already required on the SDK's `User` base — the redeclarations conflicted with the authoritative shape. Adds a regression test covering `hashedEmailUserIdentityType` mapped at a key whose value is null: emailsha256 must not be synthesized and the source key must not appear in the placements payload. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`KitInterface.init` declares `userAttributes?: AllUserAttributes`, so callers may omit it. The override required the param, which violated substitutability once the kit consumed the SDK's authoritative `KitInterface` types instead of the looser DT shape. Adding `?` is enough — `Record<string, unknown>` is already a supertype of `AllUserAttributes` on the value side. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
alexs-mparticle
approved these changes
May 5, 2026
Collaborator
|
🎉 This PR is included in version 1.26.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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
UserIdentitiesto the SDK'sIUserIdentities, which@mparticle/web-sdk2.66.0 now ships as its public types entry. Threaded throughreplaceOtherIdentityWithEmailsha256,WorkspaceIdSyncSearcher, and the workspace-search identifier collection.FilteredUserto a type alias ofIMParticleUser— the previous interface redeclaredgetMPID/getUserIdentities, conflicting with the SDK's authoritative shape.filteredUserAttributesoptional onRoktKit.initto matchKitInterface.init'suserAttributes?: AllUserAttributes. Required param violated substitutability once the kit consumed the SDK'sKitInterfacetypes.Test plan
npm run lintnpm run buildnpm run test— including the new regression coveringhashedEmailUserIdentityTypemapped to a null value (emailsha256 must not be synthesized; source key must not appear in placements payload)🤖 Generated with Claude Code