Repository navigation
eidCache: let firstPartyMatchers keep a third-party EID over a first-party one - #362
etiennelatendresse-optable wants to merge 2 commits into
Conversation
21cd816 to
dd90626
Compare
| newEids.forEach((eid) => { | ||
| if (!eid.uids?.length) return; | ||
| const held = eidMap.get(eid.source); | ||
| if (held && isFirstParty(eid) && !isFirstParty(held)) return; |
There was a problem hiding this comment.
Claude says thirdparty already in cache can't be revoked by first party. Can you verify this isn't the case
There was a problem hiding this comment.
Sorry, are you asking me if the claude claim is false or if its true that third-party cache cant be revoked by first party? Basically, do we want:
Revocation always wins regardless of party
or
A first-party call revokes only its own entries, so it cant revoke third-party
| newEids.forEach((eid) => { | ||
| if (!eid.uids?.length) return; | ||
| const held = eidMap.get(eid.source); | ||
| if (held && isFirstParty(eid) && !isFirstParty(held)) return; |
There was a problem hiding this comment.
Also claude says that the refresh data can be mixed up here. WE need to apply the selection logic higher up
There was a problem hiding this comment.
I cant reproduce this. Ran all 18 combinations of old matcher + new matcher + new-ref present and the surviving ref always belonged to the surviving EID
Why
When targeting and tokenize both resolve the same source,
mergeCachekept 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
mergeCachetakes afirstPartyMatchersoption. 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.matchercounts as third-party.CachedEidcarriesmatcher, which the SDK already read untyped in the analytics and event paths.How to Test
.mdalongside the code (for examplelib/addons/<addon>.md) and the matching README section. New addons ship with a new.md.Notes