Skip to content

id5: add resolveId5 with QA flags, bounded live resolution and a dedicated cache - #341

Open
etiennelatendresse-optable wants to merge 6 commits into
masterfrom
id5-resolution
Open

etiennelatendresse-optable wants to merge 6 commits into
masterfrom
id5-resolution

Conversation

@etiennelatendresse-optable

@etiennelatendresse-optable etiennelatendresse-optable commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

Theres need for a resolveId5/getCachedId5UserId, the on-demand ID5 resolution used to enrich targeting calls.

What Changed

  • resolveId5(partnerId, { isBot?, timeoutMs? }), QA flags first (optableResolveID5ID, optableResolveId5), then a 7-day cache, then a live resolution with ID5's A/B holdout disabled, validating the partner id and rejecting the "0" placeholder.
  • The cache lives in its own OPTABLE_ID5 key instead of _id5 metadata piggybacked on a cached EID, same reasoning as the _ref refs-sidecar change in eidCache: add merging targeting responses to core #330: cached EIDs stay wire-clean.
  • Live resolution is bounded (default 10s): the bundles' copies awaited ID5's onUpdate forever, and a hang blocked targeting.
  • Bot gating is a caller-supplied isBot callback
  • Tests, README section.

How to Test

  • Tested
  • Docs updated

Notes

@etiennelatendresse-optable
etiennelatendresse-optable requested a review from a team as a code owner September 30, 2026 15:21
Comment thread lib/core/id5.ts Outdated
Comment thread lib/core/id5.ts Outdated
Comment thread lib/core/id5.ts
Comment thread lib/core/id5.ts
}

const storageAllowed = options.deviceAccess?.() ?? true;
const cached = storageAllowed ? getCachedId5UserId(partnerId) : null;

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.

This should be protected by consent signals I think

Comment thread lib/core/id5.ts
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