fix: gate KYC on device support and patch Segment deeplink crash - #2200
fix: gate KYC on device support and patch Segment deeplink crash#2200transphorm 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.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 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 |
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