Skip to content

wurfl rtd: add none_lce enrichment type for A/B test control group#14527

Open
lucor wants to merge 6 commits intoprebid:masterfrom
WURFL:feature/wurfl-ab-none-lce
Open

wurfl rtd: add none_lce enrichment type for A/B test control group#14527
lucor wants to merge 6 commits intoprebid:masterfrom
WURFL:feature/wurfl-ab-none-lce

Conversation

@lucor
Copy link
Contributor

@lucor lucor commented Feb 27, 2026

Type of change

  • Feature
  • Refactoring (no functional changes, no api changes)

Description of change

Distinguish control-group beacons where LCE would have been used (no cache) from those where WURFL cache was present.

  • Add NONE_LCE enrichment type: control + no cache → 'none_lce'
  • Remove abExcludeLCE parameter
  • Simplify ABTestManager by removing LCE exclusion logic
  • Fix control group early return skipped reading wurfl_id, sampling_rate, tier and over_quota from cache, sending empty/default values in the beacon.

Distinguish control-group beacons where LCE would have been used (no
cache) from those where WURFL cache was present.

- Add NONE_LCE enrichment type: control + no cache → 'none_lce'
- Remove abExcludeLCE parameter
- Simplify ABTestManager by removing LCE exclusion logic
@patmmccann patmmccann changed the title feat(wurfl-rtd): add none_lce enrichment type for A/B test control group wurfl rtd: add none_lce enrichment type for A/B test control group Feb 27, 2026
Control group early return skipped reading wurfl_id, sampling_rate, tier
and over_quota from cache, sending empty/default values in the beacon.
…data

fix(wurfl-rtd): read cache metadata in control group beacon
@lucor lucor marked this pull request as ready for review March 2, 2026 17:25
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 394643e96f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1161 to +1165
if (cachedWurflData) {
wurflId = cachedWurflData.WURFL?.wurfl_id || '';
samplingRate = cachedWurflData.wurfl_pbjs?.sampling_rate ?? DEFAULT_SAMPLING_RATE;
tier = cachedWurflData.wurfl_pbjs?.tier ?? '';
overQuota = cachedWurflData.wurfl_pbjs?.over_quota ?? DEFAULT_OVER_QUOTA;

Choose a reason for hiding this comment

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

P2 Badge Reset control-group beacon metadata when cache is absent

In the control-group early return, cache-derived fields are only updated inside the if (cachedWurflData) block, so when a user had cache on a previous auction but later runs without cache, wurfl_id, sampling_rate, tier, and over_quota keep stale values from the prior run. This mislabels none_lce beacons and can apply the wrong sampling rate (including skipping beacons unexpectedly) because onAuctionEndEvent uses the persisted module-level state.

Useful? React with 👍 / 👎.

@coveralls
Copy link
Collaborator

coveralls commented Mar 2, 2026

Pull Request Test Coverage Report for Build 22723213253

Details

  • 36 of 36 (100.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.001%) to 96.324%

Files with Coverage Reduction New Missed Lines %
test/spec/modules/id5AnalyticsAdapter_spec.js 1 96.13%
Totals Coverage Status
Change from base Build 22634058503: -0.001%
Covered Lines: 217296
Relevant Lines: 225589

💛 - Coveralls

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 437faa8db2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1161 to +1165
if (cachedWurflData) {
wurflId = cachedWurflData.WURFL?.wurfl_id || '';
samplingRate = cachedWurflData.wurfl_pbjs?.sampling_rate ?? DEFAULT_SAMPLING_RATE;
tier = cachedWurflData.wurfl_pbjs?.tier ?? '';
overQuota = cachedWurflData.wurfl_pbjs?.over_quota ?? DEFAULT_OVER_QUOTA;

Choose a reason for hiding this comment

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

P2 Badge Reset control-group beacon metadata on cache miss

When the control-group early return runs without cache, wurflId, samplingRate, tier, and overQuota are left untouched, so they can leak values from a previous auction and produce incorrect none_lce beacon metadata (including incorrect sampling decisions in onAuctionEndEvent). Fresh evidence in this commit is that abExcludeLCE was removed, so the no-cache control path now runs under default A/B config and this stale-state bug affects the normal experiment flow rather than an opt-in edge case.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The module-level variables (wurflId, samplingRate, tier, overQuota) are reset to defaults in init() which runs once per page load. Within the same page, localStorage cache doesn't disappear between auctions — if cache is present at auction 1, it's present at auction 2. This is also the same pattern used in the treatment path (lines 1173-1250), where cache and LCE branches don't explicitly reset each other's state either.

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