Skip to content

chore: sync Rokt kit with upstream v1.30.2 - #1313

Merged
rmi22186 merged 1 commit into
mainfrom
feat/rokt-kit-upstream-sync-main
Aug 6, 2026
Merged

chore: sync Rokt kit with upstream v1.30.2#1313
rmi22186 merged 1 commit into
mainfrom
feat/rokt-kit-upstream-sync-main

Conversation

@rmi22186

@rmi22186 rmi22186 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Syncs kits/rokt from upstream mParticle-integrations/mparticle-javascript-integration-rokt main through v1.30.2 (dec20cd4).
  • Ports upstream Rokt kit changes since v1.28.3, including active_time_on_site_ms persistence filtering and page-view capture surfaced as page_events on selectPlacements.
  • Preserves monorepo adaptations: monorepo package repository URL, @mparticle/web-sdk peer/dev dependency layout, no standalone semantic-release/provenance config, Vite externalization/aliases/version define, and Node webstorage mitigation.

Upstream commits included

Files changed

  • kits/rokt/src/Rokt-Kit.ts
  • kits/rokt/src/selectPlacementsAttributePersistence.ts
  • kits/rokt/test/src/tests.spec.ts
  • kits/rokt/CHANGELOG.md
  • kits/rokt/package.json
  • kits/rokt/package-lock.json
  • kits/rokt/vite.config.ts

Test plan

  • npm ci in kits/rokt on Node v24.19.0
  • npm run build in kits/rokt on Node v24.19.0
  • npm test in kits/rokt on Node v24.19.0: 228 passed
  • npm ci in kits/rokt on Node v26.5.0
  • npm run build in kits/rokt on Node v26.5.0
  • npm test in kits/rokt on Node v26.5.0: 228 passed

Notes: npm run build emits existing declaration-generation type diagnostics from monorepo ../../src/vault.ts, but Vite completes successfully. Vitest also warns that the root GTS base tsconfig is not installed from the kit package context.

Notes

@rmi22186
rmi22186 requested a review from a team as a code owner August 6, 2026 18:46
@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Introduces client-side behavioral page-view storage and new data sent to Rokt on placements, with PII mitigations and a noTargeting opt-out; scope is limited to the Rokt integration kit with extensive new tests.

Overview
Brings kits/rokt up to v1.30.2 (changelog and package metadata) while keeping monorepo-specific package.json repository URL and Vitest --no-experimental-webstorage for Node compatibility.

The kit now records PageView events in localStorage (mpPageViews, capped at 25, query strings stripped via sanitizeUrl), clears that buffer on session end and when noTargeting is set, and attaches a JSON page_events payload on selectPlacements (including derived activeTimeOnPage from consecutive activeTimeOnSite values). Page-view work runs even when the launcher is not ready; placement mapping still requires a ready kit. PAGE_VIEW_CAPTURE_FAILED is reported at INFO severity.

active_time_on_site_ms is added to the selectPlacements persistence deny list so it is forwarded on the current call but not cached for later placements. returnLocalSessionAttributes always returns session attributes when available (no longer skipped when mapping tables are empty).

Tests add broad coverage for page-view capture, targeting opt-out, URL sanitization, and active_time_on_site_ms caching behavior.

Reviewed by Cursor Bugbot for commit 41cb8dc. Bugbot is set up for automated code reviews on this repo. Configure here.

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 41cb8dc. Configure here.

Comment thread kits/rokt/src/Rokt-Kit.ts
let pageUrl: string | undefined;

try {
pageUrl = sanitizeUrl(window.location.href);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Page URL captured after delay

Medium Severity

capturePageView records window.location.href at process time, while other fields come from the event snapshot. When the core SDK queues events (no MPID, integration delay, or config load), navigation before flush stores the wrong pageUrl in page_events sent to Rokt. SDKEvent already carries PageUrl from event creation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 41cb8dc. Configure here.

@rmi22186 rmi22186 changed the title Sync Rokt kit with upstream v1.30.2 chore: sync Rokt kit with upstream v1.30.2 Aug 6, 2026
@rmi22186
rmi22186 merged commit 4a7e90f into main Aug 6, 2026
2 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