Skip to content

fix: Support more identities in search#93

Merged
rmi22186 merged 2 commits intodevelopmentfrom
fix/allow-all-identities-search
May 5, 2026
Merged

fix: Support more identities in search#93
rmi22186 merged 2 commits intodevelopmentfrom
fix/allow-all-identities-search

Conversation

@rmi22186
Copy link
Copy Markdown
Collaborator

@rmi22186 rmi22186 commented May 5, 2026

Summary

  • Switch kit user-identity types from the DT-only UserIdentities to the SDK's IUserIdentities, which @mparticle/web-sdk 2.66.0 now ships as its public types entry. Threaded through replaceOtherIdentityWithEmailsha256, WorkspaceIdSyncSearcher, and the workspace-search identifier collection.
  • Collapse FilteredUser to a type alias of IMParticleUser — the previous interface redeclared getMPID/getUserIdentities, conflicting with the SDK's authoritative shape.
  • Mark filteredUserAttributes optional on RoktKit.init to match KitInterface.init's userAttributes?: AllUserAttributes. Required param violated substitutability once the kit consumed the SDK's KitInterface types.

Test plan

  • npm run lint
  • npm run build
  • npm run test — including the new regression covering hashedEmailUserIdentityType mapped to a null value (emailsha256 must not be synthesized; source key must not appear in placements payload)

🤖 Generated with Claude Code

rmi22186 and others added 2 commits May 5, 2026 09:20
`@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>
@rmi22186 rmi22186 changed the title refactor: Adopt SDK IUserIdentities and relax init signature fix: Support more identities in search May 5, 2026
@rmi22186 rmi22186 marked this pull request as ready for review May 5, 2026 13:23
@rmi22186 rmi22186 requested a review from samdozor May 5, 2026 16:22
@rmi22186 rmi22186 merged commit 1526325 into development May 5, 2026
5 checks passed
github-actions Bot pushed a commit that referenced this pull request May 5, 2026
# [1.26.0](v1.25.1...v1.26.0) (2026-05-05)

### Bug Fixes

* Support more identities in search ([#93](#93)) ([1526325](1526325))

### Features

* Add Workspace IDSync search on user identification ([#92](#92)) ([f742616](f742616))
@mparticle-automation
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.26.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants