feat: [SDK-5235] add a shared Identity Verification resolver for alias and token - #1503
Merged
Merged
Conversation
ivResolver exports resolveBackendParams, resolveJwt and legacyBackendParams. Call sites gate on isIvCodePathEnabled; the resolver gates on isIvBehaviorActive inside, so with the flag on and the requirement off it returns the legacy onesignal_id values. Under IV an owned operation addresses the user by external_id and carries the stored token. An anonymous operation under IV logs an error and falls back to onesignal_id. resolveJwt returns the token only, for endpoints that address a subscription by id. No executor uses the resolver yet, so the bundle is unchanged.
sherwinski
added this pull request to stack #1507
September 22, 2026 02:31
fadi-george
approved these changes
Sep 22, 2026
… gate itself Every caller passed op._onesignalId, so the parameter only added a way to pass a mismatched pair. isIvBehaviorActive implies isIvCodePathEnabled, so the resolver needs no outer gate at the call sites.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
1 Line Summary
One resolver,
src/core/executors/ivResolver.ts, decides the alias and the token for a user-addressed request under Identity Verification.Details
Third pull request of the M3 stack for Identity Verification for Web SDK. Stacked on SDK-5234. Web mirror of Android
ExecutorsIvExtensions.kt.src/core/executors/ivResolver.tsIvBackendParams { alias: AliasPair; jwt?: string }.AliasPairis what everyrequests/api.tsfunction already takes, so call sites pass it through.resolveBackendParams(op, jwtTokenStore): alias switch plus token. The legacy values (onesignal_idalias, no token) come from a module-private helper that readsop._onesignalId. Under IV an owned operation addresses the user byexternal_idand carries the stored token for that user. An anonymous operation under IV logs an error and falls back toonesignal_id; the enqueue and start-up purges from M2 should keep that case out of the queue.resolveJwt(op, jwtTokenStore): token only, for endpoints that address a subscription by id or have no alias in the path.Gates. The resolver gates on
isIvBehaviorActive()itself.isIvBehaviorActive()impliesisIvCodePathEnabled(), so a call site needs no outer gate; the resolver is a pure function of the gates and the operation. With the flag on and the requirement off (Phase 3) it returns the legacy values, so the request is identical to the legacy path. An earlier revision tookonesignalIdas a parameter and expected an outer gate at each call site; review dropped both. The 2 gates come fromsrc/core/identityVerification.ts; the token store is a parameter, not a global read.No executor uses the resolver yet. SDK-5236 wires the 6 executors. The bundle is unchanged.
Systems Affected
Validation
Tests
Info
New
src/core/executors/ivResolver.test.ts(10 tests), the web mirror of AndroidExecutorsIvExtensionsTests.kt:resolveBackendParams: legacy when IV is inactive even with a stored token; legacy under Phase 3;external_idplus token when active;external_idand no token when none is stored; legacy plus an error log for an anonymous operation; the requirement alone turns IV on.resolveJwt: undefined when inactive even with a stored token; the stored token when active; undefined without a stored token; undefined and no log for an anonymous operation.vp check,vp test(716 tests), andvp run build:prodpass.Checklist
Programming Checklist
Interfaces:
Functions:
Typescript:
Other:
elem of arraysyntax. PreferforEachor usemapcontextif possible. Instead, we can pass it to function/constructor so that we don't callOneSignal.contextScreenshots
Info
Not needed. No user-visible change.
Checklist
Related Tickets