-
Notifications
You must be signed in to change notification settings - Fork 180
SELF-702: Refactor navigation structure and dev utilities #994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SELF-702: Refactor navigation structure and dev utilities #994
Conversation
WalkthroughRoutes, screens, and tests are renamed from Passport* to Document* across navigation and UI. Prove flow route keys are shortened (e.g., ProveScreen → Prove). Navigation composition is reorganized (misc → system), dev screens updated/removed, preload utility added, deeplink/clipboard targets updated, build chunks adjusted, and docs/tests synchronized. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant QR as QRCodeViewFinder
participant Nav as Navigation
participant Prove as Prove
participant Status as ProofRequestStatus
User->>QR: Scan QR
QR->>Nav: navigate('Prove')
Note over Nav,Prove: Route keys shortened (ProveScreen → Prove)
Prove-->>Status: on verify success → navigate('ProofRequestStatus')
sequenceDiagram
autonumber
actor User
participant Launch as LaunchScreen
participant DocOnb as DocumentOnboarding
participant Cam as DocumentCamera
participant NFC as DocumentNFCScan
participant CB as ConfirmBelonging
User->>Launch: Start
Launch->>DocOnb: navigate('DocumentOnboarding')
DocOnb->>Cam: navigate('DocumentCamera')
Cam->>NFC: navigate('DocumentNFCScan')
NFC->>CB: navigate('ConfirmBelonging')
Note over DocOnb,NFC: All Passport* routes renamed to Document*
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
17f96de to
d4f7eb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 13
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (25)
app/src/utils/deeplinks.ts (1)
79-92: Sanitize sessionId inside selfApp JSON before using itCurrently, selfAppStr is JSON-parsed and its sessionId is used without validation, bypassing the regex guard applied to query param sessionId. A crafted deep link could inject an invalid sessionId into the store and listener. Validate the inner sessionId with the same pattern before mutating state or starting listeners.
Apply this diff to validate and short-circuit on invalid/missing sessionId:
if (selfAppStr) { try { - const selfAppJson = JSON.parse(selfAppStr); - useSelfAppStore.getState().setSelfApp(selfAppJson); - useSelfAppStore.getState().startAppListener(selfAppJson.sessionId); - navigationRef.navigate('Prove'); + const selfAppJson = JSON.parse(selfAppStr); + const sessionIdFromApp = selfAppJson?.sessionId; + const isValidSessionId = + typeof sessionIdFromApp === 'string' && + VALIDATION_PATTERNS.sessionId.test(sessionIdFromApp); + if (!isValidSessionId) { + if (typeof __DEV__ !== 'undefined' && __DEV__) { + console.error('Invalid or missing sessionId in selfApp payload'); + } + navigationRef.navigate('QRCodeTrouble'); + return; + } + useSelfAppStore.getState().setSelfApp(selfAppJson); + useSelfAppStore.getState().startAppListener(sessionIdFromApp); + navigationRef.navigate('Prove');app/src/components/NavBar/HomeNavBar.tsx (2)
24-55: Do not log sensitive token or selfApp data.Clipboard tokens and parsed selfApp may contain identifiers/session info; avoid emitting these to console.
Apply:
- console.log('Consume token content:', content); + if (__DEV__) console.debug('Clipboard token present:', Boolean(content)); @@ - console.log('Consume token response:', response); + if (__DEV__) console.debug('Consume token response ok:', response.ok); - const result = await response.json(); - console.log('Consume token result:', result); + const result = await response.json(); @@ - console.log('Consume token selfApp:', selfApp); + if (__DEV__) console.debug('selfApp received');
36-44: Add fetch timeout and encode the token.Prevent indefinite hangs and ensure the UUID is safely transmitted.
- const response = await fetch( - `https://api.self.xyz/consume-deferred-linking-token?token=${content}`, - ); + const ac = new AbortController(); + const to = setTimeout(() => ac.abort(), 10_000); + const response = await fetch( + `https://api.self.xyz/consume-deferred-linking-token?token=${encodeURIComponent(content)}`, + { signal: ac.signal, headers: { Accept: 'application/json' } } + ); + clearTimeout(to); + if (!response.ok) throw new Error(`HTTP ${response.status}`);app/src/screens/prove/QRCodeViewFinderScreen.tsx (1)
70-79: Validate selfApp shape before using it.Guard against malformed or malicious QR payloads before storing/starting listeners.
- const selfAppJson = JSON.parse(selfApp); - useSelfAppStore.getState().setSelfApp(selfAppJson); - useSelfAppStore.getState().startAppListener(selfAppJson.sessionId); + const selfAppJson = JSON.parse(selfApp); + // minimal runtime validation + if ( + !selfAppJson || + typeof selfAppJson.sessionId !== 'string' || + typeof selfAppJson.websocketUrl !== 'string' + ) { + throw new Error('Invalid selfApp shape'); + } + // optional host allowlist to mitigate rogue QR codes + try { + const { hostname, protocol } = new URL(selfAppJson.websocketUrl); + const allowed = ['self.xyz', 'stg.self.xyz']; + if (!/^wss?:$/.test(protocol) || !allowed.some(h => hostname.endsWith(h))) { + throw new Error('Untrusted websocket host'); + } + } catch (e) { + throw new Error('Invalid websocket URL'); + } + useSelfAppStore.getState().setSelfApp(selfAppJson); + useSelfAppStore.getState().startAppListener(selfAppJson.sessionId);app/src/utils/proving/provingMachine.ts (1)
381-401: Reject mismatched status UUIDs to prevent subscribing to the wrong proof.Using the server-sent UUID when it differs from the client UUID is risky.
- if (get().uuid !== statusUuid) { - console.warn( - `Received status UUID (${statusUuid}) does not match stored UUID (${get().uuid}). Using received UUID.`, - ); - } + if (get().uuid !== statusUuid) { + console.error('Mismatched status UUID; aborting.'); + trackEvent(ProofEvents.SOCKETIO_SUBSCRIBE_ABORTED, { reason: 'uuid_mismatch' }); + actor!.send({ type: 'PROVE_ERROR' }); + return; + } const endpointType = get().endpointType;app/src/screens/document/DocumentNFCTroubleScreen.tsx (1)
34-36: Misleading tip for an NFC trouble screen. Replace camera-specific guidance.“Fill the Frame” is about camera framing and doesn’t apply to NFC failures; it can confuse users at a critical error point.
- { - title: 'Fill the Frame', - body: 'Make sure the entire ID page is within the camera view, with all edges visible.', - }, + { + title: 'Align Chip and Phone', + body: 'Place the chip area of your document flush against the back of your phone and move slowly until you feel a vibration.', + },app/src/screens/document/DocumentCameraScreen.tsx (1)
82-86: Potential crash on undefined fields; guard formatting and length reads.If
dateOfBirth/dateOfExpiryorpassportNumberare missing,formatDateToYYMMDD(...)and.lengthwill throw before/while logging the failure—masking the real error.- const formattedDateOfBirth = - Platform.OS === 'ios' ? formatDateToYYMMDD(dateOfBirth) : dateOfBirth; - const formattedDateOfExpiry = - Platform.OS === 'ios' ? formatDateToYYMMDD(dateOfExpiry) : dateOfExpiry; + const rawDob = dateOfBirth ?? ''; + const rawDoe = dateOfExpiry ?? ''; + const formattedDateOfBirth = + Platform.OS === 'ios' && rawDob ? formatDateToYYMMDD(rawDob) : rawDob; + const formattedDateOfExpiry = + Platform.OS === 'ios' && rawDoe ? formatDateToYYMMDD(rawDoe) : rawDoe; - trackEvent(PassportEvents.CAMERA_SCAN_FAILED, { + trackEvent(PassportEvents.CAMERA_SCAN_FAILED, { reason: 'invalid_format', - passportNumberLength: passportNumber.length, - dateOfBirthLength: formattedDateOfBirth.length, - dateOfExpiryLength: formattedDateOfExpiry.length, + passportNumberLength: passportNumber?.length ?? 0, + dateOfBirthLength: formattedDateOfBirth?.length ?? 0, + dateOfExpiryLength: formattedDateOfExpiry?.length ?? 0, duration_seconds: parseFloat(scanDurationSeconds), });Also applies to: 95-101
app/src/screens/dev/create-mock/CreateMockScreenDeepLink.tsx (1)
47-61: Harden input validation and error handling for mock generation.deepLinkGender is cast to 'M'|'F' without normalization; unexpected values will break generation. Also, failures from genMockIdDocAndInitDataParsing/storePassportData aren’t caught, leaving navigation in an inconsistent state.
Apply normalization + try/catch:
const handleGenerate = useCallback(async () => { - const storeState = useUserStore.getState(); - const idDocInput: Partial<IdDocInput> = { + const storeState = useUserStore.getState(); + const sex = storeState.deepLinkGender?.toUpperCase(); + if (sex !== 'M' && sex !== 'F') { + // Fail fast with a clear message (or default to 'M' for dev-only) + throw new Error('Invalid gender; expected M or F'); + } + const idDocInput: Partial<IdDocInput> = { idType: 'mock_passport', firstName: storeState.deepLinkName, lastName: storeState.deepLinkSurname, birthDate: storeState.deepLinkBirthDate, - sex: storeState.deepLinkGender as 'M' | 'F', + sex, nationality: storeState.deepLinkNationality, }; - const passportData = genMockIdDocAndInitDataParsing(idDocInput); - await storePassportData(passportData); - navigation.navigate('ConfirmBelonging', {}); - useUserStore.getState().clearDeepLinkUserDetails(); + try { + const passportData = genMockIdDocAndInitDataParsing(idDocInput); + await storePassportData(passportData); + navigation.navigate('ConfirmBelonging', {}); + } catch (e) { + console.error('Mock generation failed:', e); + // Optionally surface a dev toast/modal here + return; + } finally { + useUserStore.getState().clearDeepLinkUserDetails(); + } }, [navigation]);app/src/screens/document/DocumentNFCScanScreen.tsx (3)
515-525: Local image source bug: do not wrap Metro asset in { uri }.For RN/Tamagui Image, a bundled asset import should be passed directly as the source; wrapping in { uri } breaks on native.
- <Image + <Image height="$8" width="$8" alignSelf="center" borderRadius={1000} - source={{ - uri: NFC_IMAGE, - }} + source={NFC_IMAGE} margin={20} />
382-386: Use public iOS settings API; avoid private URL schemes.App-Prefs is a private scheme and will be rejected. Use Linking.openSettings() for iOS.
- if (Platform.OS === 'ios') { - Linking.openURL('App-Prefs:root=General&path=About'); - } else { + if (Platform.OS === 'ios') { + Linking.openSettings(); + } else { Linking.sendIntent('android.settings.NFC_SETTINGS'); }
370-371: Sanitize user-visible error text.openErrorModal(message) surfaces raw errors that can include low-level details/PII. Pass the sanitized message instead.
- openErrorModal(message); + openErrorModal(sanitized);app/src/screens/document/DocumentNFCMethodSelectionScreen.tsx (2)
20-27: Strengthen type-safety for navigation params; remove casts.Local NFCParams can drift from the scan screen’s route params, and navigation.navigate('DocumentNFCScan', params as never) bypasses checks. Reuse the shared route param type and remove unsafe casts.
-type NFCParams = { +// Prefer importing the shared type used by DocumentNFCScan +// import type { DocumentNFCScanRouteParams } from '@/navigation/document' // or central types module +type NFCParams = { skipPACE?: boolean; canNumber?: string; useCan?: boolean; skipCA?: boolean; extendedMode?: boolean; usePacePolling?: boolean; }; @@ - navigation.navigate('DocumentNFCScan', params as never); + // Ensure params satisfy the scan route’s type + navigation.navigate('DocumentNFCScan', params as any);Ideally, type the navigator: useNavigation<NavigationProp<AppStackParamList, 'DocumentNFCMethodSelection'>>() and navigate with strongly-typed params.
Also applies to: 126-133
121-131: Validate CAN input (numeric, length 6) before navigating.Avoid NFC failures due to malformed CAN.
if (selectedMethod === 'can' && !canValue) { - setError('Please enter your CAN number.'); + setError('Please enter your 6‑digit CAN number.'); return; } @@ - if (selectedMethod === 'can') { - params.canNumber = canValue; - } + if (selectedMethod === 'can') { + if (!/^\d{6}$/.test(canValue)) { + setError('CAN must be 6 digits.'); + return; + } + params.canNumber = canValue; + }Also applies to: 161-169
app/src/screens/document/UnsupportedDocumentScreen.tsx (1)
70-73: Normalize ISO-2 codes to uppercase to prevent downstream mismatchesYou construct a mixed-case ISO-2 code (“De”), then upper-case it only for the flag lookup. The same value is sent to sendCountrySupportNotification, which may expect “DE”. Standardize to uppercase at the source.
Apply:
- const extractedCode = iso2 - ? iso2.charAt(0).toUpperCase() + iso2.charAt(1).toLowerCase() - : 'Unknown'; + const extractedCode = iso2 ? iso2.toUpperCase() : 'Unknown';app/src/screens/prove/ConfirmBelongingScreen.tsx (2)
110-116: Copy still references “passport”; align with Document namingThis screen text conflicts with the PR-wide Document renames and can confuse users. Update copy.
- <Description textAlign="center" paddingBottom={20}> - By continuing, you certify that this passport belongs to you and is - not stolen or forged. Once registered with Self, this document will - be permanently linked to your identity and can't be linked to - another one. - </Description> + <Description textAlign="center" paddingBottom={20}> + By continuing, you certify that this document belongs to you and is + not stolen or forged. Once registered with Self, this document will + be permanently linked to your identity and can't be linked to + another identity. + </Description>
41-46: Prevent double-submit during permission promptThe button can be tapped repeatedly while permission is in progress. You already track this with state; wire it into the disabled condition.
- const [_requestingPermission, setRequestingPermission] = useState(false); + const [isRequestingPermission, setRequestingPermission] = useState(false);- <PrimaryButton + <PrimaryButton trackEvent={PassportEvents.OWNERSHIP_CONFIRMED} onPress={onOkPress} - disabled={!isReadyToProve} + disabled={!isReadyToProve || isRequestingPermission} >Also applies to: 118-121
docs/development-patterns.md (1)
11-20: Docs inconsistent with refactor (passportScreens → documentScreens)Snippet should reflect new screen groups to avoid onboarding mistakes.
export const navigationScreens = { ...systemScreens, - ...passportScreens, + ...documentScreens, ...homeScreens, ...proveScreens, ...settingsScreens, ...recoveryScreens, ...devScreens, // Feature screens added last to override others ...getAesopScreens(), };app/src/screens/dev/create-mock/CreateMockScreen.tsx (1)
334-341: Logic bug: Age decrement disabled condition uses expiryYearsThe “Decrease Age” button is disabled based on expiryYears, so it can allow age to underflow or incorrectly disable.
- onPress={() => { - buttonTap(); - setAge(age - 1); - trackEvent(MockDataEvents.DECREASE_AGE); - }} - disabled={expiryYears <= 0} + onPress={() => { + buttonTap(); + setAge(Math.max(0, age - 1)); + trackEvent(MockDataEvents.DECREASE_AGE); + }} + disabled={age <= 0}app/src/screens/settings/DocumentDataInfoScreen.tsx (2)
102-112: Bug: falsy values (0, '') are replaced by 'None'.Using
|| 'None'hides legitimate 0/empty-string values. Switch to nullish coalescing.- : (metadata?.[key as keyof PassportMetadata] as - | string - | number) || 'None' + : (metadata?.[key as keyof PassportMetadata] ?? + 'None') as string | number
73-82: Avoid non-null assertions, harden the loading path, and use the existing analytics keyconst result = await getData(); - if (!result || !result.data) { + if (!result?.data) { // handle error/log return; } - setMetadata(result.data.passportMetadata!); - trackEvent(DocumentEvents.PASSPORT_METADATA_LOADED); + const pm = result.data.passportMetadata; + if (!pm) { + // TODO: surface error/log + return; + } + setMetadata(pm); + trackEvent(DocumentEvents.PASSPORT_METADATA_LOADED);• Remove
metadatafrom the hook’s dependency array (use[getData, trackEvent]) to prevent reload loops.
• NoDocumentEvents.DOCUMENT_METADATA_LOADEDkey exists—continue usingPASSPORT_METADATA_LOADED.app/src/screens/document/DocumentOnboardingScreen.tsx (1)
11-11: Don’t rename PassportEvents to DocumentEvents—DocumentEvents lacks CAMERA_SCAN_ keys*
DocumentEvents only defines document lifecycle events; CAMERA_SCAN_STARTED/CANCELLED are in PassportEvents. Either keep importing PassportEvents in DocumentOnboardingScreen.tsx or add those CAMERA_SCAN_* entries to DocumentEvents in analytics.ts.app/src/navigation/index.tsx (2)
99-104: Prevent blank screen: add flex:1 to GestureHandlerRootViewWithout a flex style, the navigator can render at height 0 on native, leading to a blank screen or clipped gestures.
Apply:
- return ( - <GestureHandlerRootView> + return ( + <GestureHandlerRootView style={{ flex: 1 }}> <Suspense fallback={<SuspenseFallback />}> <Navigation ref={navigationRef} onStateChange={trackScreen} /> </Suspense> </GestureHandlerRootView> );
37-38: Gate devScreens behind an explicit flag
- devScreens are unconditionally spread into navigationScreens (app/src/navigation/index.tsx:37-38), exposing mock and private-key UIs in production.
- Wrap the spread of devScreens in a build‐time or runtime guard (e.g.
__DEV__orDEBUG_SCREEN) and remove them from your deep‐link routing configuration.- Ensure analytics filters out dev route names to prevent them appearing in production dashboards.
app/src/navigation/prove.ts (1)
60-67: Header style only covers title color; verify back button/foreground contrastWith a black header, default back arrow and tint may be unreadable if not set. Consider explicitly setting headerTintColor to white for consistency.
Apply:
Prove: { screen: ProveScreen, options: { title: 'Request Proof', headerStyle: { backgroundColor: black, }, headerTitleStyle: { color: white, }, + headerTintColor: white, } as NativeStackNavigationOptions, },app/tests/src/navigation.test.ts (1)
64-70: Mock the module without clobbering other exportsIf '@/hooks/useAesopRedesign' exports additional symbols, the current mock replaces the whole module and can cause undefined-access errors. Merge with the real module to keep other exports intact.
-jest.mock('@/hooks/useAesopRedesign', () => ({ - shouldShowAesopRedesign: jest.fn().mockReturnValue(true), -})); +jest.mock('@/hooks/useAesopRedesign', () => { + const actual = jest.requireActual('@/hooks/useAesopRedesign'); + return { + ...actual, + shouldShowAesopRedesign: jest.fn().mockReturnValue(true), + }; +});
🧹 Nitpick comments (8)
app/src/screens/recovery/DocumentDataNotFoundScreen.tsx (1)
27-34: Harden navigation on error.If hasAnyValidRegisteredDocument throws, ensure we still route predictably.
- const onPress = async () => { - const hasValidDocument = await hasAnyValidRegisteredDocument(selfClient); - if (hasValidDocument) { - navigateToHome(); - } else { - navigateToLaunch(); - } - }; + const onPress = async () => { + try { + const hasValidDocument = await hasAnyValidRegisteredDocument(selfClient); + hasValidDocument ? navigateToHome() : navigateToLaunch(); + } catch { + navigateToLaunch(); + } + };app/src/navigation/home.ts (1)
11-16: Fix trailing commas in React.lazy calls to satisfy tooling.Static analysis flags the dangling commas after the single argument to
lazy(...). Remove them to quiet the warning and keep CI green.-const DisclaimerScreen = lazy( - () => import('@/screens/home/DisclaimerScreen'), -); -const HomeScreen = lazy( - () => import('@/screens/home/HomeScreen'), -); +const DisclaimerScreen = lazy( + () => import('@/screens/home/DisclaimerScreen') +); +const HomeScreen = lazy( + () => import('@/screens/home/HomeScreen') +);Also consider adopting the new
lazyWithPreloadhelper here (per PR objective) so we can preload Home/Disclaimer on app warm paths and reduce perceived latency.app/src/screens/document/DocumentNFCTroubleScreen.tsx (1)
76-83: Update feedback origin to match the Document flow.Keep telemetry/ticket routing consistent with the rename.
- origin: 'passport/nfc-trouble', + origin: 'document/nfc-trouble',app/src/screens/document/DocumentCameraScreen.tsx (1)
170-173: Generalize user-facing copy to match Document flow.*The screen title says “ID”, but the disclaimer hardcodes “PASSPORT”. Align the message to avoid confusion.
- <Additional style={styles.disclaimer}> - SELF WILL NOT CAPTURE AN IMAGE OF YOUR PASSPORT. - </Additional> + <Additional style={styles.disclaimer}> + SELF WILL NOT CAPTURE AN IMAGE OF YOUR ID DOCUMENT. + </Additional>app/src/screens/document/DocumentNFCScanScreen.tsx (1)
186-196: Verify PACE polling heuristic.documentType + countryCode === 'IDFRA' assumes documentType === 'ID'. MRZ often uses 'I' for ID cards. If your store uses 'I', this logic never triggers. Please confirm the stored values and adjust (e.g., documentType.startsWith('I') && countryCode === 'FRA').
app/src/screens/document/UnsupportedDocumentScreen.tsx (1)
199-207: Align analytics events to “Document” naming for unsupported documents
DocumentEvents is defined but lacks NOTIFY_UNSUPPORTED_DOCUMENT and DISMISS_UNSUPPORTED_DOCUMENT. Add these entries inanalytics.tsand swap outPassportEvents.NOTIFY_UNSUPPORTED_PASSPORT/PassportEvents.DISMISS_UNSUPPORTED_PASSPORTfor the newDocumentEventsvariants.app/src/navigation/aesop.ts (1)
12-14: Suspense boundary verified around NavigationA
<Suspense fallback={…}>wraps<Navigation>inapp/src/navigation/index.tsx(lines 100–102), so your lazy-loadedDocumentOnboardingScreenwon’t crash at runtime. Optionally, use yourlazyWithPreloadhelper for DEBUG_SCREEN paths to preload and speed up these screens.app/src/navigation/settings.ts (1)
16-21: Use lazyWithPreload for settings screens
- Import the helper from the correct path:
import { lazyWithPreload } from '@/navigation/lazyWithPreload';- Swap out your
lazy(calls forlazyWithPreload(on bothDocumentDataInfoScreenandSettingsScreento enable on-demand warming and shave off first-paint latency.- Happy to help wire up
DEBUG_SCREENto invoke.preload()if you’d like.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (47)
README.md(1 hunks)app/src/components/NavBar/HomeNavBar.tsx(1 hunks)app/src/hooks/useModal.ts(1 hunks)app/src/navigation/aesop.ts(1 hunks)app/src/navigation/dev.ts(4 hunks)app/src/navigation/document.ts(2 hunks)app/src/navigation/home.ts(1 hunks)app/src/navigation/index.tsx(2 hunks)app/src/navigation/lazyWithPreload.ts(1 hunks)app/src/navigation/prove.ts(1 hunks)app/src/navigation/recovery.ts(2 hunks)app/src/navigation/recovery.web.ts(1 hunks)app/src/navigation/settings.ts(2 hunks)app/src/navigation/settings.web.ts(2 hunks)app/src/navigation/system.tsx(2 hunks)app/src/screens/aesop/DocumentOnboardingScreen.tsx(2 hunks)app/src/screens/dev/create-mock/CreateMockScreen.tsx(3 hunks)app/src/screens/dev/create-mock/CreateMockScreenDeepLink.tsx(3 hunks)app/src/screens/dev/create-mock/index.ts(1 hunks)app/src/screens/dev/feature-flags/index.ts(1 hunks)app/src/screens/dev/haptic-feedback/DevHapticFeedbackScreen.tsx(2 hunks)app/src/screens/dev/haptic-feedback/index.ts(1 hunks)app/src/screens/dev/private-key/index.ts(1 hunks)app/src/screens/dev/settings/DevSettingsScreen.tsx(2 hunks)app/src/screens/dev/settings/index.ts(1 hunks)app/src/screens/document/DocumentCameraScreen.tsx(4 hunks)app/src/screens/document/DocumentCameraTroubleScreen.tsx(2 hunks)app/src/screens/document/DocumentNFCMethodSelectionScreen.tsx(3 hunks)app/src/screens/document/DocumentNFCScanScreen.tsx(5 hunks)app/src/screens/document/DocumentNFCScanScreen.web.tsx(2 hunks)app/src/screens/document/DocumentNFCTroubleScreen.tsx(2 hunks)app/src/screens/document/DocumentOnboardingScreen.tsx(2 hunks)app/src/screens/document/UnsupportedDocumentScreen.tsx(2 hunks)app/src/screens/prove/ConfirmBelongingScreen.tsx(1 hunks)app/src/screens/prove/ProveScreen.tsx(1 hunks)app/src/screens/prove/QRCodeViewFinderScreen.tsx(4 hunks)app/src/screens/recovery/DocumentDataNotFoundScreen.tsx(2 hunks)app/src/screens/settings/DocumentDataInfoScreen.tsx(2 hunks)app/src/screens/settings/ManageDocumentsScreen.tsx(1 hunks)app/src/screens/settings/SettingsScreen.tsx(2 hunks)app/src/screens/system/LaunchScreen.tsx(1 hunks)app/src/utils/deeplinks.ts(2 hunks)app/src/utils/proving/provingMachine.ts(2 hunks)app/tests/src/navigation.test.ts(3 hunks)app/tests/utils/deeplinks.test.ts(2 hunks)app/vite.config.ts(2 hunks)docs/development-patterns.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/technical-specification.mdc)
**/*.{ts,tsx}: Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Files:
app/src/screens/prove/ProveScreen.tsxapp/src/screens/system/LaunchScreen.tsxapp/src/screens/prove/ConfirmBelongingScreen.tsxapp/src/screens/settings/ManageDocumentsScreen.tsxapp/src/utils/proving/provingMachine.tsapp/src/screens/dev/create-mock/CreateMockScreenDeepLink.tsxapp/tests/utils/deeplinks.test.tsapp/src/screens/dev/create-mock/index.tsapp/src/screens/document/DocumentNFCScanScreen.web.tsxapp/src/screens/dev/haptic-feedback/DevHapticFeedbackScreen.tsxapp/src/utils/deeplinks.tsapp/src/components/NavBar/HomeNavBar.tsxapp/src/screens/settings/SettingsScreen.tsxapp/src/navigation/lazyWithPreload.tsapp/src/screens/prove/QRCodeViewFinderScreen.tsxapp/src/screens/dev/feature-flags/index.tsapp/src/screens/dev/create-mock/CreateMockScreen.tsxapp/src/navigation/recovery.web.tsapp/src/screens/dev/private-key/index.tsapp/vite.config.tsapp/src/screens/dev/settings/index.tsapp/src/screens/recovery/DocumentDataNotFoundScreen.tsxapp/src/hooks/useModal.tsapp/src/screens/settings/DocumentDataInfoScreen.tsxapp/src/screens/document/DocumentOnboardingScreen.tsxapp/src/screens/dev/haptic-feedback/index.tsapp/src/navigation/recovery.tsapp/src/navigation/aesop.tsapp/src/screens/aesop/DocumentOnboardingScreen.tsxapp/src/screens/document/DocumentNFCMethodSelectionScreen.tsxapp/src/screens/dev/settings/DevSettingsScreen.tsxapp/src/screens/document/DocumentCameraTroubleScreen.tsxapp/src/screens/document/UnsupportedDocumentScreen.tsxapp/src/navigation/index.tsxapp/src/screens/document/DocumentNFCTroubleScreen.tsxapp/src/navigation/home.tsapp/src/screens/document/DocumentCameraScreen.tsxapp/src/navigation/document.tsapp/src/navigation/system.tsxapp/tests/src/navigation.test.tsapp/src/screens/document/DocumentNFCScanScreen.tsxapp/src/navigation/prove.tsapp/src/navigation/dev.tsapp/src/navigation/settings.tsapp/src/navigation/settings.web.ts
app/src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:
- Component architecture and reusability
- State management patterns
- Performance optimizations
- TypeScript type safety
- React hooks usage and dependencies
- Navigation patterns
Files:
app/src/screens/prove/ProveScreen.tsxapp/src/screens/system/LaunchScreen.tsxapp/src/screens/prove/ConfirmBelongingScreen.tsxapp/src/screens/settings/ManageDocumentsScreen.tsxapp/src/utils/proving/provingMachine.tsapp/src/screens/dev/create-mock/CreateMockScreenDeepLink.tsxapp/src/screens/dev/create-mock/index.tsapp/src/screens/document/DocumentNFCScanScreen.web.tsxapp/src/screens/dev/haptic-feedback/DevHapticFeedbackScreen.tsxapp/src/utils/deeplinks.tsapp/src/components/NavBar/HomeNavBar.tsxapp/src/screens/settings/SettingsScreen.tsxapp/src/navigation/lazyWithPreload.tsapp/src/screens/prove/QRCodeViewFinderScreen.tsxapp/src/screens/dev/feature-flags/index.tsapp/src/screens/dev/create-mock/CreateMockScreen.tsxapp/src/navigation/recovery.web.tsapp/src/screens/dev/private-key/index.tsapp/src/screens/dev/settings/index.tsapp/src/screens/recovery/DocumentDataNotFoundScreen.tsxapp/src/hooks/useModal.tsapp/src/screens/settings/DocumentDataInfoScreen.tsxapp/src/screens/document/DocumentOnboardingScreen.tsxapp/src/screens/dev/haptic-feedback/index.tsapp/src/navigation/recovery.tsapp/src/navigation/aesop.tsapp/src/screens/aesop/DocumentOnboardingScreen.tsxapp/src/screens/document/DocumentNFCMethodSelectionScreen.tsxapp/src/screens/dev/settings/DevSettingsScreen.tsxapp/src/screens/document/DocumentCameraTroubleScreen.tsxapp/src/screens/document/UnsupportedDocumentScreen.tsxapp/src/navigation/index.tsxapp/src/screens/document/DocumentNFCTroubleScreen.tsxapp/src/navigation/home.tsapp/src/screens/document/DocumentCameraScreen.tsxapp/src/navigation/document.tsapp/src/navigation/system.tsxapp/src/screens/document/DocumentNFCScanScreen.tsxapp/src/navigation/prove.tsapp/src/navigation/dev.tsapp/src/navigation/settings.tsapp/src/navigation/settings.web.ts
**/*.{test,spec}.{ts,js,tsx,jsx}
⚙️ CodeRabbit configuration file
**/*.{test,spec}.{ts,js,tsx,jsx}: Review test files for:
- Test coverage completeness
- Test case quality and edge cases
- Mock usage appropriateness
- Test readability and maintainability
Files:
app/tests/utils/deeplinks.test.tsapp/tests/src/navigation.test.ts
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Organize screens by feature modules (passport, home, settings, etc.)
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/navigation/**/*.{ts,tsx} : Set platform-specific initial routes: web → Home, mobile → Splash
Applied to files:
app/src/screens/system/LaunchScreen.tsxapp/src/screens/settings/SettingsScreen.tsxapp/vite.config.tsdocs/development-patterns.mdapp/src/navigation/index.tsxapp/src/navigation/home.tsapp/src/navigation/system.tsx
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Use custom hooks for complex state (useModal, useHapticNavigation)
Applied to files:
app/src/screens/system/LaunchScreen.tsxapp/src/screens/dev/haptic-feedback/DevHapticFeedbackScreen.tsxapp/src/screens/prove/QRCodeViewFinderScreen.tsxapp/src/hooks/useModal.ts
📚 Learning: 2025-08-29T15:30:12.155Z
Learnt from: CR
PR: selfxyz/self#0
File: app/AGENTS.md:0-0
Timestamp: 2025-08-29T15:30:12.155Z
Learning: Document complex native module changes for AI review
Applied to files:
app/src/screens/settings/ManageDocumentsScreen.tsxapp/src/utils/proving/provingMachine.tsapp/vite.config.tsdocs/development-patterns.mdapp/src/screens/document/DocumentCameraScreen.tsxapp/src/navigation/document.ts
📚 Learning: 2025-08-29T15:31:15.911Z
Learnt from: CR
PR: selfxyz/self#0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.911Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Test isPassportDataValid() with realistic synthetic passport data (never real user data)
Applied to files:
app/src/utils/proving/provingMachine.tsapp/src/screens/dev/create-mock/CreateMockScreenDeepLink.tsxapp/tests/utils/deeplinks.test.tsapp/src/utils/deeplinks.tsapp/src/screens/dev/create-mock/CreateMockScreen.tsxapp/src/screens/settings/DocumentDataInfoScreen.tsxapp/src/screens/document/UnsupportedDocumentScreen.tsxapp/tests/src/navigation.test.ts
📚 Learning: 2025-08-29T15:31:15.911Z
Learnt from: CR
PR: selfxyz/self#0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.911Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Use actual imports from selfxyz/mobile-sdk-alpha in tests
Applied to files:
app/tests/utils/deeplinks.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks
Applied to files:
app/tests/utils/deeplinks.test.tsapp/src/screens/dev/create-mock/index.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Applied to files:
app/src/screens/dev/create-mock/index.tsapp/src/screens/dev/feature-flags/index.tsapp/src/screens/dev/private-key/index.tsapp/src/screens/dev/settings/index.tsapp/src/screens/dev/haptic-feedback/index.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to native/ios/**/*.{swift} : iOS NFC: implement custom PassportReader as a Swift module
Applied to files:
app/src/screens/document/DocumentNFCScanScreen.web.tsxapp/src/screens/document/DocumentNFCScanScreen.tsx
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Integrate haptic feedback via useHapticNavigation
Applied to files:
app/src/screens/dev/haptic-feedback/DevHapticFeedbackScreen.tsxapp/src/screens/prove/QRCodeViewFinderScreen.tsx
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/**/screens/**/*.{ts,tsx} : Lazy load screens using React.lazy()
Applied to files:
app/src/navigation/lazyWithPreload.tsapp/src/navigation/recovery.web.tsapp/vite.config.tsapp/src/navigation/recovery.tsapp/src/navigation/aesop.tsapp/src/navigation/home.tsapp/src/navigation/document.tsapp/src/navigation/system.tsxapp/src/navigation/prove.tsapp/src/navigation/dev.tsapp/src/navigation/settings.tsapp/src/navigation/settings.web.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/**/screens/**/*.{ts,tsx} : Lazy load screens and components to improve performance
Applied to files:
app/src/navigation/lazyWithPreload.tsapp/vite.config.tsapp/src/navigation/aesop.tsapp/src/navigation/home.tsapp/src/navigation/document.tsapp/src/navigation/system.tsxapp/src/navigation/prove.tsapp/src/navigation/dev.tsapp/src/navigation/settings.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/navigation/**/*.{ts,tsx} : Use react-navigation/native with createStaticNavigation for type-safe navigation
Applied to files:
app/src/navigation/recovery.web.tsapp/src/hooks/useModal.tsapp/src/navigation/aesop.tsapp/src/navigation/index.tsxapp/src/navigation/home.tsapp/src/navigation/document.tsapp/src/navigation/dev.ts
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
PR: selfxyz/self#942
File: app/vite.config.ts:170-0
Timestamp: 2025-08-23T02:02:02.556Z
Learning: In the selfxyz/self React Native app, devTools from '@/navigation/devTools' are intentionally shipped to production builds for testing purposes, not excluded as is typical in most applications.
Applied to files:
README.mdapp/vite.config.tsapp/src/navigation/index.tsxapp/src/navigation/dev.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Organize screens by feature modules (passport, home, settings, etc.)
Applied to files:
README.mdapp/vite.config.tsdocs/development-patterns.mdapp/src/navigation/aesop.tsapp/src/screens/dev/settings/DevSettingsScreen.tsxapp/src/navigation/index.tsxapp/src/navigation/document.tsapp/src/navigation/dev.tsapp/src/navigation/settings.tsapp/src/navigation/settings.web.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Use a custom modal system with useModal hook and callback registry
Applied to files:
app/src/hooks/useModal.ts
🧬 Code graph analysis (11)
app/src/utils/proving/provingMachine.ts (1)
app/src/navigation/index.tsx (1)
navigationRef(55-55)
app/tests/utils/deeplinks.test.ts (2)
app/src/navigation/index.tsx (1)
navigationRef(55-55)app/src/screens/ProveScreen.tsx (1)
generatingProof(21-247)
app/src/utils/deeplinks.ts (2)
app/src/navigation/index.tsx (1)
navigationRef(55-55)app/src/screens/ProveScreen.tsx (1)
generatingProof(21-247)
app/src/components/NavBar/HomeNavBar.tsx (1)
app/src/screens/ProveScreen.tsx (1)
generatingProof(21-247)
app/src/screens/prove/QRCodeViewFinderScreen.tsx (1)
app/src/screens/ProveScreen.tsx (4)
generatingProof(21-247)ProveScreenProps(17-19)result(83-108)key(200-209)
app/src/navigation/aesop.ts (1)
app/src/components/NavBar/ProgressNavBar.tsx (1)
ProgressNavBar(28-113)
app/src/screens/dev/settings/DevSettingsScreen.tsx (2)
app/src/screens/MainScreen.tsx (1)
text(460-462)app/src/screens/ProveScreen.tsx (1)
generatingProof(21-247)
app/src/navigation/system.tsx (2)
app/src/utils/colors.ts (1)
black(8-8)app/App.tsx (1)
App(15-46)
app/tests/src/navigation.test.ts (1)
app/src/navigation/index.tsx (1)
navigationScreens(30-40)
app/src/navigation/prove.ts (1)
app/src/screens/ProveScreen.tsx (8)
generatingProof(21-247)key(200-209)ProveScreenProps(17-19)result(83-108)resolve(48-50)setSelectedTab(94-96)key(174-182)newSocket(55-127)
app/src/navigation/dev.ts (1)
app/src/utils/colors.ts (2)
black(8-8)white(57-57)
🪛 GitHub Check: build-deps
app/src/navigation/lazyWithPreload.ts
[warning] 10-10:
Caution: React also has a named export lazy. Check if you meant to write import {lazy} from 'react' instead
[warning] 7-7:
Unexpected any. Specify a different type
app/src/navigation/home.ts
[warning] 14-14:
Replace ⏎··()·=>·import('@/screens/home/HomeScreen'),⏎ with ()·=>·import('@/screens/home/HomeScreen')
[warning] 11-11:
Replace ⏎··()·=>·import('@/screens/home/DisclaimerScreen'),⏎ with ()·=>·import('@/screens/home/DisclaimerScreen')
app/src/navigation/system.tsx
[warning] 18-18:
Replace ⏎··()·=>·import('@/screens/system/Loading'),⏎ with ()·=>·import('@/screens/system/Loading')
[warning] 15-15:
Replace ⏎··()·=>·import('@/screens/system/LaunchScreen'),⏎ with ()·=>·import('@/screens/system/LaunchScreen')
app/src/navigation/prove.ts
[warning] 16-16:
Replace ⏎··()·=>·import('@/screens/prove/ProveScreen'),⏎ with ()·=>·import('@/screens/prove/ProveScreen')
app/src/navigation/settings.ts
[warning] 19-19:
Replace ⏎··()·=>·import('@/screens/settings/SettingsScreen'),⏎ with ()·=>·import('@/screens/settings/SettingsScreen')
app/src/navigation/settings.web.ts
[warning] 16-16:
Replace ⏎··()·=>·import('@/screens/settings/SettingsScreen'),⏎ with ()·=>·import('@/screens/settings/SettingsScreen')
🪛 GitHub Actions: Mobile CI
app/src/navigation/aesop.ts
[error] 5-5: simple-import-sort/imports: Run autofix to sort these imports.
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: e2e-ios
- GitHub Check: analyze-android
- GitHub Check: analyze-ios
🔇 Additional comments (41)
app/src/utils/deeplinks.ts (1)
84-84: Route rename consistency verified
No staleProveScreenreferences remain; allnavigationRef.navigate('Prove')calls align with theProveroute declared in app/src/navigation/prove.ts.app/src/screens/prove/ProveScreen.tsx (1)
150-151: Route key rename verified; no leftoverProofRequestStatusScreenroute referencesRegistration in
app/src/navigation/prove.tsand allnavigate('ProofRequestStatus')calls are updated, and no calls to the old key remain.app/src/hooks/useModal.ts (1)
8-8: LGTM: import path realigned to system screensType-only import moved to system grouping; no behavior change. Modal navigation remains unaffected.
app/tests/utils/deeplinks.test.ts (1)
63-74: LGTM: tests aligned with route renameExpectations updated to 'Prove' match production changes in deeplinks handler.
app/src/utils/proving/provingMachine.ts (1)
291-295: Route confirmed — no action needed DocumentDataNotFound is declared in app/src/navigation/recovery.ts (and recovery.web.ts) and merged into AppNavigation, so it’s included in RootStackParamList.app/src/screens/document/DocumentCameraTroubleScreen.tsx (1)
50-51: Rename and target route look consistent.Component export and the haptic back target now align with the Document* flow. No functional concerns.
Also applies to: 79-79
app/src/screens/document/DocumentNFCScanScreen.web.tsx (1)
24-24: Rename-only change looks good.Web variant comp and export are aligned with the Document* naming. No behavioral changes introduced.
Also applies to: 77-77
app/src/screens/document/DocumentNFCTroubleScreen.tsx (1)
47-51: Approve navigation targets
Verified that DocumentNFCScan, DocumentNFCTrouble, and DocumentNFCMethodSelection routes exist in app/src/navigation/document.ts. Ready to ship.app/src/screens/document/DocumentCameraScreen.tsx (2)
36-36: Rename/export to Document looks correct.*No functional changes; navigation reads/analytics continue to work with the new component name.
Also applies to: 186-186
101-102: Confirmed route keys exist in navigator config (app/src/navigation/document.ts).app/src/screens/aesop/DocumentOnboardingScreen.tsx (2)
15-15: Analytics namespace drift: confirm event keys still valid.Screen/routes were renamed to Document*, but analytics still use PassportEvents.. If the pipeline has moved to Document events, these will silently drop. Please verify and migrate if needed.
Also applies to: 99-106
16-16: Copy and assets still say “passport” on a Document flow.*If this screen will handle non-passport IDs, update copy and visuals to “document” to avoid UX confusion and support future ID types.
Also applies to: 25-25, 85-96
app/src/screens/document/DocumentNFCScanScreen.tsx (2)
571-585: Analytics event keys: verify PassportEvents still correct post-rename.Events START_PASSPORT_NFC/CANCEL_PASSPORT_NFC remain under “Passport” while the flow/routes are “Document”. Confirm the analytics backend expects these keys; otherwise migrate now to avoid data gaps.
138-141: Telemetry origins still labeled “passport/nfc”.If analytics/helpdesk routing now uses “document/nfc”, update the origin strings to keep dashboards consistent.
Also applies to: 156-158
app/src/navigation/lazyWithPreload.ts (1)
7-15: LGTM: simple, useful preload hook over React.lazy.Implementation is sound and keeps factory as the preload. No side-effects introduced.
app/src/screens/document/UnsupportedDocumentScreen.tsx (2)
39-46: Route key rename verified: all occurrences updated to ‘UnsupportedDocument’ with no lingering ‘UnsupportedPassport’ references.
8-8: No missing dependency—react-native-svg-circle-country-flags is already declared in app/package.json (version ^0.2.2).Likely an incorrect or invalid review comment.
app/src/screens/settings/ManageDocumentsScreen.tsx (1)
282-283: DocumentOnboarding route is defined in RootStackParamList
navigation.navigate('DocumentOnboarding') is included in AppNavigation’s screens and type‐safe.app/src/screens/dev/settings/index.ts (1)
1-1: LGTM: barrel export enables stable import pathRe-export looks good and matches the project’s dev screen pattern.
app/src/screens/dev/private-key/index.ts (1)
1-1: LGTM: consistent barrel exportKeeps navigation/imports clean; no issues.
app/src/screens/settings/SettingsScreen.tsx (1)
71-71: Route “DocumentDataInfo” is correctly registered on native and web navigators
DocumentDataInfois defined and exported inDocumentDataInfoScreen.tsx, and wired up in bothapp/src/navigation/settings.ts(lines 16–18, 51–55) andapp/src/navigation/settings.web.ts(lines 13–15, 33–37), with the route also covered by navigation tests. No further action needed.app/src/screens/prove/ConfirmBelongingScreen.tsx (1)
38-40: Route keys verified – ‘Loading’ is declared in systemScreens and ‘ConfirmBelonging’ in proveScreens, so navigation and TS types are correct.app/src/screens/dev/create-mock/CreateMockScreen.tsx (3)
40-41: Ignore outdated provider naming suggestion
The repository exclusively definespassportDataProviderandstorePassportData; there is nodocumentDataProviderorstoreDocumentDatato import.Likely an incorrect or invalid review comment.
159-159: No leftover MockDataScreen references
Search forMockDataScreenreturned no hits; all exports and imports now point toCreateMockScreen. No further changes needed.
194-195: ConfirmBelonging route is defined and typed — TheConfirmBelongingkey exists in app/src/navigation/prove.ts’sproveScreensand is included in the static navigation param list, so thisnavigate('ConfirmBelonging', {})call is already correctly typed.app/src/screens/dev/feature-flags/index.ts (1)
1-1: Re-export looks goodIndex re-export aligns with folderized dev screens and simplifies imports.
app/src/screens/dev/haptic-feedback/index.ts (1)
1-1: Re-export looks goodMatches the DevHapticFeedbackScreen rename; no runtime impact.
app/src/screens/dev/create-mock/index.ts (1)
1-1: LGTM — re-export matches the new import path.app/src/screens/settings/DocumentDataInfoScreen.tsx (1)
84-87: Remove the non-existentDOCUMENT_INFO_OPENEDfallback. TheDocumentEventsenum only definesPASSPORT_INFO_OPENED. Either continue tracking withDocumentEvents.PASSPORT_INFO_OPENED, or first add a newDocumentEvents.DOCUMENT_INFO_OPENEDentry inpackages/mobile-sdk-alpha/src/constants/analytics.tsbefore referencing it.Likely an incorrect or invalid review comment.
app/src/screens/document/DocumentOnboardingScreen.tsx (1)
28-29: Route name ‘DocumentCamera’ correctly registered
No further action needed.app/src/screens/dev/haptic-feedback/DevHapticFeedbackScreen.tsx (1)
36-83: LGTM — rename is clean, behavior unchanged.app/src/navigation/settings.ts (2)
19-21: LGTM: refactor-only import formattingFunctional no-op; safe.
51-55: No stale PassportDataInfo references
Linking config, navigation tests, and bookmarks updated;DocumentDataInfoScreendefault-export confirmed.app/src/screens/dev/settings/DevSettingsScreen.tsx (1)
307-307: LGTM: route updated to DocumentOnboardingMatches the rename across navigation.
app/src/navigation/system.tsx (1)
12-26: LGTM: consistent lazy-loading and route key normalization
- Splash is eagerly loaded for startup; others are lazy, which is appropriate.
- Loading renamed and options look consistent with the initial route on mobile.
Also applies to: 28-42, 68-68
app/src/navigation/prove.ts (1)
26-51: Deep link mappings and persisted nav state verifiedRipgrep across
appshows no stale route keys in deeplink handlers, navigation calls, or tests—everything references the updatedConfirmBelonging,ProofRequestStatus, andProvekeys.app/src/navigation/settings.web.ts (1)
33-41: LGTM: route rename to DocumentDataInfo on webNaming aligns with the broader “Document” migration; options are sensible and non-breaking on web.
app/src/navigation/document.ts (2)
74-82: No changes needed: initialParams.passportData is correct
TheUnsupportedDocumentScreenroute prop is defined to acceptpassportData, so providinginitialParams: { passportData: null }is aligned with its expected props. Ignore the suggestion to rename todocumentData.Likely an incorrect or invalid review comment.
52-56: No naming drift detected – DocumentNFCScanScreen, its navigation params, and the user store consistently use passportNumber, dateOfBirth, and dateOfExpiry. Only rename to documentNumber if you’re ready to refactor the store, component props, and all navigation calls.Likely an incorrect or invalid review comment.
app/tests/src/navigation.test.ts (1)
56-70: Drop hook–at–module–load warning: no violations found
A repository-wide search in app/src/navigation revealed no imports or invocations of useAesopRedesign at module scope—navigationScreens is built without React hooks on import.Likely an incorrect or invalid review comment.
app/src/navigation/dev.ts (1)
10-20: LGTM on dev screen reorg and lazy-loadingThe module path normalization, central header options, and lazy-loaded dev screens align with the refactor objectives and should help keep prod bundle size in check while preserving dev tooling access.
Also applies to: 31-80
| const devHeaderOptions: NativeStackNavigationOptions = { | ||
| headerStyle: { | ||
| backgroundColor: black, | ||
| }, | ||
| headerTitleStyle: { | ||
| color: white, | ||
| }, | ||
| headerBackTitle: 'close', | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Back arrow and icon tint may be invisible on dark headers
You set a black header and white title but didn’t set headerTintColor, so back chevron and header buttons may be low-contrast depending on theme/platform. Set headerTintColor to white in the shared options.
const devHeaderOptions: NativeStackNavigationOptions = {
headerStyle: {
backgroundColor: black,
},
headerTitleStyle: {
color: white,
},
+ headerTintColor: white,
headerBackTitle: 'close',
};📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const devHeaderOptions: NativeStackNavigationOptions = { | |
| headerStyle: { | |
| backgroundColor: black, | |
| }, | |
| headerTitleStyle: { | |
| color: white, | |
| }, | |
| headerBackTitle: 'close', | |
| }; | |
| const devHeaderOptions: NativeStackNavigationOptions = { | |
| headerStyle: { | |
| backgroundColor: black, | |
| }, | |
| headerTitleStyle: { | |
| color: white, | |
| }, | |
| headerTintColor: white, | |
| headerBackTitle: 'close', | |
| }; |
🤖 Prompt for AI Agents
In app/src/navigation/dev.ts around lines 21 to 29, the shared devHeaderOptions
sets a black header and white title but omits headerTintColor so the back
chevron and header buttons can be low-contrast; update devHeaderOptions to
include headerTintColor: white so icons and back arrow are tinted white and
remain visible against the dark header.
| const DocumentDataNotFound = lazy( | ||
| () => import('@/screens/recovery/DocumentDataNotFoundScreen'), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Preload recovery fallback screen and verify route/key propagation
- Swap to lazyWithPreload so DEBUG_SCREEN or error paths can warm this screen.
- Check that linking and tests reference DocumentDataNotFound everywhere.
Apply within these hunks:
-const DocumentDataNotFound = lazy(
+const DocumentDataNotFound = lazyWithPreload(
() => import('@/screens/recovery/DocumentDataNotFoundScreen'),
);Add the helper import:
import { lazyWithPreload } from '@/utils/lazyWithPreload';Quick checks:
Also applies to: 49-57
🏁 Script executed:
#!/bin/bash
rg -nP "PassportDataNotFound\b|navigate\\(['\"]PassportDataNotFound['\"]|name:\\s*['\"]PassportDataNotFound['\"]" -SLength of output: 124
🏁 Script executed:
#!/bin/bash
rg -nP "DocumentDataNotFound\b|navigate\(['\"]DocumentDataNotFound['\"]\)|name:\s*['\"]DocumentDataNotFound['\"]" -SLength of output: 699
Preload recovery fallback screens
- Replace
lazywithlazyWithPreloadforDocumentDataNotFoundin both
•app/src/navigation/recovery.ts(lines 19, 49–57)
•app/src/navigation/recovery.web.ts(lines 8, 13–14) - Add
import { lazyWithPreload } from '@/utils/lazyWithPreload';to both files - No changes needed for tests (
app/tests/src/navigation.test.ts) orprovingMachine.ts, which already referenceDocumentDataNotFound
🤖 Prompt for AI Agents
In app/src/navigation/recovery.ts (around lines 19 and 49–57) and
app/src/navigation/recovery.web.ts (around lines 8 and 13–14), replace the use
of React.lazy for the DocumentDataNotFound screen with the project's
lazyWithPreload helper: add the import "import { lazyWithPreload } from
'@/utils/lazyWithPreload';" at the top of both files, change the
DocumentDataNotFound lazy initialization to use lazyWithPreload(...) instead of
lazy(...), and ensure exported references remain the same; do not modify tests
or provingMachine.ts.
| const DocumentDataNotFound = lazy( | ||
| () => import('@/screens/recovery/DocumentDataNotFoundScreen'), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Web parity: consider lazyWithPreload here too
Keep recovery.web.ts consistent with native for predictable chunking/preload behavior.
-const DocumentDataNotFound = lazy(
+const DocumentDataNotFound = lazyWithPreload(
() => import('@/screens/recovery/DocumentDataNotFoundScreen'),
);Add:
import { lazyWithPreload } from '@/utils/lazyWithPreload';Also applies to: 13-15
🤖 Prompt for AI Agents
In app/src/navigation/recovery.web.ts around lines 8-10 and 13-15, the file uses
React.lazy for screens but the native code uses lazyWithPreload; add the import
"import { lazyWithPreload } from '@/utils/lazyWithPreload';" near other imports
and replace React.lazy calls for the listed screens with lazyWithPreload so the
web build matches native chunking/preload behavior and supports preloading the
same way.
| const LaunchScreen: React.FC = () => { | ||
| useConnectionModal(); | ||
| const onStartPress = useHapticNavigation('PassportOnboarding'); | ||
| const onStartPress = useHapticNavigation('DocumentOnboarding'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify route key exists and is typed in RootStackParamList
Confirm that 'DocumentOnboarding' is registered in navigation and typed; ensure no stale 'PassportOnboarding' usages remain that could cause runtime navigation errors.
🏁 Script executed:
#!/bin/bash
# Check for remaining old route usages
rg -nP --glob 'app/**' '\bPassportOnboarding\b' -S
# Confirm new route key is registered in navigation stacks
rg -nP --glob 'app/src/navigation/**' '\bDocumentOnboarding\b' -S -C3
# Check call sites using useHapticNavigation with DocumentOnboarding
rg -nP --glob 'app/**' "useHapticNavigation\\(['\"]DocumentOnboarding['\"]\\)" -S -C2Length of output: 1444
🏁 Script executed:
#!/bin/bash
# Locate files defining RootStackParamList
files=$(rg -lP --glob 'app/**' 'type\s+RootStackParamList')
if [ -z "$files" ]; then
echo "RootStackParamList not found"
exit 0
fi
echo "Found RootStackParamList in: $files"
for file in $files; do
echo "Checking for DocumentOnboarding key in $file:"
rg -nP "DocumentOnboarding" "$file" -C2 || echo " ↳ DocumentOnboarding not present in this definition"
doneLength of output: 603
Add DocumentOnboarding to RootStackParamList
RootStackParamList (app/src/navigation/index.tsx) must include a DocumentOnboarding entry (e.g. 'DocumentOnboarding': undefined or the correct params) so the new route is fully typed and won’t cause runtime navigation errors.
🤖 Prompt for AI Agents
In app/src/screens/system/LaunchScreen.tsx around line 26, the screen registers
a navigation target 'DocumentOnboarding' via useHapticNavigation but the app's
navigation type (RootStackParamList in app/src/navigation/index.tsx) lacks a
corresponding entry, which can cause type errors or runtime navigation issues;
open app/src/navigation/index.tsx and add a DocumentOnboarding key to
RootStackParamList (e.g. 'DocumentOnboarding': undefined or the correct params
type), export/update any related types so the navigator and useNavigation hooks
are fully typed, and run TypeScript to confirm no remaining type errors.
| if (navigationRef.isReady()) { | ||
| const currentPassportData = get().passportData; | ||
| (navigationRef as any).navigate('UnsupportedPassport', { | ||
| (navigationRef as any).navigate('UnsupportedDocument', { | ||
| passportData: currentPassportData, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Avoid casting navigationRef to any; update route types instead.
The any-cast masks route/key mismatches. Add UnsupportedDocument to RootStackParamList and remove the cast.
- (navigationRef as any).navigate('UnsupportedDocument', {
+ navigationRef.navigate('UnsupportedDocument', {
passportData: currentPassportData,
});Verify the type includes both routes:
🏁 Script executed:
#!/bin/bash
rg -nP -C2 'type\s+RootStackParamList\b|createNavigationContainerRef<RootStackParamList>' app/src
rg -nP "UnsupportedDocument|DocumentDataNotFound" app/src/navigationLength of output: 1576
Remove any cast and use typed navigate
Route UnsupportedDocument is already included in RootStackParamList via AppNavigation, so drop the cast:
- (navigationRef as any).navigate('UnsupportedDocument', {
+ navigationRef.navigate('UnsupportedDocument', {
passportData: currentPassportData,
});📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (navigationRef.isReady()) { | |
| const currentPassportData = get().passportData; | |
| (navigationRef as any).navigate('UnsupportedPassport', { | |
| (navigationRef as any).navigate('UnsupportedDocument', { | |
| passportData: currentPassportData, | |
| }); | |
| } | |
| if (navigationRef.isReady()) { | |
| const currentPassportData = get().passportData; | |
| navigationRef.navigate('UnsupportedDocument', { | |
| passportData: currentPassportData, | |
| }); | |
| } |
🤖 Prompt for AI Agents
In app/src/utils/proving/provingMachine.ts around lines 279 to 284, the code
casts navigationRef to any before calling navigate; remove the any cast and call
navigate with proper typing from RootStackParamList. Replace the any cast by
typing navigationRef (or using navigate generic) as
NavigationContainerRef<RootStackParamList> / NavigationProp<RootStackParamList,
'UnsupportedDocument'> (import RootStackParamList and the appropriate types from
@react-navigation) and call navigate('UnsupportedDocument', { passportData:
currentPassportData }) with the typed ref so the route params are type-checked.
| 'ConfirmBelonging', | ||
| 'CreateMock', | ||
| 'DeferredLinkingInfo', | ||
| 'DevFeatureFlags', | ||
| 'DevHapticFeedback', | ||
| 'DevPrivateKey', | ||
| 'DevSettings', | ||
| 'Disclaimer', | ||
| 'DocumentCamera', | ||
| 'DocumentCameraTrouble', | ||
| 'DocumentDataInfo', | ||
| 'DocumentDataNotFound', | ||
| 'DocumentNFCMethodSelection', | ||
| 'DocumentNFCScan', | ||
| 'DocumentNFCTrouble', | ||
| 'DocumentOnboarding', | ||
| 'Home', | ||
| 'Launch', | ||
| 'LoadingScreen', | ||
| 'Loading', | ||
| 'ManageDocuments', | ||
| 'MockDataDeepLink', | ||
| 'Modal', | ||
| 'PassportCamera', | ||
| 'PassportCameraTrouble', | ||
| 'PassportDataInfo', | ||
| 'PassportDataNotFound', | ||
| 'PassportNFCMethodSelection', | ||
| 'PassportNFCScan', | ||
| 'PassportNFCTrouble', | ||
| 'PassportOnboarding', | ||
| 'ProofHistory', | ||
| 'ProofHistoryDetail', | ||
| 'ProofRequestStatusScreen', | ||
| 'ProveScreen', | ||
| 'ProofRequestStatus', | ||
| 'Prove', | ||
| 'QRCodeTrouble', | ||
| 'QRCodeViewFinder', | ||
| 'RecoverWithPhrase', | ||
| 'SaveRecoveryPhrase', | ||
| 'Settings', | ||
| 'ShowRecoveryPhrase', | ||
| 'Splash', | ||
| 'UnsupportedPassport', | ||
| 'UnsupportedDocument', | ||
| ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Avoid brittle full-list assertions for navigation keys
As routes evolve (and dev screens are intentionally shipped in prod), exact equality on the entire key set will cause frequent, non-functional test failures. Consider asserting a stable subset or verifying that your required keys are present while allowing extras.
Run this script to detect drift between routes used in code and this test’s expected list:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
expected_file="$(mktemp)"
used_file="$(mktemp)"
# Extract expected keys from this test
sed -n "/toEqual(\[/,/]);/p" app/tests/src/navigation.test.ts \
| sed -n -E "s/^\s*'([^']+)'.*$/\1/p" \
| sort -u > "$expected_file"
# Extract route names used in navigation calls across the app
rg -nP --type=ts --type=tsx "(?:navigate|push|replace)\(['\"]([A-Za-z0-9]+)['\"]" app/src \
| sed -n -E "s/.*\(['\"]([A-Za-z0-9]+)['\"].*/\1/p" \
| sort -u > "$used_file"
echo "Missing in test (present in code):"
comm -13 "$expected_file" "$used_file" || true
echo
echo "Stale in test (not used in code):"
comm -23 "$expected_file" "$used_file" || trueLength of output: 418
🏁 Script executed:
#!/bin/bash
set -euo pipefail
expected_file="$(mktemp)"
used_file="$(mktemp)"
# Extract expected keys from this test
sed -n -n "/toEqual(\[/,/]);/p" app/tests/src/navigation.test.ts \
| sed -n -E "s/^\s*'([^']+)'.*$/\1/p" \
| sort -u > "$expected_file"
# Extract route names used in navigation calls across the app (including .ts and .tsx)
rg -nP -g '*.ts' -g '*.tsx' "(?:navigate|push|replace)\(['\"][A-Za-z0-9]+['\"]" app/src \
| sed -n -E "s/.*\(['\"]([A-Za-z0-9]+)['\"].*/\1/p" \
| sort -u > "$used_file"
echo "Missing in test (present in code):"
comm -13 "$expected_file" "$used_file" || true
echo
echo "Stale in test (not used in code):"
comm -23 "$expected_file" "$used_file" || trueLength of output: 896
Avoid brittle full-list assertions for navigation keys
Test currently asserts an exact list of routes but analysis found 14 stale entries not referenced in code: AccountRecovery, DevFeatureFlags, DevHapticFeedback, DevSettings, Disclaimer, DocumentCamera, DocumentDataInfo, DocumentNFCMethodSelection, DocumentNFCTrouble, Loading, QRCodeViewFinder, RecoverWithPhrase, SaveRecoveryPhrase, ShowRecoveryPhrase, Splash. Switch to verifying a stable subset instead of full equality, for example:
expect(Object.keys(routes)).toEqual(
expect.arrayContaining([
'Home',
'ManageDocuments',
'ProofHistory',
// ...other critical screens
])
);🤖 Prompt for AI Agents
In app/tests/src/navigation.test.ts around lines 14 to 48, the test asserts an
exact full list of navigation route keys which is brittle and includes stale
entries; replace the equality assertion with a subset check that verifies only a
stable set of critical routes exist (use an assertion that Object.keys(routes)
contains an array of required keys such as 'Home', 'ManageDocuments',
'ProofHistory', etc.), removing the expectation of exact order/length so tests
no longer break when non-critical routes change.
| 'screens-document-core': ['./src/navigation/document.ts'], | ||
| 'screens-passport-nfc': ['./src/utils/nfcScanner.ts'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Use absolute resolved paths in manualChunks to guarantee chunk assignment
Relative strings can miss due to alias/absolute-id resolution, silently disabling intended splits. Resolve to absolute IDs to make Rollup matching deterministic.
- 'screens-document-core': ['./src/navigation/document.ts'],
+ 'screens-document-core': [resolve(__dirname, 'src/navigation/document.ts')],
...
- 'screens-dev': ['./src/navigation/dev.ts'],
+ 'screens-dev': [resolve(__dirname, 'src/navigation/dev.ts')],Also applies to: 177-177
🏁 Script executed:
#!/bin/bash
# Confirm targets exist and catch typos early.
fd -a document.ts src/navigation
fd -a dev.ts src/navigation
# Optional: after a local build, verify chunk names were emitted.
# ls web/dist/assets | rg 'screens-(document-core|dev)\.' -nLength of output: 268
🏁 Script executed:
#!/bin/bash
# Locate manualChunks targets in the repo
fd -a document.ts .
fd -a dev.ts .Length of output: 266
Use absolute resolve(__dirname, …) paths for manualChunks entries
In app/vite.config.ts (lines 151–152 and 177), replace the relative strings (e.g. ['./src/navigation/document.ts'] and ['./src/navigation/dev.ts']) with resolve(__dirname, 'src/navigation/document.ts') and resolve(__dirname, 'src/navigation/dev.ts') so Rollup matches modules deterministically.
🤖 Prompt for AI Agents
In app/vite.config.ts around lines 151–152 and 177, the manualChunks entries use
relative strings which can prevent Rollup from deterministically matching
modules; replace those array entries like ['./src/navigation/document.ts'] and
['./src/navigation/dev.ts'] with absolute paths using resolve(__dirname,
'src/navigation/document.ts') and resolve(__dirname, 'src/navigation/dev.ts').
Also ensure resolve is imported (e.g., import { resolve } from 'path') at the
top of the file so the manualChunks entries use the resolved absolute paths.
README.md
Outdated
| ### Debugging screens | ||
|
|
||
| Set `DEBUG_SCREEN` to preload and open a specific screen on startup: | ||
|
|
||
| ```bash | ||
| DEBUG_SCREEN=PassportOnboarding yarn start | ||
| ``` | ||
|
|
||
| This bypasses lazy loading for the chosen screen, making it easier to debug in isolation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Fix outdated DEBUG_SCREEN example (route was renamed).
Example still points to PassportOnboarding; navigation now uses Document* naming. Update the example to the current route key to avoid confusion.
Proposed change:
-DEBUG_SCREEN=PassportOnboarding yarn start
+DEBUG_SCREEN=DocumentOnboarding yarn startRun to confirm the actual route key:
🏁 Script executed:
#!/bin/bash
# Find candidate route names
rg -nP --type=ts --type=tsx -C2 '\b(DocumentOnboarding|PassportOnboarding)\b|DEBUG_SCREEN'Length of output: 120
Here’s a refined set of searches to pinpoint the current debug‐screen key and route definitions:
🏁 Script executed:
#!/bin/bash
# 1. Locate all DEBUG_SCREEN usages (in MD or TS/TSX)
rg -n 'DEBUG_SCREEN' -g '*.md' -g '*.ts' -g '*.tsx' -C2
# 2. Find the navigation parameter list that defines available routes
rg -n 'RootStackParamList' -g '*.ts' -g '*.tsx' -C3
# 3. Search for any Onboarding routes (Passport vs. Document)
rg -n 'Onboarding' -g '*.ts' -g '*.tsx' -C2Length of output: 21535
Update README debug example to use DocumentOnboarding route
In README.md (around line 80), replace
-DEBUG_SCREEN=PassportOnboarding yarn start
+DEBUG_SCREEN=DocumentOnboarding yarn startto reflect the current navigation key.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ### Debugging screens | |
| Set `DEBUG_SCREEN` to preload and open a specific screen on startup: | |
| ```bash | |
| DEBUG_SCREEN=PassportOnboarding yarn start | |
| ``` | |
| This bypasses lazy loading for the chosen screen, making it easier to debug in isolation. | |
| ### Debugging screens | |
| Set `DEBUG_SCREEN` to preload and open a specific screen on startup: | |
🤖 Prompt for AI Agents
In README.md around lines 75 to 83, the DEBUG_SCREEN example uses the outdated
route name "PassportOnboarding"; update the example to use the current
navigation key "DocumentOnboarding" instead so the command reads
DEBUG_SCREEN=DocumentOnboarding yarn start and matches the app's current routes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (11)
app/src/navigation/aesop.ts(1 hunks)app/src/navigation/index.tsx(1 hunks)app/src/navigation/prove.ts(1 hunks)app/src/navigation/settings.ts(2 hunks)app/src/navigation/settings.web.ts(2 hunks)app/src/navigation/system.tsx(2 hunks)app/src/screens/dev/create-mock/index.ts(1 hunks)app/src/screens/dev/feature-flags/index.ts(1 hunks)app/src/screens/dev/haptic-feedback/index.ts(1 hunks)app/src/screens/dev/private-key/index.ts(1 hunks)app/src/screens/dev/settings/index.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
- app/src/screens/dev/private-key/index.ts
- app/src/screens/dev/settings/index.ts
- app/src/navigation/aesop.ts
- app/src/screens/dev/create-mock/index.ts
- app/src/navigation/index.tsx
- app/src/navigation/system.tsx
- app/src/screens/dev/feature-flags/index.ts
- app/src/navigation/settings.web.ts
- app/src/navigation/settings.ts
- app/src/navigation/prove.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/technical-specification.mdc)
**/*.{ts,tsx}: Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Files:
app/src/screens/dev/haptic-feedback/index.ts
app/src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:
- Component architecture and reusability
- State management patterns
- Performance optimizations
- TypeScript type safety
- React hooks usage and dependencies
- Navigation patterns
Files:
app/src/screens/dev/haptic-feedback/index.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Organize screens by feature modules (passport, home, settings, etc.)
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Applied to files:
app/src/screens/dev/haptic-feedback/index.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Integrate haptic feedback via useHapticNavigation
Applied to files:
app/src/screens/dev/haptic-feedback/index.ts
🪛 GitHub Actions: Mobile CI
app/src/screens/dev/haptic-feedback/index.ts
[error] 1-1: License header missing or incorrect according to repository header policy.
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: e2e-ios
- GitHub Check: analyze-android
| @@ -0,0 +1 @@ | |||
| export { default } from '@/screens/dev/haptic-feedback/DevHapticFeedbackScreen'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Blocker: Add repository-standard license header to satisfy CI.
Mobile CI is failing with “License header missing or incorrect.” Add the canonical header used across the repo to this file before any exports.
Run this to locate the header template/source and confirm what to paste:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Search for canonical license header or template:"
fd -H -a -t f -E node_modules -E .git '(HEADER*|LICENSE*|license*header*|.licenserc*)' || true
echo
echo "Sample the first 6 lines of a few TS/TSX files that already pass the header check:"
fd -t f -E node_modules -E .git --extension ts --extension tsx | head -n 10 | xargs -I {} sh -c 'echo "--- {} ---"; head -n 6 "{}"; echo'Length of output: 3686
Add missing SPDX license header
Insert the standard three-line header at the top of app/src/screens/dev/haptic-feedback/index.ts to satisfy CI:
// SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc.
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.
export { default } from '@/screens/dev/haptic-feedback/DevHapticFeedbackScreen';🧰 Tools
🪛 GitHub Actions: Mobile CI
[error] 1-1: License header missing or incorrect according to repository header policy.
🤖 Prompt for AI Agents
In app/src/screens/dev/haptic-feedback/index.ts at lines 1 to 1, the file is
missing the required three-line SPDX license header; add the exact three comment
lines shown in the review (SPDX-FileCopyrightText, SPDX-License-Identifier, and
the NOTE about conversion date) as the very first lines of the file above the
existing export line so CI recognizes the license header.
💡 Verification agent
🧩 Analysis chain
Verify path alias resolution for “@/screens/…” across toolchain.
The re-export is fine, but unresolved-module errors in the PR could stem from missing/incorrect alias config. Ensure @ maps to app/src (or the intended root) in TS, Babel, ESLint, Jest, and Metro to avoid lint/type failures.
Use this quick audit:
If any are missing:
- TS: tsconfig.base.json → "baseUrl": ".", "paths": { "@/": ["app/src/"] }
- Babel: module-resolver alias { "@": "./app/src" }
- Jest: moduleNameMapper { "^@/(.*)$": "/app/src/$1" }
- ESLint: settings.import/resolver typescript (or alias) aligned with TS paths
- Metro: keep consistent resolution (or rely on Babel-only alias)
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "TSConfig baseUrl/paths:"
rg -nP --glob 'tsconfig*.json' '"baseUrl"|"paths"' -C2 || true
echo
echo "Babel module-resolver alias:"
fd -H -a -t f -E node_modules -E .git 'babel.config.*' | xargs -I {} sh -c 'echo "--- {} ---"; cat "{}"' | rg -n 'module-resolver|alias|@"' -C2 || true
echo
echo "Metro alias/custom resolver:"
fd -H -a -t f -E node_modules -E .git 'metro.config.*' | xargs -I {} sh -c 'echo "--- {} ---"; cat "{}"' | rg -n '@"|alias|resolver' -C2 || true
echo
echo "Jest moduleNameMapper:"
fd -H -a -t f -E node_modules -E .git 'jest.config.*' | xargs -I {} sh -c 'echo "--- {} ---"; cat "{}"' | rg -n 'moduleNameMapper|@/' -C2 || true
echo
echo "ESLint import/resolver (typescript or alias):"
fd -H -a -t f -E node_modules -E .git '.eslintrc*' | xargs -I {} sh -c 'echo "--- {} ---"; cat "{}"' | rg -n 'import/resolver|typescript|alias|@"' -C2 || trueLength of output: 9450
Add “@/*” path mapping to app/tsconfig.json (and tsconfig.test.json) so TS and ESLint (via the typescript resolver) can resolve @/… imports. Babel’s module-resolver and Jest’s moduleNameMapper already cover “@”, and Metro uses the Babel plugin.
🧰 Tools
🪛 GitHub Actions: Mobile CI
[error] 1-1: License header missing or incorrect according to repository header policy.
🤖 Prompt for AI Agents
In app/src/screens/dev/haptic-feedback/index.ts around line 1, TypeScript/ESLint
can't resolve imports using "@/…" because app/tsconfig.json (and
tsconfig.test.json) lack a "@/*" path mapping; update app/tsconfig.json to set
"baseUrl": "." and add a "paths" entry mapping "@/*" to ["app/*"], and ensure
app/tsconfig.test.json either extends that tsconfig or contains the same "paths"
mapping so the typescript resolver used by ESLint and tests can resolve "@/…"
imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
scripts/check-license-headers.mjs (2)
166-175: Preserve original line endings when writing fixesJoining with "\n" will convert CRLF files to LF and produce noisy diffs. Use a per-file EOL.
Apply:
@@ - const fixedContent = lines.join('\n'); + const fixedContent = lines.join(EOL);Add EOL detection near the start of fixLicenseHeader:
@@ function fixLicenseHeader(filePath) { const content = readFileSync(filePath, 'utf8'); + const EOL = content.includes('\r\n') ? '\r\n' : '\n'; const lines = content.split('\n'); const headerInfo = findLicenseHeaderIndex(lines);
67-95: Handle UTF-8 BOM to avoid duplicate headersFiles with a BOM on the first logical line will be misdetected as “missing header,” leading to duplicated headers on fix. Strip BOM before comparison.
Apply:
@@ -function findLicenseHeaderIndex(lines) { +function findLicenseHeaderIndex(lines) { let i = 0; // Skip shebang if present if (lines[i]?.startsWith('#!')) i++; // Skip leading blank lines while (i < lines.length && lines[i].trim() === '') i++; - const currentLine = lines[i]; + const currentLine = lines[i]?.replace(/^\uFEFF/, ''); // strip BOM if present @@ - if (currentLine === CANONICAL_HEADER_LINES[0]) { + if (currentLine === CANONICAL_HEADER_LINES[0]) { const hasAllLines = - lines[i + 1] === CANONICAL_HEADER_LINES[1] && - lines[i + 2] === CANONICAL_HEADER_LINES[2]; + lines[i + 1] === CANONICAL_HEADER_LINES[1] && + lines[i + 2] === CANONICAL_HEADER_LINES[2];
🧹 Nitpick comments (3)
app/src/navigation/lazyWithPreload.ts (1)
11-19: Tighten generics (dropany), annotate return type, and memoizepreload
- Replace
anywithunknownfor type-safety (addresses the static analysis warning).- Add an explicit return type to keep inference stable at call sites.
- Memoize
preloadto avoid redundant dynamic imports if called multiple times.Apply within the selected range:
-export function lazyWithPreload<T extends React.ComponentType<any>>( - factory: () => Promise<{ default: T }>, -) { - const Component = React.lazy(factory) as React.LazyExoticComponent<T> & { - preload: () => Promise<{ default: T }>; - }; - Component.preload = factory; - return Component; -} +export function lazyWithPreload<T extends React.ComponentType<unknown>>( + factory: () => Promise<{ default: T }>, +): Preloadable<T> { + const Component = React.lazy(factory) as Preloadable<T>; + let preloadPromise: ReturnType<typeof factory> | null = null; + Component.preload = () => { + if (!preloadPromise) preloadPromise = factory(); + return preloadPromise; + }; + return Component; +}Add this type alias once (outside the selected range), ideally near the imports:
type Preloadable<T extends React.ComponentType<unknown>> = React.LazyExoticComponent<T> & { preload: () => Promise<{ default: T }> };app/src/screens/dev/settings/index.ts (1)
5-5: Prefer relative re-export to avoid alias resolution breakageGiven the PR’s reported unresolved-module and lint failures, relying on the
@alias here is fragile across Metro, TypeScript, Jest, and ESLint. A relative path makes this barrel resilient to tooling drift and case-sensitive CI environments.Apply:
-export { default } from '@/screens/dev/settings/DevSettingsScreen'; +export { default } from './DevSettingsScreen';scripts/check-license-headers.mjs (1)
97-104: Make required-path check OS-agnosticstartsWith('app/') fails on Windows paths (backslashes). Normalize to POSIX or replace backslashes.
Example:
function shouldRequireHeader(filePath, projectRoot) { - const relativePath = path.relative(projectRoot, filePath); + const relativePath = path.relative(projectRoot, filePath).replace(/\\/g, '/'); // Only require headers in app/ and packages/mobile-sdk-alpha/ directories return ( relativePath.startsWith('app/') || relativePath.startsWith('packages/mobile-sdk-alpha/') ); }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
app/src/navigation/lazyWithPreload.ts(1 hunks)app/src/screens/dev/create-mock/index.ts(1 hunks)app/src/screens/dev/feature-flags/index.ts(1 hunks)app/src/screens/dev/haptic-feedback/index.ts(1 hunks)app/src/screens/dev/private-key/index.ts(1 hunks)app/src/screens/dev/settings/index.ts(1 hunks)scripts/check-license-headers.mjs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- app/src/screens/dev/feature-flags/index.ts
- app/src/screens/dev/private-key/index.ts
- app/src/screens/dev/haptic-feedback/index.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/technical-specification.mdc)
**/*.{ts,tsx}: Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Files:
app/src/screens/dev/create-mock/index.tsapp/src/screens/dev/settings/index.tsapp/src/navigation/lazyWithPreload.ts
app/src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:
- Component architecture and reusability
- State management patterns
- Performance optimizations
- TypeScript type safety
- React hooks usage and dependencies
- Navigation patterns
Files:
app/src/screens/dev/create-mock/index.tsapp/src/screens/dev/settings/index.tsapp/src/navigation/lazyWithPreload.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Organize screens by feature modules (passport, home, settings, etc.)
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Applied to files:
app/src/screens/dev/create-mock/index.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks
Applied to files:
app/src/screens/dev/create-mock/index.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/**/screens/**/*.{ts,tsx} : Lazy load screens using React.lazy()
Applied to files:
app/src/navigation/lazyWithPreload.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/**/screens/**/*.{ts,tsx} : Lazy load screens and components to improve performance
Applied to files:
app/src/navigation/lazyWithPreload.ts
🧬 Code graph analysis (1)
scripts/check-license-headers.mjs (1)
scripts/migrate-license-headers.mjs (1)
CANONICAL_HEADER_LINES(19-23)
🪛 GitHub Check: build-deps
app/src/navigation/lazyWithPreload.ts
[warning] 14-14:
Caution: React also has a named export lazy. Check if you meant to write import {lazy} from 'react' instead
[warning] 11-11:
Unexpected any. Specify a different type
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-android
- GitHub Check: build-ios
- GitHub Check: test
- GitHub Check: e2e-ios
- GitHub Check: analyze-android
🔇 Additional comments (5)
app/src/navigation/lazyWithPreload.ts (2)
7-10: Clean, purposeful helper—fits RN lazy-loading needsThe wrapper is minimal and aligns with our “lazy load screens” guideline. No functional issues spotted here.
17-17: Verify preload call sites handle errors
I didn’t find any.preload()invocations via grep; please confirm any usage ofComponent.preload()is awaited or chained with.catch()to prevent unhandled promise rejections.app/src/screens/dev/create-mock/index.ts (2)
1-3: Verify SPDX header and conversion note match repo policy.Confirm the copyright holder name and the BUSL→Apache-2.0 conversion date align with the root LICENSE and legal guidance; mismatches can create compliance risk.
5-5: No navigation import cycle detected:app/src/screens/dev/create-mock/CreateMockScreen.tsxdoes not import from@/navigation/dev, so exporting it via the index barrel poses no cycle.app/src/screens/dev/settings/index.ts (1)
1-3: SPDX header looks correctLicense identifiers and copyright header are consistent and machine-readable.
| // SPDX-License-Identifier: BUSL-1.1 | ||
| // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. | ||
|
|
||
| export { default } from '@/screens/dev/create-mock/CreateMockScreen'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Replace alias import with a relative path to unblock unresolved-module failures.
PR notes mention unresolved imports during lint/tests. Using the @/ alias here depends on consistent config across TS, Metro, Babel, and Jest. Switching this re-export to a relative path avoids those toolchain mismatches and stabilizes CI immediately.
-export { default } from '@/screens/dev/create-mock/CreateMockScreen';
+export { default } from './CreateMockScreen';Run this script to verify alias wiring and the target file’s presence:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "› Check target component exists"
fd -t f 'CreateMockScreen.tsx' app/src/screens/dev/create-mock || {
echo "Missing: app/src/screens/dev/create-mock/CreateMockScreen.tsx"; exit 1; }
echo "› Check TS path mapping for @/*"
for f in app/tsconfig.json tsconfig.json; do
[ -f "$f" ] && { echo "File: $f"; cat "$f" | jq '.compilerOptions.paths' || true; }
done | sed 's/^/ /'
echo "› Check Jest moduleNameMapper for @/"
fd -t f 'jest*.{js,ts,cjs,mjs,json}' -x rg -nP --color=never "moduleNameMapper.*@/(\\(.*\\)|\\(\\.\\*\\))" {} -C1 || true
echo "› Check Babel/Metro alias for @"
fd -t f '{babel,metro}.config.*' -x rg -nP --color=never "(module-resolver|alias|extraNodeModules).*['\"]@['\"]" {} -C2 || true
echo "Done."Length of output: 1080
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "› Display moduleNameMapper in app/jest.config.cjs"
if [ -f app/jest.config.cjs ]; then
sed -n '1,200p' app/jest.config.cjs
else
echo "app/jest.config.cjs not found"
fi
echo "› Display alias in babel.config.js (root)"
if [ -f babel.config.js ]; then
sed -n '1,200p' babel.config.js
else
echo "babel.config.js not found"
fi
echo "› Display alias in app/babel.config.js"
if [ -f app/babel.config.js ]; then
sed -n '1,200p' app/babel.config.js
else
echo "app/babel.config.js not found"
fi
echo "› Display alias in metro.config.js (root)"
if [ -f metro.config.js ]; then
sed -n '1,200p' metro.config.js
else
echo "metro.config.js not found"
fi
echo "› Display alias in app/metro.config.js"
if [ -f app/metro.config.js ]; then
sed -n '1,200p' app/metro.config.js
else
echo "app/metro.config.js not found"
fi
echo "Done."Length of output: 2331
Replace alias import with a relative path in app/src/screens/dev/create-mock/index.ts
Metro bundler has no @/ alias configured, so
export { default } from '@/screens/dev/create-mock/CreateMockScreen';
will fail at bundle time. Change it to:
-export { default } from '@/screens/dev/create-mock/CreateMockScreen';
+export { default } from './CreateMockScreen';📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export { default } from '@/screens/dev/create-mock/CreateMockScreen'; | |
| // app/src/screens/dev/create-mock/index.ts | |
| export { default } from './CreateMockScreen'; |
🤖 Prompt for AI Agents
In app/src/screens/dev/create-mock/index.ts around line 5, the file currently
re-exports using the '@/...' alias which Metro doesn't resolve; replace the
alias import with a relative path (e.g. export the default from
'./CreateMockScreen') so the module resolves at bundle time.
| // SPDX-License-Identifier: BUSL-1.1 | ||
| // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. | ||
|
|
||
| export { default } from '@/screens/dev/settings/DevSettingsScreen'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify alias configuration across all toolchains
If you keep @/…, ensure consistent alias mapping or you’ll keep seeing “module not found” errors:
- TypeScript: tsconfig paths "@" → app/src
- Babel (Metro): module-resolver alias "@" → ./app/src
- Jest: moduleNameMapper '^@/(.*)$' → '/app/src/$1'
Run to confirm:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Checking tsconfig paths..."
fd -a 'tsconfig*.json' | xargs -I{} sh -c 'echo {}; cat {}' | rg -n '"paths"\s*:\s*{[^}]*"@/\*\":\s*\["app/src/\*"\]'
echo "Checking Babel/Metro module-resolver..."
fd -a 'babel.config.*' 'metro.config.*' | xargs -I{} sh -c 'echo {}; cat {}' | rg -n "module-resolver|alias|['\"]@['\"]\s*:\s*['\"]\.?/app/src['\"]"
echo "Checking Jest moduleNameMapper..."
fd -a 'jest.config.*' | xargs -I{} sh -c 'echo {}; cat {}' | rg -n "moduleNameMapper|\\^@/\\(\\.\\*\\)\\$:.*<rootDir>/app/src/\\$1"
echo "Checking case-sensitive target file exists..."
fd -a 'DevSettingsScreen.*' app/src | rg -n 'DevSettingsScreen\.(tsx|ts|js|jsx)$'Length of output: 384
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "TSConfig alias mapping (@/* → app/src/*):"
(grep -R -n '"@/\\*":' --include 'tsconfig*.json' . | grep -n "app/src") || echo "No TSConfig alias mapping for '@/*' → app/src/*"
echo
echo "Babel/Metro alias mapping (@ → ./app/src):"
(grep -R -n "module-resolver" --include 'babel.config.*' --include 'metro.config.*' .) || echo "No module-resolver section found"
(grep -R -n '"@"' --include 'babel.config.*' --include 'metro.config.*' . | grep -n "app/src") || echo "No Babel/Metro alias mapping for '@' → app/src"
echo
echo "Jest alias mapping (@/ → <rootDir>/app/src):"
grep -R -n "moduleNameMapper" --include 'jest.config.*' . || echo "No moduleNameMapper in Jest config"
(grep -R -n "@/" --include 'jest.config.*' . | grep -n "app/src") || echo "No Jest alias mapping for '@/' → app/src"
echo
echo "DevSettingsScreen file existence (case-sensitive):"
find app/src -type f \( -iname 'DevSettingsScreen.tsx' -o -iname 'DevSettingsScreen.ts' -o -iname 'DevSettingsScreen.js' -o -iname 'DevSettingsScreen.jsx' \) -print || echo "No DevSettingsScreen file found"Length of output: 1436
Add missing “@/…” alias mappings
- tsconfig.json (root or app/tsconfig.json): under
compilerOptions.paths, add"@/*": ["app/src/*"]
- babel.config.cjs / metro.config.*: in the
module-resolverplugin’salias, add'@': './app/src'
- jest.config.cjs: in
moduleNameMapper, add'^@/(.*)$': '<rootDir>/app/src/$1'
(app/src/screens/dev/settings/DevSettingsScreen.tsx already exists)
🤖 Prompt for AI Agents
In app/src/screens/dev/settings/index.ts at line 5 the file re-exports using the
'@/...' alias but project configs lack mappings for that alias; add a path
mapping under compilerOptions.paths in the root (or app/) tsconfig.json to map
"@/*" to "app/src/*", add an alias entry for '@' -> './app/src' in the
module-resolver plugin used by babel.config.cjs (and mirror in metro config if
present), and add a Jest moduleNameMapper entry mapping '^@/(.*)$' to
'<rootDir>/app/src/$1' so TypeScript, bundler and tests resolve the '@/...'
imports correctly.
| if (headerInfo.index === -1) { | ||
| // No header exists - add the canonical header | ||
| const newLines = [ | ||
| ...CANONICAL_HEADER_LINES, | ||
| '', // Add newline after header | ||
| ...lines, | ||
| ]; | ||
| const fixedContent = newLines.join('\n'); | ||
| writeFileSync(filePath, fixedContent, 'utf8'); | ||
| return true; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Preserve shebang when inserting headers to avoid breaking executable scripts
When a file has a shebang, the current fix path inserts the header before it, breaking execution. Insert after the shebang and preserve the file’s EOLs.
Apply:
@@
- if (headerInfo.index === -1) {
- // No header exists - add the canonical header
- const newLines = [
- ...CANONICAL_HEADER_LINES,
- '', // Add newline after header
- ...lines,
- ];
- const fixedContent = newLines.join('\n');
- writeFileSync(filePath, fixedContent, 'utf8');
- return true;
- }
+ if (headerInfo.index === -1) {
+ // No header exists — add the canonical header (preserve shebang and line endings)
+ const hasShebang = lines[0]?.startsWith('#!');
+ const head = hasShebang ? [lines[0]] : [];
+ const body = hasShebang ? lines.slice(1) : lines;
+ const newLines = [
+ ...head,
+ ...CANONICAL_HEADER_LINES,
+ ...(body[0] === '' ? [] : ['']), // ensure exactly one blank line after header
+ ...body,
+ ];
+ const fixedContent = newLines.join(EOL);
+ writeFileSync(filePath, fixedContent, 'utf8');
+ return true;
+ }Also define EOL once at the top of fixLicenseHeader (see separate comment).
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In scripts/check-license-headers.mjs around lines 154 to 165, the current header
insertion places the canonical header before a shebang and uses ad-hoc EOLs;
change the fix path to detect a leading shebang (line[0] starts with "#!") and,
if present, insert the canonical header after that shebang line (not before),
preserving the original file's EOL style when joining lines; also compute and
store the file's EOL once at the top of fixLicenseHeader and use that EOL when
joining newLines so the file’s line endings are preserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
app/src/screens/dev/CreateMockScreen.tsx (1)
327-343: Bug: Age “−” button disables on expiryYears, not age; clamp to 0The minus control in the Age section checks expiryYears and can drive age negative.
- <Button + <Button height="$3.5" width="$6" backgroundColor="white" justifyContent="center" borderColor={slate200} borderWidth={1} onPress={() => { buttonTap(); - setAge(age - 1); + setAge(Math.max(0, age - 1)); trackEvent(MockDataEvents.DECREASE_AGE); }} - disabled={expiryYears <= 0} + disabled={age <= 0} >app/tests/src/navigation.test.ts (1)
56-71: Make Aesop override tests deterministic by mocking the hook per testWithout explicit mocks, results depend on the default implementation.
describe('Aesop design screen overrides', () => { beforeEach(() => { - jest.resetModules(); + jest.resetModules(); }); it('should use regular passport screens when shouldShowAesopRedesign is false', () => { - const navigationScreens = require('@/navigation').navigationScreens; + jest.doMock('@/hooks/useAesopRedesign', () => ({ + shouldShowAesopRedesign: jest.fn().mockReturnValue(false), + })); + const navigationScreens = require('@/navigation').navigationScreens; expect( navigationScreens.DocumentOnboarding.options.title, ).toBeUndefined(); }); it('should use aesop design passport screens when shouldShowAesopRedesign is true', () => { - jest.mock('@/hooks/useAesopRedesign', () => ({ + jest.doMock('@/hooks/useAesopRedesign', () => ({ shouldShowAesopRedesign: jest.fn().mockReturnValue(true), })); const navigationScreens = require('@/navigation').navigationScreens; expect(navigationScreens.DocumentOnboarding.options.title).toBeDefined(); }); });app/src/navigation/dev.ts (1)
65-72: Set headerTintColor on white header to ensure icon contrastOn a white header, explicitly tint icons black to avoid theme-dependent colors.
DevFeatureFlags: { screen: DevFeatureFlagsScreen, options: { title: 'Feature Flags', headerStyle: { backgroundColor: white, }, + headerTintColor: black, } as NativeStackNavigationOptions, },
♻️ Duplicate comments (2)
app/tests/src/navigation.test.ts (1)
9-48: Avoid brittle full-list equality; assert a stable subset of critical routesThe exact-equality assertion causes frequent failures as routes evolve. Assert presence of a stable subset instead.
- const listOfScreens = Object.keys(navigationScreens).sort(); - expect(listOfScreens).toEqual([ - 'AccountRecovery', - 'AccountRecoveryChoice', - 'AccountVerifiedSuccess', - 'CloudBackupSettings', - 'ConfirmBelonging', - 'CreateMock', - 'DeferredLinkingInfo', - 'DevFeatureFlags', - 'DevHapticFeedback', - 'DevSettings', - 'Disclaimer', - 'DocumentCamera', - 'DocumentCameraTrouble', - 'DocumentDataInfo', - 'DocumentDataNotFound', - 'DocumentNFCMethodSelection', - 'DocumentNFCScan', - 'DocumentNFCTrouble', - 'DocumentOnboarding', - 'Home', - 'Launch', - 'Loading', - 'ManageDocuments', - 'MockDataDeepLink', - 'Modal', - 'ProofHistory', - 'ProofHistoryDetail', - 'ProofRequestStatus', - 'Prove', - 'QRCodeTrouble', - 'QRCodeViewFinder', - 'RecoverWithPhrase', - 'SaveRecoveryPhrase', - 'Settings', - 'ShowRecoveryPhrase', - 'Splash', - 'UnsupportedDocument', - ]); + const listOfScreens = Object.keys(navigationScreens); + expect(listOfScreens).toEqual( + expect.arrayContaining([ + 'Home', + 'ManageDocuments', + 'CreateMock', + 'DocumentOnboarding', + 'DocumentCamera', + 'DocumentNFCScan', + 'ConfirmBelonging', + 'Prove', + 'ProofRequestStatus', + 'UnsupportedDocument', + ]), + );app/src/navigation/dev.ts (1)
22-30: Set headerTintColor for dark headers to avoid invisible iconsBack chevron and header buttons can be low-contrast on the black header. Add headerTintColor: white in the shared options.
const devHeaderOptions: NativeStackNavigationOptions = { headerStyle: { backgroundColor: black, }, headerTitleStyle: { color: white, }, + headerTintColor: white, headerBackTitle: 'close', };
🧹 Nitpick comments (2)
app/src/navigation/dev.ts (2)
5-20: Adopt lazyWithPreload for faster first paint on dev screensLeverage the new helper so you can preload high-traffic dev screens and reduce jank on first open.
-import { lazy } from 'react'; +import { lazyWithPreload } from '@/navigation/lazyWithPreload'; -const DevFeatureFlagsScreen = lazy( +const DevFeatureFlagsScreen = lazyWithPreload( () => import('@/screens/dev/DevFeatureFlagsScreen'), ); -const DevHapticFeedbackScreen = lazy( +const DevHapticFeedbackScreen = lazyWithPreload( () => import('@/screens/dev/DevHapticFeedbackScreen'), ); -const DevSettingsScreen = lazy(() => import('@/screens/dev/DevSettingsScreen')); -const CreateMockScreen = lazy(() => import('@/screens/dev/CreateMockScreen')); -const CreateMockScreenDeepLink = lazy( +const DevSettingsScreen = lazyWithPreload(() => import('@/screens/dev/DevSettingsScreen')); +const CreateMockScreen = lazyWithPreload(() => import('@/screens/dev/CreateMockScreen')); +const CreateMockScreenDeepLink = lazyWithPreload( () => import('@/screens/dev/CreateMockScreenDeepLink'), );Optionally preload on app boot or when entering the dev navigator:
DevSettingsScreen.preload?.(); DevFeatureFlagsScreen.preload?.();
52-57: Apply shared header options to DevHapticFeedback for consistent themingKeeps icon tint and typography consistent across dev screens.
DevHapticFeedback: { screen: DevHapticFeedbackScreen, options: { + ...devHeaderOptions, title: 'Haptic Feedback', } as NativeStackNavigationOptions, },
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (8)
app/src/RemoteConfig.web.ts(1 hunks)app/src/navigation/dev.ts(3 hunks)app/src/navigation/lazyWithPreload.ts(1 hunks)app/src/screens/dev/CreateMockScreen.tsx(3 hunks)app/src/screens/dev/CreateMockScreenDeepLink.tsx(3 hunks)app/src/screens/dev/DevHapticFeedbackScreen.tsx(2 hunks)app/src/screens/dev/DevSettingsScreen.tsx(2 hunks)app/tests/src/navigation.test.ts(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- app/src/RemoteConfig.web.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/technical-specification.mdc)
**/*.{ts,tsx}: Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Files:
app/src/screens/dev/DevHapticFeedbackScreen.tsxapp/src/screens/dev/DevSettingsScreen.tsxapp/src/screens/dev/CreateMockScreenDeepLink.tsxapp/src/screens/dev/CreateMockScreen.tsxapp/src/navigation/lazyWithPreload.tsapp/tests/src/navigation.test.tsapp/src/navigation/dev.ts
app/src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:
- Component architecture and reusability
- State management patterns
- Performance optimizations
- TypeScript type safety
- React hooks usage and dependencies
- Navigation patterns
Files:
app/src/screens/dev/DevHapticFeedbackScreen.tsxapp/src/screens/dev/DevSettingsScreen.tsxapp/src/screens/dev/CreateMockScreenDeepLink.tsxapp/src/screens/dev/CreateMockScreen.tsxapp/src/navigation/lazyWithPreload.tsapp/src/navigation/dev.ts
**/*.{test,spec}.{ts,js,tsx,jsx}
⚙️ CodeRabbit configuration file
**/*.{test,spec}.{ts,js,tsx,jsx}: Review test files for:
- Test coverage completeness
- Test case quality and edge cases
- Mock usage appropriateness
- Test readability and maintainability
Files:
app/tests/src/navigation.test.ts
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Organize screens by feature modules (passport, home, settings, etc.)
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Integrate haptic feedback via useHapticNavigation
Applied to files:
app/src/screens/dev/DevHapticFeedbackScreen.tsx
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Use custom hooks for complex state (useModal, useHapticNavigation)
Applied to files:
app/src/screens/dev/DevHapticFeedbackScreen.tsx
📚 Learning: 2025-08-29T15:30:12.155Z
Learnt from: CR
PR: selfxyz/self#0
File: app/AGENTS.md:0-0
Timestamp: 2025-08-29T15:30:12.155Z
Learning: Document complex native module changes for AI review
Applied to files:
app/src/screens/dev/DevSettingsScreen.tsx
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Organize screens by feature modules (passport, home, settings, etc.)
Applied to files:
app/src/screens/dev/DevSettingsScreen.tsx
📚 Learning: 2025-08-29T15:31:15.911Z
Learnt from: CR
PR: selfxyz/self#0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.911Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Test isPassportDataValid() with realistic synthetic passport data (never real user data)
Applied to files:
app/src/screens/dev/CreateMockScreenDeepLink.tsxapp/src/screens/dev/CreateMockScreen.tsxapp/tests/src/navigation.test.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/**/screens/**/*.{ts,tsx} : Lazy load screens using React.lazy()
Applied to files:
app/src/navigation/lazyWithPreload.tsapp/src/navigation/dev.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/**/screens/**/*.{ts,tsx} : Lazy load screens and components to improve performance
Applied to files:
app/src/navigation/lazyWithPreload.tsapp/src/navigation/dev.ts
📚 Learning: 2025-08-29T15:31:15.911Z
Learnt from: CR
PR: selfxyz/self#0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.911Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Verify extractMRZInfo() using published sample MRZ strings (e.g., ICAO examples)
Applied to files:
app/tests/src/navigation.test.ts
📚 Learning: 2025-08-29T15:31:15.911Z
Learnt from: CR
PR: selfxyz/self#0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.911Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Write integration tests that exercise the real validation logic (not mocks)
Applied to files:
app/tests/src/navigation.test.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/navigation/**/*.{ts,tsx} : Set platform-specific initial routes: web → Home, mobile → Splash
Applied to files:
app/tests/src/navigation.test.ts
📚 Learning: 2025-08-29T15:31:15.911Z
Learnt from: CR
PR: selfxyz/self#0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.911Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Ensure parseNFCResponse() works with representative, synthetic NFC data
Applied to files:
app/tests/src/navigation.test.ts
📚 Learning: 2025-08-26T14:41:41.821Z
Learnt from: shazarre
PR: selfxyz/self#936
File: app/src/screens/aesop/PassportOnboardingScreen.tsx:0-0
Timestamp: 2025-08-26T14:41:41.821Z
Learning: When verifying provider hierarchies in React Native apps, always check the main App.tsx file at the app root, not just navigation/index.tsx and layout files, as providers are often configured at the top-level App component.
Applied to files:
app/src/navigation/dev.ts
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
PR: selfxyz/self#942
File: app/vite.config.ts:170-0
Timestamp: 2025-08-23T02:02:02.556Z
Learning: In the selfxyz/self React Native app, devTools from '@/navigation/devTools' are intentionally shipped to production builds for testing purposes, not excluded as is typical in most applications.
Applied to files:
app/src/navigation/dev.ts
📚 Learning: 2025-08-24T18:52:25.796Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.796Z
Learning: Applies to src/navigation/**/*.{ts,tsx} : Use react-navigation/native with createStaticNavigation for type-safe navigation
Applied to files:
app/src/navigation/dev.ts
🧬 Code graph analysis (2)
app/tests/src/navigation.test.ts (1)
app/src/navigation/index.tsx (1)
navigationScreens(30-40)
app/src/navigation/dev.ts (1)
app/src/utils/colors.ts (2)
black(8-8)white(57-57)
🪛 GitHub Check: build-deps
app/src/navigation/lazyWithPreload.ts
[warning] 11-11:
Unexpected any. Specify a different type
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: test
- GitHub Check: build-android
- GitHub Check: build-ios
- GitHub Check: e2e-ios
- GitHub Check: analyze-ios
- GitHub Check: analyze-android
🔇 Additional comments (5)
app/src/screens/dev/DevHapticFeedbackScreen.tsx (1)
36-36: No stale DevHapticFeedback imports/usages found
All outdated references have been removed.app/src/screens/dev/CreateMockScreen.tsx (1)
159-159: No remaining MockDataScreen references; rename completeapp/src/screens/dev/DevSettingsScreen.tsx (1)
131-153: Dev menu items are in sync with navigationScreens
No missing or stale entries detected.app/src/navigation/dev.ts (2)
10-20: Default exports confirmed for all lazy-loaded dev screens
All modules in app/src/screens/dev default-export a component; no changes needed.
46-51: Deep‐link route “MockDataDeepLink” is already wired to CreateMockScreenDeepLink; linking config also maps it to the same path. No further changes needed—deep link routing remains correct.
| // SPDX-License-Identifier: BUSL-1.1 | ||
| // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. | ||
|
|
||
| import { lazy, type LazyExoticComponent } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import ComponentType to avoid React namespace type issues
Referencing React.ComponentType without importing the React namespace can fail under stricter TS configs (NodeNext/Bundler). Import the type explicitly.
-import { lazy, type LazyExoticComponent } from 'react';
+import { lazy, type LazyExoticComponent, type ComponentType } from 'react';📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { lazy, type LazyExoticComponent } from 'react'; | |
| import { lazy, type LazyExoticComponent, type ComponentType } from 'react'; |
🤖 Prompt for AI Agents
In app/src/navigation/lazyWithPreload.ts around line 5, the file imports lazy
and LazyExoticComponent but references React.ComponentType elsewhere which can
break under strict TS configs; update the import to also include the
ComponentType type from 'react' (e.g. add ComponentType to the existing named
import) and replace any occurrences of React.ComponentType in this file with the
imported ComponentType to avoid namespace/type resolution issues.
| export function lazyWithPreload<T extends React.ComponentType<any>>( | ||
| factory: () => Promise<{ default: T }>, | ||
| ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remove any and add explicit return type for stronger type-safety
Eliminate any, align with static analysis, and make the API surface explicit. Also type preload via typeof factory to prevent drift.
-export function lazyWithPreload<T extends React.ComponentType<any>>(
- factory: () => Promise<{ default: T }>,
-) {
+export function lazyWithPreload<T extends ComponentType<unknown>>(
+ factory: () => Promise<{ default: T }>,
+): LazyExoticComponent<T> & { preload: typeof factory } {Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 GitHub Check: build-deps
[warning] 11-11:
Unexpected any. Specify a different type
| const CreateMockScreenDeepLink: React.FC = () => { | ||
| const navigation = useNavigation(); | ||
|
|
||
| const [selectedCountry, setSelectedCountry] = useState('USA'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Route change OK; type the navigator to catch future key drift
Navigating to 'ConfirmBelonging' is consistent with the PR. Tighten types so route key/name mismatches fail fast.
import { useNavigation } from '@react-navigation/native';
+import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
+import type { RootStackParamList } from '@/navigation';
- const navigation = useNavigation();
+ const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();Confirm the route key exists in your stack:
Also applies to: 59-61, 207-207
🏁 Script executed:
#!/bin/bash
rg -nP "ConfirmBelonging\b" app/src/navigationLength of output: 101
Tighten navigation typings
Specify the route param types on useNavigation to catch key/name mismatches at compile time.
-import { useNavigation } from '@react-navigation/native';
+import { useNavigation } from '@react-navigation/native';
+import type { NativeStackNavigationProp } from '@react-navigation/native-stack';
+import type { RootStackParamList } from '@/navigation';
-const navigation = useNavigation();
+const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();Apply this change in CreateMockScreenDeepLink.tsx at lines 28–31, 59–61, and 207.
🤖 Prompt for AI Agents
In app/src/screens/dev/CreateMockScreenDeepLink.tsx around lines 28–31, 59–61,
and 207, the useNavigation hook is untyped; update it to use the app's
navigation param types (e.g., import your RootStackParamList and use
useNavigation<NativeStackNavigationProp<RootStackParamList,
'CreateMockScreenDeepLink'>>() or the appropriate route name/type from your
navigator). Update the three occurrences to use the typed navigation prop (and
import NativeStackNavigationProp or CompositeNavigationProp as needed) so
TypeScript verifies route/key names and params at compile time.
* SDK Go version (#920) * feat: helper functions and constant for go-sdk * feat: formatRevealedDataPacked in go * chore: refactor * feat: define struct for selfBackendVerifier * feat: verify function for selfBackendVerifier * feat(wip): custom hasher * feat: SelfVerifierBacked in go * test(wip): scope and userContextHash is failing * test: zk proof verified * fix: MockConfigStore getactionId function * chore: refactor * chore: remove abi duplicate files * chore: move configStore to utils * chore: modified VcAndDiscloseProof struct * chore: more review changes * feat: impl DefaultConfig and InMemoryConfigStore * chore: refactor and export functions * fix: module import and README * chore: remove example folder * chore: remove pointers from VerificationConfig * chore: coderabbit review fixes * chore: more coderabbit review fix * chore: add license * fix: convert attestationIdd to int * chore: remove duplicate code --------- Co-authored-by: ayman <[email protected]> * Moving proving Utils to common (#935) * remove react dom * moves proving utils to the common * need to use rn components * fix imports * add proving-utils and dedeuplicate entry configs for esm and cjs. * must wrap in text component * fix metro bundling * fix mock import * fix builds and tests * please save me * solution? * fix test * Move proving inputs to the common package (#937) * create ofactTree type to share * move proving inputs from app to register inputs in common * missed reexport * ok * add some validations as suggested by our ai overlords * Fix mock passport flow (#942) * fix dev screens * add hint * rename * fix path * fix mobile-ci path * fix: extractMRZ (#938) * fix: extractMRZ * yarn nice && yarn types * fix test: remove unused * fix mobile ci * add script --------- Co-authored-by: Justin Hernandez <[email protected]> * Move Proving attest and cose (#950) * moved attest and cose utils to common with cursor converted tests in common to use vitest and converted coseVerify.test to vitest after moving from app to common what does cryptoLoader do? * moved away * get buff Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * SELF-253 feat: add user email feedback (#889) * feat: add sentry feedback * add sentry feedback to web * feat: add custom feedback modal & fix freeze on IOS * yarn nice * update lock * feat: show feedback widget on NFC scan issues (#948) * feat: show feedback widget on NFC scan issues * fix ref * clean up * fix report issue screen * abstract send user feedback email logic * fixes * change text to Report Issue * sanitize email and track event messge * remove unnecessary sanitization * add sanitize error message tests * fix tests * save wip. almost done * fix screen test * fix screen test * remove non working test --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> * chore: centralize license header checks (#952) * chore: centralize license header scripts * chore: run license header checks from root * add header to other files * add header to bundle * add migration script and update check license headers * convert license to mobile sdk * migrate license headers * remove headers from common; convert remaining * fix headers * add license header checks * update unsupported passport screen (#953) * update unsupported passport screen * yarn nice * Migrate Analytics (#951) * setup analytics adapter for self mobile sdk client and use in app * wrap for context * fix build * yarn types is an alias for build when build just compiles ts * ok unlock * deeper * ok this looks to work * fix license check * make sure it starts with this line * someone didnt commit * fix double analytics bug and builds * lint * Read document catalog from selfClient (#936) * [SELF-676] feat: upgrade React Native from 0.75.4 to 0.76.9 (#943) * chore: upgrade build tooling to Node 22 and AGP 8.6 * chore: upgrade react-native to 0.76.9 * update lock files and formatting * fix path * fix: handle hermes-engine cache mismatch in CI after React Native upgrade - Add fallback logic to run 'pod update hermes-engine' when pod install fails - This resolves CocoaPods cache issues that occur after React Native version upgrades - Fixes CI pipeline failures on codex/update-core-tooling-for-react-native-upgrade branch * fix: improve hermes-engine cache handling in CI - Preemptively clear CocoaPods cache before pod install - This prevents dependency analysis failures that occur when cached podspecs conflict - Addresses the root cause: cache conflicts during 'Analyzing dependencies' phase - Keeps fallback logic for additional safety * fix: handle hermes-engine cache in mobile-bundle-analysis workflow - Add pod-install-with-cache-fix.sh script to handle hermes-engine cache conflicts - Update install-app:setup script to use the new cache fix approach - This fixes the mobile-bundle-analysis.yml workflow failures after React Native upgrade - Proactively clears CocoaPods cache and has fallback for hermes-engine updates * formatting * fix: robust hermes-engine cache handling in CI workflows - Apply comprehensive cache clearing to mobile-ci.yml and mobile-e2e.yml - Pre-emptively run 'pod update hermes-engine' before pod install - Clear multiple cache locations to handle CI environment differences - This prevents 'hermes-engine differs from Pods/Local Podspecs' errors - Fixes all workflows affected by React Native 0.76.9 upgrade cache issues * fixes * clean up * update lock files * fix tests * sort * fixes * fix ci * fix deployment target * android fixes * upgrade fix * fixes * fix: streamline mobile CI build and caching (#946) * fix: streamline mobile CI build and caching * Enable mobile E2E tests on codex/fix-mobile-ci-workflow-errors branch * test * simplify and fix path * workflow fixes * fix loading on 0.76.9 * clean up unnecessary comments * fix readme * finalize upgrade to 0.76.9 * fix android build and upgrade * fix bundler caching * download cli to fix "yarn start" issues * fix cli build erorr * fix script path * better path * abstract build step to prevent race condition * fixes * better cache * fix corepack build error * update lock * update lock * add yarn cache to workflows * fix test building * ci caching improvements * fix common type check * fix common ci * better mobile sdk alpha building logic * chore: speed up mobile e2e workflow (#962) * chore: speed up mobile e2e workflow * chore: disable android e2e job * chore: speed up ios build * fix: bundle js for ios debug build * fix e2e * fix mobile ci (#964) * feat: improve mixpanel flush strategy (#960) * feat: improve mixpanel flush strategy * fixes * fix build * update lock * refactor methods * conslidate calls * update package and lock * refactor: remove namespace imports (#969) * refactor: remove namespace imports * refactor: use named fs imports * refactor(app): replace path and fs namespace imports * format * format * Mixpanel tweaks (#971) * udpates * fox * update license * Add DSC parsing check (#836) * Handle missing dsc parsed * nice * fix test * throw * fix * chore(app): upgrade dependencies (#968) * chore(app): upgrade dependencies * update package * update lock files * fixes * lock * fix * Auth Adapter + (#958) * basic auth adapater * remove SelfMobileSDk, this was another architecture which the adapter patern replaced * rename to avoid confusion with client.test.ts * basic auth adapater * remove SelfMobileSDk, this was another architecture which the adapter patern replaced * rename to avoid confusion with client.test.ts * self * fix * remove prototypes * make sure its mounted * fix tests * fmt * require required adapters * fix types * not a partial * adds missing exports * fix missing data * Fix nfc configuration scanning issue (#978) * fix nfc scanning on ios and android * save test * fix tests * fix lint * Chore fix ios nfc scanning and compiling (#979) * fixes * silence error * fix debugge * fix nfc scanning * lint and pipeline fixes * large runner (#980) * chore: update to macos latest large runner (#981) * bump up to macos-latest-large * fix ci * Move loadSelectedDocument to SDK (#967) Co-authored-by: Aaron DeRuvo <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * docs: update mobile SDK migration progress (#982) * docs: record app integration progress * docs: consolidate mobile SDK migration tracking * docs: humanize migration tracking and merge prompts * docs: add common consolidation tasks * docs: reprioritize migration tasks * docs: soften migration plan tone * docs: detail agent prompts with file paths * docs: catalog Linear tasks for SDK * updates * remove artifact management * moves validateDocument functions into the common package. (#977) * moves validateDocument functions into the common package. * fix build issues and lint * handle bad connections better in nullifiier * add an abort controler to nullifer fetcher, ignore fals positives * import types separately * take it as an arg * chore: update yarn.lock * chore(app): resolve lint warnings (#990) * chore(app): resolve lint warnings * update lock * clean up any types * fix types * feedback from cr * [SELF-703] feat: Migrate mock generator to mobile sdk (#992) * feat: expose mock generator * formatting * fix tests and lint * rename passport to document * fix types * [SELF-698] scaffold mobile sdk demo app (#993) * chore: scaffold mobile sdk demo app * test: cover demo app menu * prettier and types * sort * add android app foundation * fix android loading * get ios app running * update script * cr feedback * disable fabric * fixes * fixes * fix * SELF-702: Refactor navigation structure and dev utilities (#994) * Refactor navigation and dev screens * refactor: rename passport screens to document * fixes * add missing header * fixes * type files * feat: clarify proof verification analytics (#996) * feat: increase sha256 byte size and add new rsa circuits (#986) * feat: increase sha256 byte size and add new rsa circuits * feat: modularise the rsa fp pow mod * chore: comment signature verifier for testing * fix: sha256_sha256_sha224_ecdsa_secp224r1 * lint * chore: implement google play suggestions (#997) * google play suggestions * update gitguardian ignore * remove unused * chore: address yarn lock issues (#1004) * address yarn lock issues * fix postinstall * skip postinstall for ci (#1005) * [SELF-654] feat: add native modules (#919) * feat: add ios native modules * fix: extractMRZ * Add android OCR native module * wire native mrz module with adapter * wire Native modules and fix tests * fixes * fix license header logic * fix tests * fix types * fix: ci test * fix: android build ci * fix: ios build CI * add podfile.lock * add yarn.lock * update lock files * add yarn.lock * add license * order methods * update lock * pipeline fixes * prettier * update lock file * fix native modules on external apps * bundle @selfxyz/common into mobile-sdk-alpha * chore: address yarn lock issues (#1004) * address yarn lock issues * fix postinstall * update lock * fix build issues * fix pipeline issue * fix ci * fix bad merge * fix android ci * fix ci errors * fix mobile sdk ci. stop gap fix for now until we create a package * tweaks * retry aapt2 approach * use ^0.8.4 instead of ^0.8.0 due to the use of custom errors * workflow fixes * fix file * update * fix ci * test ci fix * fix test --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> * chore: update dev with staging 09/06/25 (#1007) * update CI * bump iOS version * update readme * update mobile-deploy ci * bump version iOS * update workflow to use workload identity federation (#933) * update workflow to use workload identity federation * add token permissions * correct provider name * chore: incrementing android build version for version 2.6.4 [github action] --------- Co-authored-by: Self GitHub Actions <[email protected]> * update ci * update ci * update ci * update ci * update ci * fix ci * fix ci * fix ci * remove fastlane use for android * bump iOS build version * update CI python script * iterate on CI * iterate on CI * iterate on CI * Dev (#941) * SDK Go version (#920) * feat: helper functions and constant for go-sdk * feat: formatRevealedDataPacked in go * chore: refactor * feat: define struct for selfBackendVerifier * feat: verify function for selfBackendVerifier * feat(wip): custom hasher * feat: SelfVerifierBacked in go * test(wip): scope and userContextHash is failing * test: zk proof verified * fix: MockConfigStore getactionId function * chore: refactor * chore: remove abi duplicate files * chore: move configStore to utils * chore: modified VcAndDiscloseProof struct * chore: more review changes * feat: impl DefaultConfig and InMemoryConfigStore * chore: refactor and export functions * fix: module import and README * chore: remove example folder * chore: remove pointers from VerificationConfig * chore: coderabbit review fixes * chore: more coderabbit review fix * chore: add license * fix: convert attestationIdd to int * chore: remove duplicate code --------- Co-authored-by: ayman <[email protected]> * Moving proving Utils to common (#935) * remove react dom * moves proving utils to the common * need to use rn components * fix imports * add proving-utils and dedeuplicate entry configs for esm and cjs. * must wrap in text component * fix metro bundling * fix mock import * fix builds and tests * please save me * solution? * fix test * Move proving inputs to the common package (#937) * create ofactTree type to share * move proving inputs from app to register inputs in common * missed reexport * ok * add some validations as suggested by our ai overlords * Fix mock passport flow (#942) * fix dev screens * add hint * rename * fix path * fix mobile-ci path * fix: extractMRZ (#938) * fix: extractMRZ * yarn nice && yarn types * fix test: remove unused * fix mobile ci * add script --------- Co-authored-by: Justin Hernandez <[email protected]> * Move Proving attest and cose (#950) * moved attest and cose utils to common with cursor converted tests in common to use vitest and converted coseVerify.test to vitest after moving from app to common what does cryptoLoader do? * moved away * get buff Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * SELF-253 feat: add user email feedback (#889) * feat: add sentry feedback * add sentry feedback to web * feat: add custom feedback modal & fix freeze on IOS * yarn nice * update lock * feat: show feedback widget on NFC scan issues (#948) * feat: show feedback widget on NFC scan issues * fix ref * clean up * fix report issue screen * abstract send user feedback email logic * fixes * change text to Report Issue * sanitize email and track event messge * remove unnecessary sanitization * add sanitize error message tests * fix tests * save wip. almost done * fix screen test * fix screen test * remove non working test --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> * chore: centralize license header checks (#952) * chore: centralize license header scripts * chore: run license header checks from root * add header to other files * add header to bundle * add migration script and update check license headers * convert license to mobile sdk * migrate license headers * remove headers from common; convert remaining * fix headers * add license header checks * update unsupported passport screen (#953) * update unsupported passport screen * yarn nice --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: ayman <[email protected]> Co-authored-by: Aaron DeRuvo <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * bump version * bump yarn.lock * update ci (#966) * chore: Manually bump and release v2.6.4 (#961) * update lock files * bump and build android * update build artifacts * show generate mock document button * update lock * fix formatting and update failing e2e test * revert podfile * fixes * fix cold start of the app with deeplink * update ci * update ci * Sync MARKETING_VERSION to iOS project files after version bump * chore: incrementing android build version for version 2.6.4 [github action] (#976) Co-authored-by: remicolin <[email protected]> * chore: add build dependencies step for iOS and Android in mobile deploy workflow * chore: enhance mobile deploy workflow by adding CMake installation step * bump android build version * chore: incrementing android build version for version 2.6.4 [github action] (#985) Co-authored-by: remicolin <[email protected]> * chore: configure Metro bundler for production compatibility in mobile deploy workflow * chore: incrementing android build version for version 2.6.4 [github action] (#987) Co-authored-by: remicolin <[email protected]> * Revert "chore: configure Metro bundler for production compatibility in mobile deploy workflow" This reverts commit 60fc1f2580c2f6ad3105d8b904d969412a18bd2e. * reduce max old space size in mobile-deploy ci * fix android french id card (#957) * fix android french id card * fix common ci cache * feat: log apdu (#988) --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> * unblock ci * fix merge * merge fixes * fix tests * make ci happy --------- Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: pputman-clabs <[email protected]> Co-authored-by: Self GitHub Actions <[email protected]> Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: ayman <[email protected]> Co-authored-by: Aaron DeRuvo <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: fix yarn format (#1009) * fix yarn format * yarn format * fix lint * undo temporary disabling * pipeline fixes * revert nvmrc change * add new home screen (#1019) * add new home screen * fix typing issue * yarn nice * chore: update the cpp build script (#1021) * chore: install node (#1022) * chore: use node v22 (#1023) * chore: install yarn (#1024) * chore: yarn cache (#1025) * chore: sanitise node version (#1026) * remove lazy loading (#1018) * remove lazy loading * fix tests * formatting * fix imports and web ci * fix tests * fix building * fix * debug ci * fix web ci issue * fix * fix * fix ci * remove web render test * coderabbit feedback * fix ci * use import * fix lint * fix compiling * update lock * update lock * fix: update yarn.lock hash for @selfxyz/mobile-sdk-alpha Resolves CI error where yarn install --immutable failed due to outdated package hash. The hash changed from b2afc4 to f9ebb9. * fix: update yarn.lock hash after mobile-sdk-alpha changes - Hash changed from c0e6b9 to 0d0f72 due to package modifications - Cleaned caches and regenerated lockfile to ensure consistency - This resolves CI cache mismatch where old artifacts had stale hash * fix: update yarn.lock hash after building mobile-sdk-alpha - Final hash: 89f5a6 (includes built dist artifacts) - Built mobile-sdk-alpha to ensure package is in stable state - This should resolve CI immutable install errors * fix yarn lock and build * chore(ci): improve mobile e2e caching (#1010) * chore(ci): improve mobile e2e caching * chore(ci): restore deriveddata cache * chore(ci): remove ios deriveddata cache * chore(ci): cache ios derived data * chore(ci): optimize mobile deploy caching * chore(ci): enable ccache for ios e2e builds * fix(ci): add ccache path for ios e2e * moves ofac and protocol store (#1012) * move ofact tree fetch to common * move protocol store to the msdk, fix some dependencies on msdk * chore: remove register id from register circuits (#1028) * chore: remove register id from register circuits * chore: only use 128ram instance * Feat/build cpp (#1029) * chore: remove register id from register circuits * chore: only use 128ram instance * chore: build 2 circuits at a time * Remove navigationRef from provingMachine (#1011) * SDK: minimize amount of data sent through PROVING_PASSPORT_NOT_SUPPORTED event (#1030) * Fix mock passport generation (#1031) * fix mock passport generation * fix mobile ci tests * Feat/aadhaar (#949) * make contract sdk simpler (#514) * make contract sdk simpler * reduce root inputs * delete convert function * summarize our library * update npm package * update package version * update attestation id * add util function to get revealed data * Revert "make contract sdk simpler (#514)" (#518) This reverts commit 847b88d5ecc0d449b976a552f68af38eec8e561b. * merge dev into main (#576) * Feat: Show error code in SDK (#500) * feat: emit `error_code` and `reason` in app * feat: add `onError` in sdk * feat: Display reason in app * lint & fmt * feat: add scrollview in ProofRequestStatusScreen for long reasons * Fix input generation for 521bit curves (#481) * fix EC point padding for 521 bit curves * rename modulus to point in findStartIndexEC as it is a point * simplify matching logic * simplify padding logic * remove comment * remove log removing .only so the CI/CD runs circuit tests fix disclosure test fix scope in test fix scope error in circuit tests remove .only fix test * run ci/cd * Feat/simpler contract sdk (#519) * make contract sdk simpler * reduce root inputs * delete convert function * summarize our library * update npm package * update package version * update attestation id * add util function to get revealed data --------- Co-authored-by: motemotech <[email protected]> * forgot to include package update (#521) * Bump version to 2.5.1 (#522) * bump version * update fastlane * fix bump version * bump build and add todo * disable commit for now * [SEL-154] Step 1: Scan your passport (#511) * simplify navigation logic * use aesop design hook * save wip * add new aesop redesign screens * save wip design * refactor nav bar logic * fix paths * save wip * stub progress navbar and save wip * save wip progress bar animation * save wip progress bar, almost done with design * fix progress bar design * fix bottom padding * disable git commit for now * fix flaky android downloads that causes pipeline to crash * update lock for ci * [SEL-46] FE: Add minimum bottom padding (#510) * fix bottom padding for smaller screens * fix podfile post install hook permissions check * update pod lock and disable git commit action step for now * update lock * fix flaky android downloads that causes pipeline to crash * fix: improve error handling for forbidden countries list mismatch (#494) * Update SelfBackendVerifier.ts * Update constants.ts * Update formatInputs.ts * Update formatCallData.ts * DX: Auto format on save (#526) * save wip * use elint instead of prettier to sort imports * set imports to warn * sync prettier settigns * update prettier settings * save working version * fix export and disable mobile pipeline for now * limit auto formatting to the app folder * remove artefacts * SEL-187: Make bottom layout scrollable on smaller screens (#525) * fix design check * add an option to disable local sending of sentry events * better sentry enable / disable * fix scan passport height * make bottom layout scrollable so it doesn't squish top screen * simpler logic check. don't create new env var * fix internet connection issues * readd comment * use isConnected instead of internet reachable * use a dynamic bottom panel height * add missing recovery screens * move aesop below * remove dupe export * fix rebase * fix android package download issue * Feat/extend id support (#517) * refactor proving impleting xstate, speedup proving * add disclosure proof support * keep refactoring provingMachine, clean old implementation * call init method when switching from dsc to register * rebase with dev to display why the proof verification failed * refactor ws connexion between front-end and mobile to retrieve self-app * update the webclient at proofVerification and use selfAppStore in provingMachine * fix provintStore.init in ProveScreen * yarn nice * fetch data correctly in splash screen * Bump build versions for 2.5.1 (#531) * release new builds * fix app and build versions * fix env check * display error animation on failure on loading screen (#532) * display error animation on failure on loading screen * remove log --------- Co-authored-by: Justin Hernandez <[email protected]> * ci: bump actions/checkout to v4 (#529) * make contract sdk simpler (#514) * make contract sdk simpler * reduce root inputs * delete convert function * summarize our library * update npm package * update package version * update attestation id * add util function to get revealed data * Revert "make contract sdk simpler (#514)" (#518) This reverts commit 847b88d5ecc0d449b976a552f68af38eec8e561b. * ci: bump actions/checkout to v4 --------- Co-authored-by: nicoshark <[email protected]> Co-authored-by: turnoffthiscomputer <[email protected]> * fix italy (#530) * Fix/proving machine endpoint type (#538) * store endpoint type in proving machine * yarn nice * fix splash screen error (#539) * New bug fix build for v2.5.1 (#540) * bump new build for dev fixes * update lock * reinstall before running local deploy * SEL-178: Improve haptic feedback library (#535) * fix dev settings typing * add dev screens file * save haptic feedback progress * change ordedr * fix initial route and add haptic feedback screen to dev settings options * add delete scripts (#542) * update staging registry address (#545) * feat: Add Disclose history (#533) * feat: Add Disclose history * fix: Duplicate history in list * fix: Outdated disclosures * Delete app/ios/Self copy-Info.plist * allow a scale of up to 1.3 (#546) * allow a scale of up to 1.3 * update lock files * clean up unused imports * fix settings * add common sdk (#537) * add common sdk * remove sdk backend api * remove registry * regenerate sha256 rsa dsc each time * download ski-pem dynamically on staging, refactor initpassportDataParsing * add state machine for button on prove screen, improve ux on splash screen * fetch ski-pem in production * fix linter issues * fix prove screen button bugs * update podfile.lock and yarn.lock * run linter in circuits repo * bump build * bump version for sentry debugging * bump ios to version 118 --------- Co-authored-by: Justin Hernandez <[email protected]> * better connection check (#548) * Clean up navigation and setup Jest (#549) * remove dupe account screens and prefer the term home * organize screen loading better * sort keys * rename screen files wip * fix deleted directory issues * rename folders * fix paths and naming * save working jest import test * save base working jest navigation test * finalize navigation refactor and jest test * update test name and podfile lock * remove unused packages * use the correct version of react test renderer * bump build (#552) * Eth dublin (#554) * add mock id card generator * add genMockIdDoc in common/sdk exports * onboard developer id using deeplink, allow custom birthdate on mockpassport * log more dsc info (#558) * Push notification (#536) * add push notification feature * merge new app impl * change dsc key * import * reverse mock dsc * worked in the ios * checked in android * update url and delete console * delete small changes * lint * add yarn.lock * fix warning message * add mock notification service for test code * fix path for the mock implementation * add mock deeplink to the test code * nice notificationServiceMock.js * delete unused firebase related implementation * fix wording and UI related to notification service * hotfix on mockdatascreen --------- Co-authored-by: turnoffthiscomputer <[email protected]> * Fix deeplink 2 (#560) * fix deeplink * fix deeplink * yarn nice * feat: Use vision for MRZ scanning (SEL-47) (#557) * feat: Use vision for MRZ scanning * modify label to position the smartphone during the OCR scan --------- Co-authored-by: turnoffthiscomputer <[email protected]> * SEL-255: improved loading screen with estimated wait times (#550) * create new loading screen and rename static to misc * fix route * save wip loading screen * save wip animation * save static wip design * continue * splash * add a loading screen text helper * add test for loading screen text * save wip. almost there * update haptic logic * better feedback and add dev scren * save current work * update text logic and tests * load passport metadata in loading screen * simplify and fix tests * test for additional exponents * add new animation * rename file * consolidate ui useEffect and fix loading screen layout * fix current state * remove mockPassportFlow param * merge new loading screen and new notification logic * simplify * update lock * use passportMetadata instead of metadata * save simplification * update loading text based on pr feedback and tests * Bump v2.5.1: ios 122; android 60 (#561) * increment build to 120 * bump builds for 2.5.1. ios 121; android 60 * clean up logic * upgrade react native firebase for privacy manifests * update react native keychain to fix could not recover issue (#564) * fix: update ocr corrections (#563) * Chore: Polish proof history to prep for release (#566) * clean up nav and home boundaries, passport data screen insets * migrate proof history screen out of settings * minor clean up * save wip * add new ibm plex mono font and clean up proof detail screen * remove test data * remove extra loading screen text * remove unnecessary ceil * Bump v2.5.1; ios 123; android 62 (#565) * bump to build 61 * bump ios version * update version * Feature/add prettier formatter (#568) * Add Prettier configuration and ignore files for code formatting - Created .prettierignore to exclude specific directories and files from formatting. - Added .prettierrc.yml with custom settings for print width and trailing commas. - Updated package.json to include Prettier and its Solidity plugin as dependencies, along with scripts for formatting and checking code. * Run prettier formatting * fix nationality using mock passports * SEL-181 & SEL-252: Update mobile app events (#570) * improve analytics handling * add error boundary that flushes segment events before error occurs * upgrade segment analytics package * flush analytics when user encounters error screen * track all click events * add tracking to loading screen * better init and click event names * track cloud backup and modal actions * use __DEV__ for debugging * add tracking to account recovery, auth, mock data * return false instead of throwing * add more tracking events * save wip event updating * abstract analytic event names * update click events * clean up * move reasons comment * add unsupported passport event * Feature/enhance self verification root (#569) * Add SelfVerificationConsumer contract for self-verification logic - Introduced an abstract contract, SelfVerificationConsumer, that extends SelfVerificationRoot. - Implemented nullifier tracking, verification success events, and customizable validation and update methods for nullifiers. - Added error handling for nullifier check failures and hooks for derived contracts to implement custom logic after successful verification. * Add SelfHappyBirthday contract example using SelfVerificationConsumer - Introduced SelfHappyBirthday contract that allows users to claim USDC on their birthday. - Integrated SelfVerificationConsumer for handling verification and nullifier tracking. - Added functions to set claimable amount and window, along with event emissions for state changes. - Implemented logic to check if the claim is within the user's birthday window and transfer USDC accordingly. * Refactor imports in HappyBirthday contract for better organization - Updated import statements in HappyBirthday.sol to use relative paths for ISelfVerificationRoot, SelfCircuitLibrary, and SelfVerificationConsumer. - Improved code readability and maintainability by organizing imports more logically. * Refactor Airdrop contract to use SelfVerificationConsumer for registration logic - Updated Airdrop contract to inherit from SelfVerificationConsumer instead of SelfVerificationRoot. - Refactored mappings for user identifiers and nullifiers for improved clarity and functionality. - Enhanced error handling and updated function parameters for consistency. - Implemented new validation and update methods for nullifiers, streamlining the registration process. - Removed deprecated verifySelfProof function and integrated logic into new methods. * Add events and refactor SelfVerificationRoot and related contracts - Introduced new events in SelfVerificationRoot for verification configuration updates, scope changes, and attestation ID management. - Updated Airdrop contract to remove deprecated events and added a new event for Merkle root updates. - Refactored SelfPassportERC721 to inherit from SelfVerificationConsumer, enhancing verification logic and event handling. - Improved function parameters for consistency and clarity across contracts. * Refactor contracts to use SelfVerificationRoot and enhance verification logic - Removed SelfVerificationConsumer contract and updated related contracts to inherit from SelfVerificationRoot. - Refactored mappings and event emissions in Airdrop, HappyBirthday, and SelfPassportERC721 for improved clarity and functionality. - Enhanced verification success hooks to include user identifiers and nullifiers for better tracking. - Updated constructor parameters for consistency across contracts and improved error handling for user registration and claims. * Refactor constructor in SelfPassportERC721 for improved readability * Refactor function parameters in SelfVerificationRoot and related contracts * Refactor constructor parameter names in IdentityVerificationHub, Airdrop, IdentityRegistry, and ProxyRoot contracts for improved clarity and consistency * fix getCircuitName function (#575) * fix getCircuitName function * fix getCircuitName function * feat: Read ID cards (#571) * Update GitHub checkout action from v3 to v4 (#544) * Bump build version 2.5.2 to test react native keychain (#572) * bump build and version * bump version 2.5.2 * don't downgrade react native keychain * update app/README.md toolchain instructions (#140) * bump build (#580) --------- Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: turboblitz <[email protected]> Co-authored-by: motemotech <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: crStiv <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: James Niken <[email protected]> Co-authored-by: Kevin Lin <[email protected]> Co-authored-by: leopardracer <[email protected]> Co-authored-by: Olof Andersson <[email protected]> * feat(wip): register circuit for aadhaar * chore: add anon aadhar circuits * chore: remove sc and disclose selfrica test * feat: extract aadhaar qr data * test: aadhaar qr data extract circuit * test: aadhaar register circuit * feat: extract pincode and ph no last 4 digit * fix: register aadhaar nullifier and commitment * test: Verify commitment circuit of aadhaar * feat: add photoHash inside commitment * feat: build Aadhaar OFAC SMT * feat: ofac check and reveal data (test done) * test: qr extractor for custom data input * feat: add state as reveal data inside VC and disclose * chore: add comments * fix: num2Ceil component * chore: review changes * chore: use passport SignatureVerifier * fix: signatureVerifier inputs * feat: extract ascii values of fields * feat: provide users the flexibility to reveal specific characters of a field * chore: refactor * test: register aadhaar for tampered data * test(wip): should return 0 if in ofac list * test: ofac check * test: register aadhaar circuit for different qr data * merge dev into main (#683) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) * implement self uups upgradeable (#592) * implement self uups upgradeable * small changes in identityVerificationHubImplV2 * delete aderyn.toml * chore: add custom verifier * chnage return output * feat: use self structs and a Generic output struct * feat: add userIdentifier, nullifier, forbiddencountries to returned output * add root view functions from registry * fix: build and compilation errors * add userDefined data into selfVerificationRoot * "resolve conflicts" * fix compilation problem * fix how to register verification config * test: CustomVerifier * fix verification root and hub integration * add scope check in hub impl * replace poseidon hash to ripemd+sha256 * add todo list * feat: refactor and add test cases for generic formatter * add performUserIdentifierCheck in basicVerification * change how to handle additionalData and fix stack too deep * start adding test codes * fix dependency problems in monorepo * fix: forbidden countries (#612) LGTM! * able to run test code * pass happy path * delete unused codes * change error code name, add caller address validation and add scripts to run test and build in monorepo * add all test cases in vcAndDisclose flow * remove comment out * chore: use actual user identifier outputs * success in registration tests * cover all cases * pass contractVersion instead of circuitVersion * fix disclose test * chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter * change val name and remove unused lines * add val name change * remove userIdentifier from return data * feat: use GenericDiscloseOutput struct in verfication hook fix test cases for user identifier * chore: change the function order for Hub Impl V2 (#625) * fix nat specs * add nat spec in SelfStructs --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Nesopie <[email protected]> * prettier (#629) * CAN auth - android (#613) * add missed files * add NFCMethodSelectionScreen * bump android build --------- Co-authored-by: Justin Hernandez <[email protected]> * feat: add MRZ correction method to NFCMethodSelectionScreen (#627) * add npm auth token env (#632) * bump sdk version (#633) * publish npm package when merging on dev * bump common sdk version * replace yarn publish by npm publish * update common package version * Simplify dev mode gesture (#635) * Simplify developer mode gesture * Enable dev mode on MockData screen with five taps * add build smt function to common sdk * update vc_and_disclose_id test (dev branch) (#641) * fix: vc_and_disclose_id test * chore: yarn prettier * Show modal on NFC scan error (#642) * Add help button and error modal actions * fix the screen management * yarn nice * Bump build v2.5.4: ios 132; android 71 (#631) * bump version and build numbers * remove tamagui/toast * fix marketing version * fix: update TD1 and TD3 checks (#643) * bum yarn.lock * Bump build: ios 133; android 72 and build fixes (#654) * update gesture version and bump android build * bump and fix ios build * update lock files * fixes * fix fotoapparat library source * Update example contracts to include EUID usage (#656) * refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic * refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations * refactor: remove BASIS_POINTS constant from Airdrop contract * feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721 * fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook * cherry pick commit from add-test-self-verification... * block non-dev pr to main branch * audit fixes (#645) * merge dev branch into main (#624) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> * update contracts (#628) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) * implement self uups upgradeable (#592) * implement self uups upgradeable * small changes in identityVerificationHubImplV2 * delete aderyn.toml * chore: add custom verifier * chnage return output * feat: use self structs and a Generic output struct * feat: add userIdentifier, nullifier, forbiddencountries to returned output * add root view functions from registry * fix: build and compilation errors * add userDefined data into selfVerificationRoot * "resolve conflicts" * fix compilation problem * fix how to register verification config * test: CustomVerifier * fix verification root and hub integration * add scope check in hub impl * replace poseidon hash to ripemd+sha256 * add todo list * feat: refactor and add test cases for generic formatter * add performUserIdentifierCheck in basicVerification * change how to handle additionalData and fix stack too deep * start adding test codes * fix dependency problems in monorepo * fix: forbidden countries (#612) LGTM! * able to run test code * pass happy path * delete unused codes * change error code name, add caller address validation and add scripts to run test and build in monorepo * add all test cases in vcAndDisclose flow * remove comment out * chore: use actual user identifier outputs * success in registration tests * cover all cases * pass contractVersion instead of circuitVersion * fix disclose test * chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter * change val name and remove unused lines * add val name change * remove userIdentifier from return data * feat: use GenericDiscloseOutput struct in verfication hook fix test cases for user identifier * chore: change the function order for Hub Impl V2 (#625) * fix nat specs * add nat spec in SelfStructs --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Nesopie <[email protected]> * prettier (#629) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> Co-authored-by: Nesopie <[email protected]> * fix: vc_and_disclose_id test (#640) * fix: vc_and_disclose_id test * chore: yarn prettier * fix: check if a config id exists * chore: change the function where the config not set verification is happening * fix: add await * feat: add getConfigId function in SelfVerificationRoot (#650) * feat: add getConfigId function in SelfVerificationRoot * update comment --------- Co-authored-by: motemotech <[email protected]> * chore: fix ofac end index in eu id cards * chore: fix tests * fix: example contracts and tests --------- Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> * Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658) * publish npm-package (#651) * App/eu id updates (#638) * fix build issues * generate disclosure proof with euids * generate disclosure proof with euids * Eu id updates 2 (#648) * update vc_and_disclose_id test (dev branch) (#641) * fix: vc_and_disclose_id test * chore: yarn prettier * Show modal on NFC scan error (#642) * Add help button and error modal actions * fix the screen management * yarn nice * Bump build v2.5.4: ios 132; android 71 (#631) * bump version and build numbers * remove tamagui/toast * fix marketing version * fix: update TD1 and TD3 checks (#643) * bum yarn.lock * add version and user defined data --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> * remove the mock user define data * get the useridentifier as a hash from the user defined data * chore: add version and userDefinedData * feat: use the version in register / dsc proofs as well * update calculateUserIdentifierHash * yarn nice * refactor: consolidate user context data handling and update payload structure * fix typing issues on sha1 * remove console.log(sha1) * fix sha1 import * refactor: streamline userDefinedData handling and adjust payload type for circuit * refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash * yarn nice * yarn lint common * use ts-ignore for sha1 import * fix app ci tests * fix typing issue * remove unused ts-ignore * cast uuid before calling generateinputs * bump qrcode version * add tsup on the qrcode sdk * fix: exports on selfxyz/qrcode * update how we define config.version * fix yarn imports * yarn format --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Ayman <[email protected]> * Hotfix contract compile error (#660) * Fix previous rebase error * Refactor deployment module for Identity Verification Hub V2. * Fix/sdk (#652) * fix: sdk build configs * chore: SelfBackendVerifier (WIP) * feat: add custom verification * feat: consider destination chain in user defined data * chore: export attestation id * chore: export attestation id * chore: export config storage * chore: don't throw an error if the proof is not valid * chore: trim abi and rm typechain types * refactor * chore: rm unnecessary exports * 📝 Add docstrings to `fix/sdk` (#653) Docstrings generation was requested by @remicolin. * https://github.com/selfxyz/self/pull/652#issuecomment-2992046545 The following files were modified: * `sdk/core/src/utils/hash.ts` * `sdk/core/src/utils/proof.ts` * `sdk/core/src/utils/utils.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * review fixes * chore: fix package.json cjs types * chore: add minor changes to checks * feat: add InMemoryConfigStore, allIds constant and verificationResult type * chore: export Verification config * feat: change the verification config types * fix: throw issues early if verification config is null * fix: update yarn.lock file * chore: lint * fix: rm ts expect error directive * fix: contract tests * use excluded countries instead forbidden countries list * chore: change types in constnats --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update npm-publish workflow and bump core package version to 1.0.0 (#661) * update import * Update get verification config visibility (#664) * Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands. * Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment. * Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access. * Apply BUSL v1.1 license headers to app (#665) * Add BSL license headers to app sources * prettier * fix license reference - https://spdx.org/licenses/BUSL-1.1.html * bump build: android 73 (#659) * Contracts/deploy staging (#668) * update scripts * deploy vc and disclose id * fix the deployment scripts on staging * update yarn.lock * bump ios build and version (#669) * configure coderabbitai (#670) * tweak coderabbit * bump * more thorough test spec * Apply BSL to app codebase (#639) * Clean up root license wording * Simplify SPDX header * simplify license and rename BSL to BUSL * fix merge issues * fix missing method --------- Co-authored-by: Justin Hernandez <[email protected]> * SEL-423 apply xcode build suggestions (#671) * apply recommended app settings from xcode * stick to portrait orientation and update target settings * remove app clip references * Circuit audit fixes (#644) * feat: add range checks before use of LessEqThan and SelectSubArray * fix: Num2Bits_strict to constrain virtualKey * bump core version * bump core version and fix ci * chore: use npm_auth_token in yarnrc * chroe: rm yarnrc changes * chore: update npm publish * chore: run npm publish manually * chore: change hub contract address (#675) * Update npm-publish.yml * chore: use proper secret when publishing * feat: enable publishing if workflow was triggered manually * Contracts/update verifier (#673) * update hardhat config * update vc and disclose verifier * update vc and disclose verifier script and run it * update test self verification root * update verifier * bump sdk version and use new hub address * chore: update zk-kit binary merkle root dep (#674) * refactor deployment scripts (#678) * feat: add register eu id instances (#682) * feat: add register eu id instances * feat: add new instances * chore: update scripts * chore: fix sig alg * chore: rm circuits --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> Co-authored-by: Nesopie <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Kevin Lin <[email protected]> Co-authored-by: kevinsslin <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Eric Nakagawa <[email protected]> * fix: commitment hash * fix: register aadhaar test * chore: refactor * feat: reveal data in packed bytes * feat: add constrain on delimiterIndices * feat: reveal timestamp * merge main to feat/aadhaar * fix: tests * feat: hash pubKey * feat: add registry contract * feat: Update HubImplV2 (WIP) * add functions to generate aadhaar data (WIP) * modularize aadhaar data generation (WIP) * fix(wip): register test * fix: test qr extractor * fix * chore: refactor functions * feat: add age extractor and tested * feat: add isMiniumAge check * fix: prepareAadhaarTestData func * registry contract tests * feat: registry contract tests * feat: extract fields from qr data bytes * chore: refactor mockData * feat: move minimum age to revealPackedData * feat: create a constant.ts to retrive fields from unpacked bytes * chore: refactor * fix: exports * rebase * rebase * feat: add public signal ,indices mapping * chore: add public output to indices mapping * fix:AADHAAR_PUBLIC_SIGNAL_INDICES * feat: make nullifier public * fix: nullifier cal for disclose circuits * feat: merge isMiniumAgeValid and miniumAge signal * fix: disclsoe test * feat: support for user identifier and secret * chore :refactor * feat: ofac test last name , firstname * feat: add forbidden_countries_list check * feat: add tests for aadhaar (WIP) * failing ofac tests * feat: finish contract tests * fix: merge conflicts * update the common package to be usable in circuits and contracts * lint everything * coderabbit fixes * chore: update name dob,yob aadhaar ofac tree * feat: merge ofac and reverse ofac check into one * test: merged ofac constrain * SELF-253 feat: add user email feedback (#889) * feat: add sentry feedback * add sentry feedback to web * feat: add custom feedback modal & fix freeze on IOS * yarn nice * update lock * feat: show feedback widget on NFC scan issues (#948) * feat: show feedback widget on NFC scan issues * fix ref * clean up * fix report issue screen * abstract send user feedback email logic * fixes * change text to Report Issue * sanitize email and track event messge * remove unnecessary sanitization * add sanitize error message tests * fix tests * save wip. almost done * fix screen test * fix screen test * remove non working test --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> * chore: centralize license header checks (#952) * chore: centralize license header scripts * chore: run license header checks from root * add header to other files * add header to bundle * add migration script and update check license headers * convert license to mobile sdk * migrate license headers * remove headers from common; convert remaining * fix headers * add license header checks * update unsupported passport screen (#953) * update unsupported passport screen * yarn nice * feat: support new ofac trees * fix: qr extractor tests * chore: remove unassigned age signal * chore: modify timestamp func comment * fix: add constrain on photo bytes delimiter * fix: add range check on minimumAge within 2^7 * fix: range check for country not in list * chore: remove dummy constrain * fix: assert lessthan * fix: check is photoEOI valid * fix: replace maxDataLength with qrPaddedLength for valid del indices * feat: update forbidden countries in disclose and disclose id * feat: convert name to uppercase * fix: add constrain between delimiter and photoEOI * feat: support for phno len 4 and 10 * chore: hard-code attestaion_ID to 3 * feat: calculate nullifier using uppercase name * feat: add real id support * fix: rebase error * chore: refactor * add new nullifier and commitment calc * fix: reuse uppercase name from verify commitment * feat: add a function that will iterate though all pubkeys * chore: skip real id test * chore: yarn format * chore: update yarn.lock * chore: rm trailing / from import * chore: add support for issuing state * chore: linting and types * chore: rm types script from circuits * chore: add license header --------- Co-authored-by: nicoshark <[email protected]> Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: turboblitz <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: crStiv <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: James Niken <[email protected]> Co-authored-by: Kevin Lin <[email protected]> Co-authored-by: leopardracer <[email protected]> Co-authored-by: Olof Andersson <[email protected]> Co-authored-by: vishal <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: kevinsslin <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Eric Nakagawa <[email protected]> * fix: CLA not supported (#1027) * fix: CLA not supported * fix "yarn android" building * remove unnecessary commands --------- Co-authored-by: Justin Hernandez <[email protected]> * chore: bump app version v2.6.5 (#1034) * update gem lock * bump build and version * fix app versions * chore: fix nfc passport reader private repo access (#1042) * add internal repo pat * update nfc passport reader location * update workflows to use PAT to access NFC Passport Reader * fix ci * update logic to access private repo * build(android): support 16KB page size (#1043) * build(android): support 16KB page size * fix 16kb * update lock * chore: bump v2.6.5 for release (#1036) * bump build * update to ssh clone to fix local build * update podfile lock * fix version * Feat/build aadhaar (#1044) * feat: build aadhaar circuits as well in the ci * feat: add register aadhaar case handling * fix aadhaar register output after building the cpp circuit (#1045) * fix: metro js crypto module build issues (#1047) * fix sdk build issues * fix build error * sort and fix dependencies * add constants-browserify * feat: add new verifiers (#1049) * feat: add new verifiers * format: contracts * fix: ofac check to aadhaar (#1050) * fix: hub-v2 (#1051) * Add DisclosureVerified event for comprehensive verification tracking (#945) * Add VerificationPerformed event to track verification calls - Added VerificationPerformed event with comprehensive tracking fields - Captures requestor contract, version, attestation ID, chain ID, config ID, user identifier, output, and user data - Enhanced _executeVerificationFlow to return additional tracking data - Event emission placed after verification completion for accurate tracking * chore: run formatter * chore: rename verify event name to DisclosureVerified * move clearPassportData, markCurrentDocumentAsRegistered, reStorePassportDataWithRightCSCA to SDK (#1041) * Move self app store to mobile sdk (#1040) * chore(mobile-sdk-alpha): remove unused tslib dependency (#1053) * remove tslib -- seems unused * remove deps accidentally added to root * build file * remove unused imports (#1055) * fix: sha256 signed attr tests (#1058) * fix mock screen launch (#1059) * Hotfix: Belgium ID cards (#1061) * feat: parse belgium TD1 mrz android * feat: Parse Belgium TD1 MRZ IOS * fix: OFAC trees not found (#1060) * fix: relax OFAC tree response validation * test: cover OFAC tree edge cases * fix stateless * revert and fix types * fix tests * [SELF-723] feat: add structured NFC and Proof logging (#1048) * feat: add structured NFC logging * fix ci * Fix: add deps * logging fixes. use breadcrumbs * fix android build * update SeverityLevel * [SELF-705] feat: add proof event logging (#1057) * feat: add proof event logging * refactor: unify sentry event logging * fix types * fix mock * simplify * code rabbit feedback * fix tests --------- Co-authored-by: seshanthS <[email protected]> * skip on dev (#1063) * don't get fancy just disable (#1064) * saw it building so gonna try (#1065) * Dev (#1074) * chore: bump v2.6.5 rd2 (#1067) * commit wip version bump * remove from building * chore: update tooling dependencies (#1069) * chore: update tooling dependencies * chore: align react typings and node types * update lock * chore: minor fixes across monorepo (#1068) * small fixes * fixes * fix gesture handler error * ci fixes * fix yarn build; add workflow ci (#1075) * add new workspace ci * disable package version check for now * build before checks * format * fix in future pr * feat: add functions for disclosing aadhaar attributes (#1033) * feat: add functions for disclosing aadhaar attributes * format * chore: update monorepo artifacts (#1079) * remove unneeded artifacts, skip building circuits * update md files * cleans up unused parts of sdk interface, adds inline documentation, (#1078) * cleans up unused parts of sdk interface, adds inline documentation, * fix up build * yolo * Feat/aadhaar sdk (#1082) * feat: add aadhaar support to the ts sdk * feat: aadhaar support to go sdk * chore: refactor * move clearPassportData, markCurrentDocumentAsRegistered, reStorePassportDataWithRightCSCA to SDK (#1041) * Move self app store to mobile sdk (#1040) * chore(mobile-sdk-alpha): remove unused tslib dependency (#1053) * remove tslib -- seems unused * remove deps accidentally added to root * build file * remove unused imports (#1055) * fix: sha256 signed attr tests (#1058) * fix mock screen launch (#1059) * Hotfix: Belgium ID cards (#1061) * feat: parse belgium TD1 mrz android * feat: Parse Belgium TD1 MRZ IOS * fix: OFAC trees not found (#1060) * fix: relax OFAC tree response validation * test: cover OFAC tree edge cases * fix stateless * revert and fix types * fix tests * [SELF-723] feat: add structured NFC and Proof logging (#1048) * feat: add structured NFC logging * fix ci * Fix: add deps * logging fixes. use breadcrumbs * fix android build * update SeverityLevel * [SELF-705] feat: add proof event logging (#1057) * feat: add proof event logging * refactor: unify sentry event logging * fix types * fix mock * simplify * code rabbit feedback * fix tests --------- Co-authored-by: seshanthS <[email protected]> * skip on dev (#1063) * don't get fancy just disable (#1064) * saw it building so gonna try (#1065) * chore: bump v2.6.5 rd2 (#1067) * commit wip version bump * remove from building * chore: update tooling dependencies (#1069) * chore: update tooling dependencies * chore: align react typings and node types * update lock * chore: minor fixes across monorepo (#1068) * small fixes * fixes * fix gesture handler error * ci fixes * fix yarn build; add workflow ci (#1075) * add new workspace ci * disable package version check for now * build before checks * format * fix in future pr * feat: add functions for disclosing aadhaar attributes (#1033) * feat: add functions for disclosing aadhaar attributes * format * chore: update monorepo artifacts (#1079) * remove unneeded artifacts, skip building circuits * update md files * chore: update hub contract address * format * fix: add aadhaar in AllIds * chore: bump to v1.1.0-beta --------- Co-authored-by: vishal <[email protected]> Co-authored-by: Leszek Stachowski <[email protected]> Co-authored-by: Aaron DeRuvo <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: seshanthS <[email protected]> * feat: change to gcp attestation verification (#959) * feat: change to gcp attestation verification * lint * fix e2e test * chore: don't check PCR0 mapping if building the app locally * fmt:fix --------- Co-authored-by: Justin Hernandez <[email protected]> * Mobile SDK: move provingMachine from the app (#1052) * Mobile SDK: move provingMachine from the app * lint, fixes * fix web build? * lint * fix metro build, add deps * update lock files * move the status handlers and proving machine tests * may it be * fix up * yolo --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Aaron DeRuvo <[email protected]> * Revert "Mobile SDK: move provingMachine from the app (#1052)" (#1084) This reverts commit 8983ac22688f731bca8890cbf9be9c85b4ac2bf…
Summary
lazyWithPreloadhelper andDEBUG_SCREENsupport for easier screen debuggingTesting
yarn workspaces foreach -A -p -v --topological-dev --since=HEAD run nice --if-present(fails: Invalid option schema)yarn nice(fails: script not found)yarn lint(fails: unresolved modules and import errors)yarn buildyarn workspace @selfxyz/contracts build(fails: Invalid account config)yarn types(fails: Cannot find module 'react-native-svg-circle-country-flags')yarn test(fails: 3 failed suites)https://chatgpt.com/codex/tasks/task_b_68b29ad8a9b8832d97fb93df6c5ac538
Summary by CodeRabbit
New Features
Refactor
Documentation
Chores