You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When selectPlacements is called, placement attributes are written to the mParticle user profile and then forwarded to the Rokt kit, which merges profile attributes with the passed-in map before calling Rokt.execute().
A fix in #585 ensured those user attributes were persisted before the kit ran, but that async wait was lost when Rokt handling moved into RoktKitApiImpl in #586.
As a result, clients could see placement attributes missing in both mParticle and Rokt, especially when the kit reads from the user profile (e.g. Compose / prepareAttributesAsync flows).
What Has Changed
Restored setRoktAttributesOnUser() in RoktKitApiImpl to persist placement attributes on the user and wait for TypedUserAttributeListener before delegating to the Rokt kit.
Applied the same async wait to both selectPlacements and prepareAttributesAsync.
Split attribute preparation into applyPlacementAttributeMapping(), ensureSandboxMode(), and setRoktAttributesOnUser() for clarity.
Fixed case-sensitive email lookup in prepareAttributesAsync to use getValueIgnoreCase, matching selectPlacements.
Added a unit test verifying the kit is not invoked until the user-attribute callback fires.
Checklist
I have performed a self-review of my own code.
I have made corresponding changes to the documentation.
I have added tests that prove my fix is effective or that my feature works.
I have tested this locally.
Reference Issue (For employees only. Ignore if you are an outside contributor)
Medium Risk
Changes async ordering on the Rokt placement path; if the attribute listener never fires, placements could stall, though behavior matches the prior #585 fix and is covered by new tests.
Overview
Fixes a regression where Rokt placement attributes could be missing because the kit ran before placement attributes finished persisting on the mParticle user.
In RoktKitApiImpl, selectPlacements and prepareAttributesAsync now call setRoktAttributesOnUser, which writes attributes with setUserAttributes and only continues after TypedUserAttributeListener.onUserAttributesReceived. Attribute prep is split into applyPlacementAttributeMapping, ensureSandboxMode, and that persist-and-wait step. prepareAttributesAsync also uses case-insensitive email lookup like selectPlacements.
CHANGELOG documents the fix. Tests stub the user-attribute callback and assert the Rokt listener is not invoked until the callback fires.
Reviewed by Cursor Bugbot for commit a2a3343. Bugbot is set up for automated code reviews on this repo. Configure here.
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
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.
Background
What Has Changed
Checklist
Reference Issue (For employees only. Ignore if you are an outside contributor)