Skip to content

chore: sync Rokt kit with upstream page-view storage refactor - #1323

Closed
alexs-mparticle wants to merge 1 commit into
mainfrom
feat/rokt-kit-upstream-sync-page-view-features
Closed

chore: sync Rokt kit with upstream page-view storage refactor#1323
alexs-mparticle wants to merge 1 commit into
mainfrom
feat/rokt-kit-upstream-sync-page-view-features

Conversation

@alexs-mparticle

Copy link
Copy Markdown
Collaborator

Summary

  • Syncs kits/rokt from upstream mParticle-integrations/mparticle-javascript-integration-rokt development branch with unreleased commits post-v1.30.2.
  • Ports upstream refactor that extracts page-view storage into dedicated modules (pageViewStorage.ts, storage.ts, utils.ts), adds a byte-budget cap on stored page views, namespaces the localStorage key with migration from the legacy key, and captures page title and canonical URL in page view events.
  • 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/pageViewStorage.ts` (new)
  • `kits/rokt/src/storage.ts` (new)
  • `kits/rokt/src/utils.ts` (new)
  • `kits/rokt/test/src/tests.spec.ts`
  • `kits/rokt/test/src/pageViewStorage.spec.ts` (new)
  • `kits/rokt/test/src/storage.spec.ts` (new)
  • `kits/rokt/test/src/utils.spec.ts` (new)
  • `kits/rokt/dist/**` (rebuilt in monorepo context)

Test plan

  • `npm ci` in `kits/rokt` on Node v24.14.0
  • `npm run build` in `kits/rokt` on Node v24.14.0: Vite completes successfully (existing declaration-generation type diagnostics from monorepo `../../src/vault.ts` are pre-existing)
  • `npm test` in `kits/rokt` on Node v24.14.0: 288 passed across 4 test files

Notes

  • Builds on chore: sync Rokt kit with upstream v1.30.2 #1313 which synced through v1.30.2. This PR ports the three subsequent unreleased feature commits from the `development` branch.
  • `AGENTS.md` and `CHANGELOG.md` from the upstream repo are not included — no new release tag exists yet for these commits.

Ports upstream commits b428b15, 4b041a5, 7b65606 from
mparticle-javascript-integration-rokt development branch (post-v1.30.2).
@alexs-mparticle
alexs-mparticle requested a review from a team as a code owner August 14, 2026 20:25
@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Adds client-side behavioral page history sent to Rokt on placement calls; mitigations include URL sanitization, storage caps, and noTargeting opt-out, but this still affects targeting/privacy-sensitive data flows.

Overview
Syncs the Rokt kit with upstream page-view capture work: mParticle page views are persisted in namespaced localStorage (with migration from mpPageViews), trimmed to a ~100KB budget, and attached to selectPlacements as a JSON page_events attribute (including derived active time on page, plus title and sanitized canonical URL).

Supporting logic moves into pageViewStorage, storage, and utils (URL query stripping before persistence). noTargeting now skips capture, clears stored views on init, and active_time_on_site_ms is blocked from select-placements attribute persistence. Dist is rebuilt (kit 1.30.2).

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

@sonarqubecloud

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 06da278. Configure here.

Comment thread kits/rokt/src/Rokt-Kit.ts
if (this.isTargetingDisabled()) {
try {
clearPageViewsStorage();
clearPageViews();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Opt-out still forwards stored page views

Medium Severity

When noTargeting is set, init only clears the namespaced pageViews field and process skips both capture and session-end cleanup. selectPlacements still loads page views, and that read path migrates leftover mpPageViews into storage and attaches them as page_events. Partners who opted out of targeting can still send prior browsing history to Rokt.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 06da278. Configure here.

@rmi22186 rmi22186 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but agents.md is missing from othis repo

@rmi22186 rmi22186 closed this Aug 18, 2026
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