Skip to content

chore: remove client-side mParticle batch-stream pipeline#101

Open
alexs-mparticle wants to merge 1 commit into
mainfrom
chore/remove-batch-stream
Open

chore: remove client-side mParticle batch-stream pipeline#101
alexs-mparticle wants to merge 1 commit into
mainfrom
chore/remove-batch-stream

Conversation

@alexs-mparticle

Copy link
Copy Markdown
Collaborator

Summary

Removes the redundant client-side batch-stream pipeline from the Rokt Kit. The kit no longer calls window.Rokt.__batch_stream__() or builds/queues mParticle batches. Server-side mParticle integration now handles this data independently.

IDSync (Workspace search) and per-event placement-flag mapping are fully preserved — this change is scoped to the batch path only.

Removed

Symbol Notes
processBatch() Public batch-stream entry point
sendBatchStream() Called window.Rokt.__batch_stream__()
drainBatchQueue() Drained queued batches on kit ready
batchQueue / batchStreamQueue Queuing arrays
enrichCommerceEventTypes() Commerce event override for batch path
mergePendingIdentityEvents() / buildIdentityEvent() / pendingIdentityEvents Identity-event injection into batches
ROKT_IDENTITY_EVENT_TYPE / RoktIdentityEventType Unused after removal
__batch_stream__? Removed from the RoktGlobal interface

Kept (untouched)

  • process(event) — per-event placement flag mapping
  • onUserIdentified() / search() — Workspace IDSync
  • onLogoutComplete() — clears userIdentifiedInWorkspace + search cache
  • onLoginComplete() / onModifyComplete() — refresh user attributes, return success string
  • handleIdentityComplete() — kept ONLY the userAttributes refresh line
  • selectPlacements() attribute flow

Runtime safety

Order-independent with the WSDK rollout: the WSDK guards its call with typeof __batch_stream__ === 'function', and the mParticle SDK only invokes processBatch if the forwarder implements it. Dropping processBatch here is therefore safe to ship before or after the WSDK changes.

Verification

  • npm run lint — PASS
  • npm run build — PASS (emits IIFE/CJS/ESM)
  • npm run test — PASS (205 tests; 23 batch-stream tests removed)

Pre-existing TypeScript type errors in the IDSync code (stale @mparticle/web-sdk types, documented in source TODOs) are unrelated and reduced from 8 → 7. dist/ artifacts are intentionally not committed (generated by CI release).

The batch-stream path that forwarded mParticle event batches to the Rokt
Transactions Gateway via window.Rokt.__batch_stream__() is now redundant —
server-side mParticle integration handles this data independently.

Remove:
- processBatch / sendBatchStream / drainBatchQueue
- batchQueue / batchStreamQueue queuing arrays
- enrichCommerceEventTypes commerce override
- mergePendingIdentityEvents / buildIdentityEvent / pendingIdentityEvents
- ROKT_IDENTITY_EVENT_TYPE enum and RoktIdentityEventType
- __batch_stream__ from the RoktGlobal interface

IDSync (Workspace search) and per-event placement-flag mapping are
untouched. handleIdentityComplete keeps only the userAttributes refresh,
so the identity callbacks remain no-op-safe and continue returning their
success strings.
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.

1 participant