Skip to content

eidCache: let firstPartyMatchers keep a third-party EID over a first-party one - #362

Merged
mosherBT merged 3 commits into
masterfrom
eid-cache-matcher-preference
Oct 15, 2026
Merged

mosherBT merged 3 commits into
masterfrom
eid-cache-matcher-preference

Conversation

@etiennelatendresse-optable

@etiennelatendresse-optable etiennelatendresse-optable commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Why

When targeting and tokenize both resolve the same source, mergeCache kept whichever landed last, so a first-party result could overwrite a third-party one that carried more. Deciding by the EID's label instead of arrival order lets the two calls run in parallel.

What changed

  • mergeCache takes a firstPartyMatchers option. With it set, a first-party EID no longer displaces a third-party one already cached on that source, and the kept EID keeps its refs.
  • An EID with no matcher counts as third-party.
  • CachedEid carries matcher, which the SDK already read untyped in the analytics and event paths.
  • Without the option, every new EID still wins its source, and a source sent with no uids is still revoked.

How to Test

  • Tested
  • Docs updated — if this adds, changes or removes anything a consumer calls, update the module's .md alongside the code (for example lib/addons/<addon>.md) and the matching README section. New addons ship with a new .md.

Notes

  • Breaking change
  • Requires release

@etiennelatendresse-optable
etiennelatendresse-optable marked this pull request as ready for review October 8, 2026 18:07
Comment thread lib/core/eid-cache.ts Outdated
Comment thread lib/core/eid-cache.ts Outdated
Comment thread lib/core/eid-cache.ts Outdated
@mosherBT
mosherBT merged commit 9a8c1b5 into master Oct 15, 2026
7 checks passed
@mosherBT
mosherBT deleted the eid-cache-matcher-preference branch October 15, 2026 18:12
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.

2 participants