Skip to content

eidCache: add merging targeting responses to core - #330

Open
etiennelatendresse-optable wants to merge 1 commit into
masterfrom
migrate-eid-cache-merge
Open

eidCache: add merging targeting responses to core#330
etiennelatendresse-optable wants to merge 1 commit into
masterfrom
migrate-eid-cache-merge

Conversation

@etiennelatendresse-optable

@etiennelatendresse-optable etiennelatendresse-optable commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Why

Cache-merge logic could be moved to a core reusable function.

What Changed

  • Add mergeCache, resolveRefs, getRefData, isUid2stale
  • Add tests
  • Update doc

How to Test

  • Tested
  • Docs updated

Notes

  • Breaking change
  • Requires release

@etiennelatendresse-optable
etiennelatendresse-optable force-pushed the migrate-eid-cache-merge branch 3 times, most recently from fe6955b to 7f669a0 Compare September 2, 2026 16:48
@etiennelatendresse-optable etiennelatendresse-optable changed the title eidCache: add addon merging targeting responses eidCache: add merging targeting responses to core Sep 2, 2026
@mosherBT
mosherBT self-requested a review September 2, 2026 19:05
Comment thread lib/core/eid-cache.ts
}>;
// UID2 refresh material resolved from the response refs map. Cache-only:
// the RTD module strips it before EIDs reach bid requests.
_ref?: Uid2RefData;

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.

Before this lands: the comment on _ref says "the RTD module strips it before EIDs reach bid requests." RTD isn't the only egress. shemedia and pmc have been leaking UID2 refresh_token into bid requests since 2026-08-25 via pubProvidedId, which never touches RTD. chess hit the same bug and fixed it locally in Optable/optable-solutions#774 the day before.

There are now three strippers for this one field (rtd.ts, stripSidecars in #331, cleanEid in the wrappers), each covering a different subset. Every new egress is a leak until someone adds a fourth.

Suggestion: keep refresh material off the EID, in a sidecar keyed by source.

refs?: Record<string, Uid2RefData>;  // keyed by eid.source

resolveRefs writes refs[eid.source]; getRefData, isUid2Stale and uid2-refresh look up by source. Cached EIDs then are wire EIDs, nothing needs stripping, and mergeCache can drop uids[].ext.optable.ref too. Migration is one release of read-side fallback for caches that still have _ref.

Happy to push it onto the branch.

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.

I agree with MO that RTD is not the only reader of this. I am not against the refs structure if it will help us moving forward. But the way we solutionize this code already we populate _ref, so the migration path might be trickier. But if we decide this is fine we can work that our

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