feat: prevent caching of active_time_on_site_ms attribute - #106
Merged
Conversation
Add active_time_on_site_ms to the selectPlacements persistence deny-list so it forwards to the Rokt SDK on the current call but is never cached into userAttributes. Time-on-site is a moving value; caching it would cause a stale copy to be re-sent on subsequent selectPlacements calls. Mirrors how commerce attributes (confirmationRef, totalprice, etc.) are handled: forwarded-but-not-persisted.
rmi22186
approved these changes
Jul 30, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 31, 2026
# [1.29.0](v1.28.3...v1.29.0) (2026-07-31) ### Features * prevent caching of active_time_on_site_ms attribute ([#106](#106)) ([315c4f9](315c4f9))
Collaborator
|
🎉 This PR is included in version 1.29.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
active_time_on_site_msto theselectPlacementsattribute persistence deny-list so the value forwards to the Rokt SDK on the current call but is never cached intothis.userAttributes.Time-on-site is a moving value. Because the kit caches forwarded attributes and re-sends them on subsequent
selectPlacementscalls until user attributes change, a cached copy would be re-sent stale on later calls. Deny-listing it means each call sends its own fresh value (or none), never a stale one — exactly how commerce attributes (confirmationRef,totalprice, etc.) are already handled.The kit is an open pass-through, so no change was needed for the value to flow — this is purely about correctness (avoiding a stale cached value).
Related
active_time_on_site_msinto theselectPlacementsattributes map.Rollout order: this kit change should ship before mParticle/mparticle-web-sdk#1303. The kit is what strips the value from the persistence cache, so deny-listing it must be live before the core SDK starts emitting the attribute — otherwise the moving value could be cached and re-sent stale in the window between the two deploys.
Changes
src/selectPlacementsAttributePersistence.ts— addactive_time_on_site_mstoSELECT_PLACEMENTS_ATTRIBUTE_PERSISTENCE_DENY_LIST(matched case-insensitively).test/src/tests.spec.ts— 3 new tests:active_time_on_site_mson the current call without caching it.isSelectPlacementsAttributePersistenceDeniedmatches the key case-insensitively.Verification
TS2339dts warning unrelated to this change)🤖 Generated with Claude Code