feat(rokt): end the Rokt session when the mParticle user changes - #762
Closed
nickolas-dimitrakas wants to merge 1 commit into
Closed
feat(rokt): end the Rokt session when the mParticle user changes#762nickolas-dimitrakas wants to merge 1 commit into
nickolas-dimitrakas wants to merge 1 commit into
Conversation
The Rokt session is bound to a persisted JWT and today survives every identity change — on shared self-service terminals successive customers silently continue one another's session. The kit now calls Rokt.clearSession() from the identity callbacks, with the MPID transition TYPED so only a departing known user ends a session: - anonymous -> known: same person identified (payment page -> conf page) — session kept, in-session state survives - known -> different known: different person (kiosk) — reset - known -> anonymous: logout — reset - anonymous -> anonymous: no-op "Known" = holds any user identity or is logged in. Android's IdentityType enum contains user identities only, so identity-set emptiness is a safe anonymity signal. MPID 0 (unassigned sentinel) is never recorded. onModifyCompleted stays empty: modify() cannot change the MPID. Requires a Rokt Android SDK release containing Rokt.clearSession() (ROKT/sdk-android-source#1148) and a roktSdkVersion bump. Mirrors the iOS kit change (#819). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
The Rokt session is bound to a persisted JWT whose expiry extends on every request, and the kit's identity callbacks have always been empty — so a user change never ends a Rokt session, and on shared self-service terminals (kiosks, counter tablets) successive customers silently continue one another's session.
Android counterpart of #819. (Replaces mparticle-integrations/mparticle-android-integration-rokt#147, which targeted the standalone repo by mistake — the kit lives here.)
What
The kit now calls
Rokt.clearSession()fromonIdentifyCompleted/onLoginCompleted/onLogoutCompleted, with the MPID transition typed so only a departing known user ends a session:"Known" = holds any user identity or is logged in.
IdentityTypecontains user identities only on Android, so identity-set emptiness is a safe anonymity signal. MPID 0 (the unassigned sentinel) is never recorded.onModifyCompletedstays empty —modify()cannot change the MPID.Dependencies
Requires a Rokt Android SDK release containing
Rokt.clearSession()(ROKT/sdk-android-source#1148) plus aroktSdkVersionbump here. Verified locally against mavenLocal core (CI sequence): the module compiles with exactly one expected unresolved reference —Rokt.clearSessionagainst the releasedroktsdk:6.0.3— which the version bump resolves. Same release ordering as #819.Testing
🤖 Generated with Claude Code