fix: gate KYC on device support and patch Segment deeplink crash - #2200
Draft
transphorm wants to merge 2 commits into
Draft
fix: gate KYC on device support and patch Segment deeplink crash#2200transphorm wants to merge 2 commits into
transphorm wants to merge 2 commits into
Conversation
…unches Two-layer gate for KYC on unsupported (non-Play-Services) Android devices: the service guard fails closed at launch, and every UI entry point now hides its KYC offer via useKycLauncher's isKycSupported. Fallback screens no longer mutate the onboarding funnel branch before the support check passes, and the camera-permission alert only offers alternative verification when supported. Also patches @segment/analytics-react-native to fix a crash. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📝 WalkthroughWalkthroughThis PR adds Android device-support and KYC retryability checks, propagates support state through KYC launchers and document screens, conditionally hides unsupported alternative-verification paths, and patches Segment native deeplink dispatch. ChangesKYC device support gating
Estimated code review effort: 3 (Moderate) | ~30 minutes Segment analytics deeplink patch
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
transphorm
marked this pull request as draft
July 12, 2026 15:26
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.
Addreseses
Summary
aligned_alloc, which Android only provides from API 28, so launching it on Android 8 and below throws an uncatchableUnsatisfiedLinkErrorin a background coroutine and crashes the app.launchKycVerificationreturns afailedresult with a newunsupportedDeviceerror type instead of calling the SDK; the KYC failure screen disables retry for it viaisRetryableKycFailure.useKycLauncher().isKycSupported; fallback handlers no longer flip the onboarding funnel branch tokycbefore the support check passes.@segment/analytics-react-native@2.23.0to fix a bridgeless-mode (New Architecture) crash intrackDeepLinks, mirroring upstream fix(android): crash on New Architecture in trackDeepLinks segmentio/analytics-react-native#1146.Flow
flowchart LR subgraph Entry points A[IDPickerScreen] & B[Trouble / fallback screens] & C[Camera permission alert] end A -->|showKycOption| G{isKycSupportedOnDevice} B -->|"isKycSupported (hide button)"| G C -->|onFallback only if supported| G G -->|supported| H[useKycLauncher.launchKycVerification] G -->|unsupported| M[Device-not-supported modal / hidden] H --> S[kycService.launchKycVerification] S -->|unsupported guard| F["failed: unsupportedDevice (canRetry=false)"] S -->|supported| D[Didit SDK startVerification]Changes
React Native app
integrations/kyc: newKYC_MIN_ANDROID_API_LEVEL(28),KYC_UNSUPPORTED_DEVICE_MESSAGE,isKycSupportedOnDevice(),isRetryableKycFailure();launchKycVerificationfails closed withunsupportedDevicebefore touching the Didit SDK.useKycLauncher: exposesisKycSupported, shows a "Device not supported" modal if a launch is somehow triggered anyway, and routes the fallback modal through the same check.selfClientProvider: thekycdocument-type branch navigates straight toKycFailure(no retry) on unsupported devices, andcanRetrynow respectsisRetryableKycFailure.IDPicker,DocumentNFCScan,DocumentNFCTrouble,DocumentCameraTrouble,DataConfirmation,RegistrationFallbackNFC/MRZ,AadhaarUploadError,LogoConfirmation,DocumentOnboarding): KYC buttons/options render only when supported;setOnboardingBranch('kyc')only fires when the launch can proceed; the camera-permission alert omits "Try Alternative Verification" when unsupported.SDK core
id-selection-screenaccepts an optionalshowKycOptionprop (defaulttrue, backwards-compatible) to hide the limited-security IDs section.Tests
isRetryableKycFailure, and the hook's unsupported-device modal; screen/provider test mocks updated for the newisKycSupported/isKycSupportedOnDevicesurface.Config/infra
@segment/analytics-react-native@2.23.0replacing theReactNativeHost.reactInstanceManagerlookup (unsupported on New Architecture) withreactApplicationContext.getNativeModule; drop once a release newer than 2.23.0 ships the upstream fix.Test Plan
pnpm --filter @selfxyz/mobile-app exec jeston affected suites (kycService, useKycLauncher, selfClientProvider, DataConfirmation, DocumentNFCTrouble, navigation, cameraPermission) — 61 tests passingtsc --noEmitandeslintclean on changed filestrackDeepLinksNative Consolidation Checklist
🤖 Generated with Claude Code
Summary by CodeRabbit