Skip to content

fix: SDKE-317 Call deferred methods on Rokt Manager instead of kit#1076

Merged
rmi22186 merged 2 commits into
developmentfrom
fix/SDKE-317-deffered-call-on-rokt-manager
Sep 30, 2025
Merged

fix: SDKE-317 Call deferred methods on Rokt Manager instead of kit#1076
rmi22186 merged 2 commits into
developmentfrom
fix/SDKE-317-deffered-call-on-rokt-manager

Conversation

@rmi22186

Copy link
Copy Markdown
Member

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

Deferred calls happen if mParticle is ready but Rokt isn’t yet and a developer tries to call mParticle.Rokt.METHOD_NAME. Eventually Rokt will become ready, and the deferred calls will be processed. When that happens, the current code has the deferred method called on the kit and not the Rokt Manager. This makes sense for use and hashAttributes because we simply pass the data directly to the kit method.  However, it doesn't work with selectPlacements because we do lots of logic between RoktManager’s selectPlacements and the kit’s selectPlacements. We need to call the method on the Rokt Manager and not the kit.

Testing Plan

  • Was this tested locally? If not, explain why.
    Unit tests and local test app

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

Comment thread test/jest/roktManager.spec.ts Outdated
});

it('should call RoktManager methods (not kit methods directly) when processing queue', () => {
const kit: IRoktKit = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the kit into a beforeEach? I realize I probably should have been the one to do it in the first place 😅

@sonarqubecloud

Copy link
Copy Markdown

@jaissica12 jaissica12 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rmi22186 rmi22186 merged commit 3a0643b into development Sep 30, 2025
82 of 89 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 1, 2025
# [2.47.0](v2.46.0...v2.47.0) (2025-10-01)

### Bug Fixes

* SDKE-317 Call deferred methods on Rokt Manager instead of kit ([#1076](#1076)) ([3a0643b](3a0643b))

### Features

* added DisabledVault to disable id-cache when noFunctional is set ([#1072](#1072)) ([8187d72](8187d72))
* added noFunctional in batchUploader to disable offline storage ([#1063](#1063)) ([97dd88a](97dd88a))
* disable session cookie/localStorage when noFunctional is set ([#1070](#1070)) ([edb2e61](edb2e61))
* disable time tracking when noTargeting is set to true ([#1064](#1064)) ([71c891c](71c891c))
@mparticle-automation

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 2.47.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.

4 participants