Skip to content

analytics: auction with Optable sources is not missed - #356

Open
MO-Thibault wants to merge 2 commits into
Optable:masterfrom
MO-Thibault:mo/analytics-missed-cache-read
Open

MO-Thibault wants to merge 2 commits into
Optable:masterfrom
MO-Thibault:mo/analytics-missed-cache-read

Conversation

@MO-Thibault

Copy link
Copy Markdown
Contributor

Summary

An auction is flagged missed when it started before the analytics hook attached to Prebid. That flag ignored whether Optable EIDs were already on the bid requests. When the wrapper reads the EID cache before the hook attaches, the auction is enriched but was still reported as missed.

toWitness now sends missed: missed && optableSources.length === 0. optableLoaded is unchanged and still reflects hook timing only.

Case missed optableLoaded
Hooked in before the auction false true
Hook attached late, Optable sources present false false
Hook attached late, no sources true false

Downstream

Historical rows can be corrected in SQL with missed AND ARRAY_LENGTH(optableSources) = 0. Historical optableLoaded values are already correct.

Test plan

  • pnpm exec jest lib/addons/prebid/analytics.test.ts: 85/85 pass
  • New unit tests on toWitness for a replayed auction with and without Optable sources
  • New end-to-end test: a replayed auction with sources emits missed: false, optableLoaded: false

🤖 Generated with Claude Code

MO-Thibault and others added 2 commits October 2, 2026 13:40
A replayed auction that already carries Optable EIDs read the cache before
the hook attached, so it was not truly missed. missed and optableLoaded now
reflect that.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A replayed auction with Optable sources read the cache, so it is not missed,
but the SDK still was not hooked in when the auction started. optableLoaded
goes back to reflecting hook timing only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@MO-Thibault
MO-Thibault requested review from a team as code owners October 2, 2026 17:41

@jplaroche jplaroche left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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