Skip to content

fix: Add MPID to selectPlacements call#15

Merged
alexs-mparticle merged 3 commits intodevelopmentfrom
fix/SQDSDKS-7174-add-mpid
Apr 1, 2025
Merged

fix: Add MPID to selectPlacements call#15
alexs-mparticle merged 3 commits intodevelopmentfrom
fix/SQDSDKS-7174-add-mpid

Conversation

@alexs-mparticle
Copy link
Collaborator

Summary

  • Add mpid to selectPlacements() call

Testing Plan

  • Use a sample app and verify mpid is being sent to Rokt.selectPlacements() call

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for including the mpid value in the selectPlacements call.

  • Updates the Rokt-Kit module to merge mpid from filteredUser into the attributes passed to launcher.selectPlacements.
  • Adjusts and extends tests in test/src/tests.js to verify that the mpid is correctly added.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/src/tests.js Updates and new test cases to confirm mpid is included in placement options.
src/Rokt-Kit.js Adds retrieval of mpid from filteredUser and includes it in selectPlacements attributes.
Comments suppressed due to low confidence (2)

src/Rokt-Kit.js:33

  • Ensure that 'window.mParticle.Rokt.filters.filteredUser' is reliably defined before its use to retrieve the mpid, preventing potential runtime errors if its structure changes.
self.filteredUser = window.mParticle.Rokt.filters.filteredUser;

test/src/tests.js:219

  • [nitpick] Consider extracting the hardcoded mpid value '123' into a shared constant to improve clarity and ease updates across multiple tests.
                    mpid: '123',

@alexs-mparticle alexs-mparticle changed the base branch from fix/SQDSDKS-7170-filtering-tests to development April 1, 2025 15:36
@alexs-mparticle alexs-mparticle force-pushed the fix/SQDSDKS-7174-add-mpid branch from d204ab7 to 9d78006 Compare April 1, 2025 15:44
});

it('should filter user attributes through filterUserAttributes function before sending to selectPlacements', async () => {
it.skip('should filter user attributes through filterUserAttributes function before sending to selectPlacements', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

unskip?

Suggested change
it.skip('should filter user attributes through filterUserAttributes function before sending to selectPlacements', async () => {
it('should filter user attributes through filterUserAttributes function before sending to selectPlacements', async () => {

@alexs-mparticle alexs-mparticle merged commit f950982 into development Apr 1, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants