Skip to content

targeting: add TargetingOncePerSession for wrappers that resolve targeting once - #353

Merged
etiennelatendresse-optable merged 1 commit into
masterfrom
targeting-session-guard
Sep 29, 2026
Merged

etiennelatendresse-optable merged 1 commit into
masterfrom
targeting-session-guard

Conversation

@etiennelatendresse-optable

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

Copy link
Copy Markdown
Contributor

Why

OPTABLE_TARGETING_DONE is the marker that says targeting already resolved this session. The SDK owns it. Its declared in lib/edge/targeting.ts and written by SkipTargetingForBots, but never exported

What Changed

  • TargetingOncePerSession(sdk, input?): skips the call when the marker is set, marks it on success, and resolves null instead of rejecting when the call fails, so identity resolution cannot break the page. A failure leaves the marker unset, so a later page retries.
  • SkipTargetingForBots writes the marker through the same internal helper, so there is one writer
  • Add tests
  • README updated

How to Test

  • Tested
  • Docs updated

Notes

  • Breaking change
  • Requires release

@etiennelatendresse-optable etiennelatendresse-optable changed the title targeting: export the session-resolved marker and its guard helpers targeting: add TargetingOncePerSession for wrappers that resolve targeting once Sep 28, 2026
@etiennelatendresse-optable
etiennelatendresse-optable force-pushed the targeting-session-guard branch 3 times, most recently from ea27f48 to 50e0bbe Compare September 28, 2026 19:05
@etiennelatendresse-optable
etiennelatendresse-optable merged commit d12ce68 into master Sep 29, 2026
7 checks passed
@etiennelatendresse-optable
etiennelatendresse-optable deleted the targeting-session-guard branch September 29, 2026 18:44
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