Skip to content

feat: Enhance local launcher logic with user threshold check#49

Merged
guillermot merged 2 commits intodevelopmentfrom
feat/SDKE-361-50-50-traffic-split-for-rokt-launcher
Oct 13, 2025
Merged

feat: Enhance local launcher logic with user threshold check#49
guillermot merged 2 commits intodevelopmentfrom
feat/SDKE-361-50-50-traffic-split-for-rokt-launcher

Conversation

@guillermot
Copy link
Collaborator

Summary

Enhance local launcher logic with user threshold check. This commit implements a 50/50 traffic split mechanism for the Rokt Local Launcher feature by adding a user threshold check.

Changes Made

Enhanced Local Launcher Logic (src/Rokt-Kit.js):

  • Added _isUserAboveLocalLauncherThreshold() function that implements a 50% threshold check using Math.random() > 0.5
  • Modified isPartnerInLocalLauncherTestGroup() to include the threshold check alongside the existing isLocalLauncherEnabled configuration
  • Users are now randomly assigned to either local or remote launcher based on the threshold

Comprehensive Test Coverage (test/src/tests.js):

  • Added test case for users below threshold (random = 0) → should create remote launcher
  • Added test case for users above threshold (random = 1) → should create local launcher
  • Added Math.random mock setup to ensure deterministic test behavior

Impact:

Enables gradual rollout of the local launcher feature with 50/50 traffic split
Maintains backward compatibility with existing configuration
Provides robust test coverage for the new threshold logic

Testing Plan

{explain how this has been tested, and what additional testing should be done}

@guillermot guillermot marked this pull request as ready for review October 13, 2025 15:18
@guillermot guillermot requested a review from mattbodle October 13, 2025 16:04
@guillermot guillermot merged commit 037e403 into development Oct 13, 2025
4 checks passed
rmi22186 pushed a commit that referenced this pull request Oct 13, 2025
* feat: Enhance local launcher logic with user threshold check

* Rename function

---------

Co-authored-by: Guillermo Tamanaha <v-gtamanaha@mparticle.com>
github-actions bot pushed a commit that referenced this pull request Oct 13, 2025
# [1.10.0](v1.9.0...v1.10.0) (2025-10-13)

### Features

* Enhance local launcher logic with user threshold check ([#49](#49)) ([06e3f40](06e3f40))
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.

3 participants

Comments