fix(#256-259): WebSocket forward-compat, 4401 refresh, recovery deep … - #358
Open
SouthToxic wants to merge 1 commit into
Open
fix(#256-259): WebSocket forward-compat, 4401 refresh, recovery deep …#358SouthToxic wants to merge 1 commit into
SouthToxic wants to merge 1 commit into
Conversation
…recovery deep link, vault ownership ethos-protocol#256 — Add unrecognised type discriminator tests - Android: new test 'events ignores unknown type discriminator without crashing' in VaultEventSocketTest.kt sends a future type followed by a known one; asserts no crash and the unknown frame is silently dropped per api-contract.md. - iOS: test already existed (test_unknownMessageType_firesUnknownEvent); no change needed. ethos-protocol#257 — Handle WebSocket close code 4401 with silent token refresh retry - Android VaultEventSocket: after the incoming loop drains, await closeReason and throw Auth4401Exception for code 4401. Catch path attempts one silent refreshToken() call; on success stores the new token and reconnects immediately (no backoff); on failure emits auth_failure sentinel event and terminates the flow. Injectable 'refreshToken' lambda added for unit-test seam. - iOS VaultEventSocket: closeCode added to WebSocketTasking protocol so MockWebSocketTask can simulate a 4401 close. handleReceive() branches on task.closeCode == 4401 into new handleAuth4401(), which fires an injectable tokenRefresh closure; success stores token and reconnects, failure transitions state to .authFailure. ConnectionState.authFailure case added. - Android tests (3 new): refresh-succeeds reconnects, refresh-fails emits auth_failure, non-4401 close does not call refresh. - iOS tests (3 new): same three branches via MockWebSocketTask.simulateClose(code:). ethos-protocol#258 — Add /auth/recover/link deep link route - Android: RecoveryDeepLink(token) data class + parseRecoveryLink(Uri) in VaultDeepLinkParser; requires https scheme, exact host, path /auth/recover/link, non-empty token passing the [A-Za-z0-9_-]{1,128} allowlist. - iOS: DeepLink.recoveryLink(token) case in UniversalLinkRouter; /auth/recover/link route parsed in parse(url:); recoveryLink event added to DeepLinkLogger. - Android tests (7): well-formed URL, missing/empty token, wrong scheme/host/path, invalid token chars, over-length token, max-length token. - iOS tests (8): well-formed URL, missing/empty token, invalid chars, oversized token, wrong host, custom scheme, logging once. ethos-protocol#259 — Validate vault ID ownership before navigating deep links - Android: ownerVaultIds: Set<String>? on VaultDeepLinkParser (null = skip check); parseUrl() and parse() reject vaults not in the set with a generic null return that does not reveal vault existence. - iOS: ownerVaultIDs: Set<String>? on UniversalLinkRouter (nil = skip check); vaultAction, vaultInvitation, and beneficiaryAcceptance branches all guard through isOwnedVault() before routing. - Android tests (5): owned passes, unowned returns null, null set skips check, empty set rejects all, Uri variant. - iOS tests (6): owned passes, unowned returns nil, nil set skips check, invitation and acceptance unowned cases, empty set.
|
@SouthToxic Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
…link, vault ownership
closes #256 — Add unrecognised type discriminator tests
closes #257 — Handle WebSocket close code 4401 with silent token refresh retry
closes #258 — Add /auth/recover/link deep link route
closes #259 — Validate vault ID ownership before navigating deep links
Summary
Changes
Testing
Parity checklist
This PR does not add, change, or remove any user-facing feature on either
platform — no PARITY.md update needed.
— OR —
This PR adds/changes/removes a user-facing feature. I have updated PARITY.md:
Related issues