Repository navigation
test: [SDK-5249] port the Android IV test matrix to Vitest - #1530
Merged
Merged
Conversation
login(A, tokenA) gets a 401 on the create-user request: the login call rejects, userJwtInvalidated fires with the external id, the token is removed, and the operation waits. updateUserJwt(A, tokenB) releases it, and the create-user request goes out again with the new bearer. A second test pins a non-401 failure on the same request: the call rejects with the pause result, the token stays, and no event fires.
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
Both cases reject for the result they name. A 401 on create-user removes the token and the follow-up request uses the new one. A 400 pauses the repo and keeps the token. The 401 case never shows that the operation stays held in between.
fadi-george
reviewed
Oct 23, 2026
fadi-george
reviewed
Oct 23, 2026
abdulraqeeb33
approved these changes
Oct 23, 2026
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
The 401 case now waits five queue intervals and shows the login stays held before updateUserJwt.
fadi-george
reviewed
Oct 23, 2026
fadi-george
reviewed
Oct 23, 2026
fadi-george
reviewed
Oct 23, 2026
fadi-george
reviewed
Oct 23, 2026
The queue also holds the create-subscription operation with a local id, so a length check cannot tell a held login from a dropped one. The 401 case checks the queue holds a LoginUserOperation. The 400 case counts one create-user request, checks the repo is still paused after the wait, and checks the login is still at the head of the queue.
fadi-george
approved these changes
Oct 23, 2026
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
Cross-cutting pass over the Android Identity Verification test matrix: the mapping to the Vitest suites, and the 2 cases that were missing.
Details
The ticket asks for a comparison against the Android matrix and tests for the gaps. The mapping below is the result. Every Android row has a web counterpart, or a reason why web has none. Two cases were missing, and this PR adds them to
OneSignal.test.tsunderlogin > a new user under Identity Verification:login(A, tokenA)→ 401 on the create-user request → the login call rejects with_FailUnauthorized,userJwtInvalidatedfires with the external id, the token is removed, the identity already points at A, and the operation waits →updateUserJwt(A, tokenB)→ the create-user request goes out again withAuthorization: Bearer token-b, and the identity gets the onesignal id. This is the "Also add" row of the ticket; the existing tests covered its pieces (a tag update 401, the event, a held operation released byupdateUserJwt) but not the chain where the login request itself is the one the server rejects._enqueueAndWait(SDK-5233).Mapping
Android counts are test rows in the files the ticket names.
IdentityVerificationServiceTests.ktidentityVerification.test.tsstart subscribes to ConfigModelStoreand the 4 hydrate handler rows: no web counterpart. Web has no hydrate handler; the page fetches the config before the repo starts, andOperationRepo._startruns the purge. Covered by theanonymous operation purge on startandJWT requirement UNKNOWNblocks inOperationRepo.test.ts.JwtTokenStoreTests.ktJwtTokenStore.test.tsExecutorsIvExtensionsTests.ktivResolver.test.ts,executorsIv.test.tsresolveIvBackendParamsandresolveIvJwtrows: covered.shouldFailLoginUserFromSubscription: no web counterpart. That guard belongs toLoginUserFromSubscriptionOperationExecutor, the Android v4→v5 migration path, which web does not have.OperationRepoTests.kt(IV rows 1013-1161)OperationRepo.test.tsJWT requirement UNKNOWNblock.removeOperationsWithoutExternalIdandonJwtConfigHydrated(true/false):anonymous operation purge on startblock (IV active and inactive). 401 requeue and 401 drop when inactive:FailUnauthorizedblock, plus the in-flight newer token and the no-spin case.LoginHelperTests.ktLoginManager.test.ts,OneSignal.test.tsLogoutHelperTests.ktLoginManager.test.tsa login during the logout waits,a logout during the login waits for it), disable push on the old user under IV, legacy path when IV is inactive: covered.HttpClientTests.kt(rows 263-291)executorsIv.test.tsfetchhas no such ordering.identityVerificationService(newCodePathsRun, ivBehaviorActive)setJwtRequirement+setFeatureFlagsThe other "Also add" row
"A test that the token store prune method is called on init, if web calls it." Web does not call
_pruneToExternalIdsfrom production code, and neither does Android (pruneToExternalIdshas no caller outside its tests). Nothing to test; noted on the ticket.Bundle size
Test-only change. No change to the bundles.
Systems Affected
Validation
Tests
Info
vp test run— 71 files, 822 tests pass.vp check— 0 errors, 5 pre-existing warnings.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: test-only change.
Checklist
Related Tickets