Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Jan 6, 2026

Description

A brief description of the changes, what and how is being changed.

Tested

Explain how the change has been tested (for example by manual testing, unit tests etc) or why it's not necessary (for example version bump).

How to QA

How can the change be tested in a repeatable manner?

Summary by CodeRabbit

Release Notes

  • New Features

    • Added document selection interface for choosing which ID to use during proof requests.
    • Introduced Proof Settings in account preferences to configure document selection behavior.
    • Enhanced proof request flow with improved UI for wallet address display and management.
    • Added automatic document validation to detect and handle expired documents.
  • Tests

    • Added comprehensive test coverage for new proof request components and workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Warning

Rate limit exceeded

@transphorm has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0953717 and 2526ac2.

📒 Files selected for processing (4)
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📝 Walkthrough

Walkthrough

This PR introduces a document selection flow with a redesigned proof request UI. It adds new navigation routes (ProvingScreenRouter, DocumentSelectorForProving, ProofSettings), UI components for document and wallet selection, document validation utilities to the mobile SDK, and comprehensive test coverage.

Changes

Cohort / File(s) Summary
Proof Request UI Components
app/src/components/proof-request/BottomActionBar.tsx, BottomVerifyBar.tsx, ConnectedWalletBadge.tsx, DisclosureItem.tsx, ProofMetadataBar.tsx, ProofRequestCard.tsx, ProofRequestHeader.tsx, WalletAddressModal.tsx, designTokens.ts, icons.tsx, index.ts
New modular UI components for proof request flow, including action bars, wallet badge with address modal, disclosure items, metadata display, and custom icon library. Design tokens and barrel export consolidate the API.
Document Selection Components
app/src/components/documents/IDSelectorItem.tsx, IDSelectorSheet.tsx, index.ts
New component library for document selection with active/disabled/verified states, radio-style selection indicator, and sheet-based modal interface.
Navigation Routes & Configuration
app/src/navigation/index.tsx, account.ts, verification.ts, deeplinks.ts
Added three new routes (ProvingScreenRouter, DocumentSelectorForProving, ProofSettings) with parameters; updated deeplinks to use ProvingScreenRouter; shared header options for proof request screens.
Screen Implementations
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx, ProvingScreenRouter.tsx, app/src/screens/account/settings/ProofSettingsScreen.tsx
New screens orchestrating document selection flow with catalog loading, state management, error handling, and auto-selection logic; settings screen with toggle controls.
Hooks & Utilities
app/src/hooks/useSelfAppData.ts, useSelfAppStalenessCheck.ts, app/src/utils/disclosureUtils.ts, documentUtils.ts
New hooks for memoized SelfApp data derivation and staleness detection; utilities for ordered disclosure formatting and document type display names.
Mobile SDK Enhancements
packages/mobile-sdk-alpha/src/documents/validation.ts, src/constants/colors.ts, src/index.ts, src/constants/index.ts
Document validation utilities (expiry check, attributes extraction, validity assessment, best-document selection); new color constants (green600, iosSeparator).
Navigation Target Updates
app/src/components/navbar/HomeNavBar.tsx, app/src/hooks/useEarnPointsFlow.ts, app/src/screens/verification/QRCodeViewFinderScreen.tsx
Changed navigation targets from 'Prove' to 'ProvingScreenRouter' in multiple entry points (home, earn-points flow, QR scanning).
Test Infrastructure & Mocks
app/jest.setup.js, app/tests/__setup__/mocks/ui.js, app/tests/__setup__/mocks/navigation.js
Enhanced React Native/Mobile SDK mocks (Pressable, Dimensions, useColorScheme, icons, UI components); improved useFocusEffect mock to prevent repeated invocations.
Test Suites
app/tests/src/components/documents/IDSelectorSheet.test.tsx, app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx, ProvingScreenRouter.test.tsx, app/tests/src/navigation.test.tsx, app/tests/src/hooks/useEarnPointsFlow.test.ts, app/tests/src/navigation/deeplinks.test.ts
Comprehensive unit tests for new components, screens, and navigation flows with mock setup, user interactions, and error path verification.
Existing Component Refactors
app/src/components/navbar/BaseNavBar.tsx, DefaultNavBar.tsx, ProveScreen.tsx, Disclosures.tsx, app/src/screens/account/settings/SettingsScreen.tsx, app/src/stores/settingStore.ts
Navbar color support, header styling consolidation; ProveScreen migrated to ProofRequestCard-based layout with scroll management; Disclosures refactored to use centralized getDisclosureText; settings store extended with skip-selector flags.
Minor Updates
app/src/utils/devUtils.ts, app/src/providers/passportDataProvider.tsx, packages/mobile-sdk-alpha/src/components/buttons/HeldPrimaryButtonProveScreen.tsx, app/src/utils/index.ts
Comment clarification, formatting adjustments, button label update ("Hold to verify" → "Press and hold to verify"), utility barrel export additions.

Sequence Diagram

sequenceDiagram
    participant User
    participant DocumentSelector as DocumentSelectorForProving
    participant Router as ProvingScreenRouter
    participant SDK as Mobile SDK
    participant Store as Settings Store
    participant Proof as ProveScreen

    User->>Router: Navigate (QR/Home)
    Router->>SDK: Load document catalog & documents
    SDK-->>Router: Return documents
    Router->>Store: Check skip settings
    Store-->>Router: skipDocumentSelector, skipDocumentSelectorIfSingle
    alt Skip enabled & single doc valid
        Router->>SDK: Select best document
        Router->>Proof: Navigate to Prove
    else Skip enabled & multiple docs
        Router->>DocumentSelector: Navigate with documentType
    else Skip disabled
        Router->>DocumentSelector: Navigate with documentType
    end
    DocumentSelector->>SDK: Validate document expiry
    SDK-->>DocumentSelector: isDocumentValidForProving
    User->>DocumentSelector: Select document & Approve
    DocumentSelector->>SDK: Validate selection
    SDK-->>DocumentSelector: Document attributes
    DocumentSelector->>Proof: Navigate with scrollOffset
    Proof->>User: Display proof request
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • shazarre
  • aaronmgdr

Poem

📋 Select thy document with grace,
Stack routes through proving's space,
SDK validates with care,
New UI components declare—
Proof request flow now shines so bright! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description consists entirely of empty template placeholders with no actual content filled in for Description, Tested, or How to QA sections. Please provide a substantive description explaining what was changed and why, describe the testing approach used, and include clear QA steps for validating the changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main objective: implementing selective disclosure on the Proving Screen, which aligns with the substantial UI and logic changes evident in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@transphorm transphorm changed the title add document selector test screen SELF-1754: Implement selective disclosure on Proving Screen Jan 6, 2026
@shazarre
Copy link
Collaborator

shazarre commented Jan 7, 2026

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @app/src/components/documents/IDSelectorSheet.tsx:
- Around line 91-98: The XStack used for the close button may not reliably
handle touch events; replace the pressable container with a proper touch
component: wrap the icon X with a Pressable (or Tamagui Button with unstyled)
and move onPress={onDismiss}, hitSlop and testID onto that Pressable/Button;
keep the same padding and children (X) and preserve testID
`${testID}-close-button` and icon props (color={slate500} size={24}) so the
visual and identifiers remain unchanged.
🧹 Nitpick comments (9)
app/tests/src/components/documents/IDSelectorSheet.test.tsx (1)

1-243: LGTM! Solid test coverage for ID selector components.

The test suite provides good coverage of rendering, interaction, and state management for both IDSelectorItem and IDSelectorSheet components. The tests properly use:

  • ES6 imports (no require() calls)
  • Synthetic test data (no real PII)
  • Proper cleanup with beforeEach
  • testID pattern for element selection
  • Callback verification with correct parameters

Optional enhancement: Consider adding edge case tests.

While the current test coverage is solid, you might consider adding tests for:

  • Disabled state behavior (verifying onPress is not called)
  • Subtitle display in IDSelectorItem
  • Accessibility features (e.g., screen reader labels)

These are nice-to-have improvements that can be deferred if needed.

app/src/components/documents/IDSelectorItem.tsx (2)

9-14: Duplicate color definitions.

green500 and red500 are defined locally (lines 30-31) but could be imported from @selfxyz/mobile-sdk-alpha/constants/colors like the other colors. This ensures consistency and single source of truth.

♻️ Suggested fix
 import {
   black,
+  green500,
+  red500,
   slate300,
   slate500,
 } from '@selfxyz/mobile-sdk-alpha/constants/colors';
 import { dinot } from '@selfxyz/mobile-sdk-alpha/constants/fonts';
 
 // ... interfaces ...

-const green500 = '#22C55E';
-const red500 = '#EF4444';

Also applies to: 30-31


78-82: Consider adding accessibility properties.

For screen reader support, the Pressable should include accessibilityLabel and accessibilityRole="radio" to properly convey the selection behavior to users with assistive technologies.

♻️ Suggested accessibility enhancement
       <Pressable
         onPress={isDisabled ? undefined : onPress}
         disabled={isDisabled}
         testID={testID}
+        accessibilityLabel={`${documentName}, ${subtitleText}`}
+        accessibilityRole="radio"
+        accessibilityState={{ selected: isActive, disabled: isDisabled }}
       >
app/src/components/documents/IDSelectorSheet.tsx (2)

104-125: Consider handling the empty documents case.

When documents is empty, the list renders nothing. Adding an empty state message would improve UX and help users understand why no options are shown.

♻️ Suggested empty state
           <ScrollView
             flex={1}
             showsVerticalScrollIndicator={false}
             testID={`${testID}-list`}
           >
+            {documents.length === 0 && (
+              <Text
+                fontFamily={dinot}
+                fontSize={14}
+                color={slate500}
+                textAlign="center"
+                paddingVertical="$4"
+              >
+                No documents available
+              </Text>
+            )}
             {documents.map(doc => {

148-164: Consider disabling Approve when no document is selected.

The Approve button is always enabled. If selectedId is undefined, tapping Approve may not produce meaningful behavior. Consider disabling the button until a selection is made.

♻️ Optional: disable when no selection
             <Button
               flex={1}
               backgroundColor={blue600}
               borderRadius={8}
               paddingVertical={16}
               onPress={onApprove}
               testID={`${testID}-approve-button`}
+              disabled={!selectedId}
+              opacity={selectedId ? 1 : 0.5}
             >
app/src/screens/dev/IDSelectorTestScreen.tsx (4)

131-147: Add cleanup to prevent state updates after unmount.

If the component unmounts while loadRealDocuments is in flight, the setDocumentCatalog, setAllDocuments, and setLoading calls will warn about updating unmounted components. Consider using an abort flag or cleanup pattern.

♻️ Suggested cleanup pattern
   const loadRealDocuments = useCallback(async () => {
+    let cancelled = false;
     setLoading(true);
     try {
       const catalog = await loadDocumentCatalog();
       const docs = await getAllDocuments();
+      if (cancelled) return;
       setDocumentCatalog(catalog);
       setAllDocuments(docs);

       // Set selected to match catalog's selected
       if (catalog.selectedDocumentId) {
         setSelectedId(catalog.selectedDocumentId);
       }
     } catch (error) {
-      console.warn('Failed to load documents:', error);
+      if (!cancelled) {
+        console.warn('Failed to load documents:', error);
+      }
     }
-    setLoading(false);
+    if (!cancelled) {
+      setLoading(false);
+    }
+    return () => { cancelled = true; };
   }, [loadDocumentCatalog, getAllDocuments]);

Note: You'd then need to use the cleanup in the effects:

useFocusEffect(
  useCallback(() => {
    let cleanup: (() => void) | undefined;
    if (!useMockData) {
      cleanup = loadRealDocuments();
    }
    return () => cleanup?.();
  }, [useMockData, loadRealDocuments]),
);

149-165: Consider debouncing or deduplicating document loads.

Both useFocusEffect (line 150) and the mode toggle useEffect (line 159) can trigger loadRealDocuments. When switching to real mode while the screen is focused, both effects may fire. For a dev screen this is acceptable, but in production you may want to deduplicate these calls.


204-212: Mock mode dismiss resets to first document instead of previous selection.

In mock mode, handleDismiss always resets selectedId to MOCK_DOCUMENTS[0].id rather than preserving the user's previous selection before opening the sheet. Consider tracking the selection state before opening the sheet if you want to preserve it on dismiss.


189-202: Consider user feedback on approval failure.

When setSelectedDocument fails (line 198-199), the error is only logged to console. For better UX, consider showing a toast or alert so the user knows the action failed.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43fb39d and f43a22c.

📒 Files selected for processing (9)
  • app/jest.setup.js
  • app/src/components/documents/IDSelectorItem.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/tests/src/navigation.test.tsx
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/jest.setup.js
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
  • app/src/components/documents/IDSelectorItem.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/jest.setup.js
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
  • app/src/components/documents/IDSelectorItem.tsx
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.test.{ts,tsx,js,jsx}: Use renderHook for testing custom React hooks instead of rendering components.
Mock console.error in tests to avoid test output clutter while testing error scenarios.
Test error boundaries and recovery mechanisms in React components.
Mock SQLite operations with executeSql method in database tests using utilities from tests/__setup__/databaseMocks.ts.

**/*.test.{ts,tsx,js,jsx}: Never use require('react-native') in test files; use ES6 import statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines
Never use require('react') in test files; use ES6 import React from 'react' instead to avoid nested require() calls that cause out-of-memory errors

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/tests/src/navigation.test.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Implement comprehensive error boundaries in React components.

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/src/navigation.test.tsx
  • app/src/components/documents/IDSelectorItem.tsx
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/jest.setup.js
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
  • app/src/components/documents/IDSelectorItem.tsx
**/{mobile,client,app,time,verification}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use server-signed time tokens or chain block timestamps for trusted time in mobile clients, do not trust device wall-clock alone

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/jest.setup.js
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
  • app/src/components/documents/IDSelectorItem.tsx
**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}: Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Achieve proof generation in <60 seconds on mid-tier mobile devices

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/jest.setup.js
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
  • app/src/components/documents/IDSelectorItem.tsx
{app,packages/mobile-sdk-alpha}/**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never create nested require('react-native') calls in tests as this causes out-of-memory errors in CI/CD pipelines; use ES6 import statements instead and avoid dynamic require() calls in beforeEach/afterEach hooks

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/tests/src/navigation.test.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn types passes (TypeScript validation) before creating a PR

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
  • app/src/components/documents/IDSelectorItem.tsx
app/**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.test.{ts,tsx,js,jsx}: Ensure yarn test passes (unit tests) before creating a PR
Avoid nested require('react') or require('react-native') calls in test files - use ES6 import statements instead
Put all imports at the top of test files - avoid dynamic imports in hooks
Never use require() calls in beforeEach/afterEach hooks in test files
Verify no memory leaks introduced, including test memory patterns
Use ES6 import statements exclusively - never use require('react') or require('react-native') in test files

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/tests/src/navigation.test.tsx
app/tests/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Do not create nested require('react-native') calls in tests - causes OOM in CI

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/tests/src/navigation.test.tsx
app/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{ts,tsx,js,jsx}: Ensure web build succeeds with yarn web before creating a PR
Do not include sensitive data in logs - avoid logging PII, credentials, and tokens
Use react-native-dotenv for environment configuration via @env import
Confirm no sensitive data exposed before PR merge

Files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/jest.setup.js
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/__setup__/mocks/ui.js
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
  • app/src/components/documents/IDSelectorItem.tsx
**/*.{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/components/documents/IDSelectorSheet.test.tsx
  • app/tests/src/navigation.test.tsx
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/components/documents/IDSelectorSheet.tsx
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/src/components/documents/index.ts
  • app/src/navigation/devTools.ts
  • app/src/components/documents/IDSelectorItem.tsx
**/jest.setup.{js,cjs}

📄 CodeRabbit inference engine (.cursor/rules/test-memory-optimization.mdc)

Only use require() calls in Jest setup files (jest.setup.js) for one-time module mocking and initialization; never create nested require() calls within test execution contexts

Files:

  • app/jest.setup.js
🧠 Learnings (28)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Flag security-sensitive operations in PR descriptions for review
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test `isPassportDataValid()` with realistic, synthetic passport data (never use real user data)
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Organize screens by feature modules (passport, home, settings, etc.) with navigation defined in separate files.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to jest.setup.js : Implement comprehensive mocks in `jest.setup.js` for all native modules including Firebase, Keychain, NFC, Analytics, and third-party modules.
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test `isPassportDataValid()` with realistic, synthetic passport data (never use real user data)

Applied to files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/screens/dev/IDSelectorTestScreen.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Verify no memory leaks introduced, including test memory patterns

Applied to files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Verify `extractMRZInfo()` using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/src/screens/dev/IDSelectorTestScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Write integration tests that exercise real validation logic from the SDK

Applied to files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : React Native is mocked in `tests/setup.ts` using `vi.mock()` - use imports in test files instead of require()

Applied to files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/jest.setup.js
  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/__setup__/mocks/ui.js
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Use setup file mocks for React Native (jest.setup.js for Jest or tests/setup.ts for Vitest) which run once during test initialization, allowing test files to safely import mocked React Native modules without causing nested require() issues

Applied to files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/jest.setup.js
  • app/src/screens/dev/IDSelectorTestScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Avoid mocking the entire package in Jest setup or replacing real functions with mock implementations

Applied to files:

  • app/tests/src/components/documents/IDSelectorSheet.test.tsx
  • app/jest.setup.js
  • app/tests/__setup__/mocks/ui.js
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to jest.setup.js : Implement comprehensive mocks in `jest.setup.js` for all native modules including Firebase, Keychain, NFC, Analytics, and third-party modules.

Applied to files:

  • app/jest.setup.js
  • app/tests/__setup__/mocks/ui.js
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/tests/setup.ts : Use `vi.mock()` instead of `require()` calls in Vitest setup files; ensure React Native mocks are established once at setup time, not during test execution

Applied to files:

  • app/jest.setup.js
  • app/tests/__setup__/mocks/ui.js
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use real imports from `selfxyz/mobile-sdk-alpha` in tests instead of mocking the entire package

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/src/navigation/devTools.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Never use real user PII (personally identifiable information) in tests - use only synthetic, anonymized, or approved test vectors

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/tests/src/navigation.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Ensure no breaking changes to public API or document them properly

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Prefer top-level imports over nested requires in test files

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/src/navigation/devTools.ts
  • app/tests/src/navigation.test.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement lazy loading for screens using `React.lazy()` in React Native applications.

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/src/navigation/devTools.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Organize screens by feature modules (passport, home, settings, etc.) with navigation defined in separate files.

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
  • app/src/navigation/devTools.ts
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement custom modal system with `useModal` hook and callback registry in React Native.

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
📚 Learning: 2025-12-13T18:00:46.963Z
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.

Applied to files:

  • app/src/screens/dev/IDSelectorTestScreen.tsx
📚 Learning: 2025-08-26T14:41:41.821Z
Learnt from: shazarre
Repo: selfxyz/self PR: 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/screens/dev/IDSelectorTestScreen.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Document complex native module changes in PRs

Applied to files:

  • app/src/components/documents/index.ts
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
Repo: selfxyz/self PR: 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/devTools.ts
📚 Learning: 2025-08-25T14:25:57.586Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.586Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.

Applied to files:

  • app/src/navigation/devTools.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use ES6 `import` statements instead of `require()` when possible

Applied to files:

  • app/src/navigation/devTools.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `@/` alias for src imports and `tests/` alias for test imports in TypeScript/JavaScript files.

Applied to files:

  • app/src/navigation/devTools.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Lazy load screens and components to optimize bundle size in React Native.

Applied to files:

  • app/src/navigation/devTools.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.

Applied to files:

  • app/src/navigation/devTools.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Tamagui for UI components in React Native applications.

Applied to files:

  • app/src/components/documents/IDSelectorItem.tsx
🧬 Code graph analysis (3)
app/src/components/documents/IDSelectorSheet.tsx (2)
app/src/components/documents/IDSelectorItem.tsx (2)
  • IDSelectorState (24-28)
  • IDSelectorItem (63-126)
packages/mobile-sdk-alpha/src/constants/colors.ts (5)
  • white (59-59)
  • black (8-8)
  • slate500 (43-43)
  • slate300 (37-37)
  • blue600 (10-10)
app/src/screens/dev/IDSelectorTestScreen.tsx (8)
app/src/components/documents/IDSelectorSheet.tsx (2)
  • IDSelectorDocument (28-32)
  • IDSelectorSheet (45-170)
app/src/components/documents/index.ts (3)
  • IDSelectorDocument (6-6)
  • IDSelectorState (12-12)
  • IDSelectorSheet (15-15)
app/scripts/analyze-tree-shaking.cjs (1)
  • category (50-50)
app/src/components/documents/IDSelectorItem.tsx (1)
  • IDSelectorState (24-28)
app/src/utils/documentAttributes.ts (2)
  • getDocumentAttributes (193-214)
  • checkDocumentExpiration (37-62)
app/src/providers/passportDataProvider.tsx (2)
  • usePassport (861-863)
  • setSelectedDocument (764-774)
app/tests/__setup__/mocks/ui.js (8)
  • YStack (84-84)
  • ScrollView (88-88)
  • Text (54-54)
  • Text (86-86)
  • XStack (51-51)
  • XStack (83-83)
  • Button (40-48)
  • Button (82-82)
packages/mobile-sdk-alpha/src/constants/colors.ts (6)
  • slate50 (41-41)
  • black (8-8)
  • white (59-59)
  • slate300 (37-37)
  • slate500 (43-43)
  • blue600 (10-10)
app/src/components/documents/IDSelectorItem.tsx (1)
packages/mobile-sdk-alpha/src/constants/colors.ts (5)
  • green500 (21-21)
  • red500 (27-27)
  • slate500 (43-43)
  • black (8-8)
  • slate300 (37-37)
🔇 Additional comments (8)
app/jest.setup.js (1)

142-142: LGTM!

The Pressable mock addition follows the established pattern for React Native component mocks and is necessary for testing components that use Pressable (like the new IDSelectorItem).

app/tests/__setup__/mocks/ui.js (1)

178-180: LGTM!

The additional icon mocks (Check, Circle, ChevronDown) follow the existing pattern and are necessary for testing the new ID selector components.

app/tests/src/navigation.test.tsx (1)

68-68: LGTM!

The addition of 'IDSelectorTest' to the expected navigation screens is correctly placed in alphabetical order and aligns with the new dev screen entry.

app/src/navigation/devTools.ts (2)

16-16: LGTM!

The import follows project conventions using the @/ alias for source imports.


84-90: LGTM!

The navigation entry follows the established pattern for dev screens with appropriate header options and title.

app/src/components/documents/index.ts (1)

1-15: LGTM!

Clean barrel file with proper separation of type-only exports (using export type) and component exports. This structure supports optimal tree-shaking and follows TypeScript best practices.

app/src/screens/dev/IDSelectorTestScreen.tsx (2)

34-56: Well-structured mock data with synthetic documents.

The mock documents use synthetic names and IDs without any real PII, which aligns with testing guidelines. Good coverage of all four states (active, verified, not_accepted, expired).


107-345: Overall implementation looks solid for a dev/test screen.

The screen properly integrates with the passport data provider, handles both mock and real data modes, and provides a good testing harness for the ID selector flow. The component follows React Native patterns and uses proper hooks for lifecycle management.

transphorm and others added 13 commits January 7, 2026 10:03
#1555)

* Add document selector to proving flow

* fix formatting

* improvements

* redirect user to document not found screen when no documents

* option flow tweaks and tests

* wip tweaks

* fix scrollview bottom padding (#1556)

* tighten up selection text

* create inerstitial

* save wip
…osition (#1560)

* Refactor prove screen layout

* fix: amount of hooks rendered needs to be the same for all variants

* long URL ellipsis

* keep titles consistent

* lint

---------

Co-authored-by: Leszek Stachowski <[email protected]>
@transphorm transphorm marked this pull request as ready for review January 8, 2026 17:33
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

🤖 Fix all issues with AI agents
In @app/jest.setup.js:
- Around line 377-383: The arrow function passed to jest.fn uses unnecessary
parentheses around the single parameter; update the get mock from
jest.fn((dimension) => { ... }) to use a concise parameter form
jest.fn(dimension => { ... }) so formatting matches lint rules and resolves the
parentheses static-analysis warning (refer to the get property and the
jest.fn(...) callback).
- Around line 113-121: Prettier complains about unnecessary parentheses around
the single parameter in the mocked Dimensions.get function; update the mock for
"get: jest.fn((dimension) => { ... })" to remove the parentheses so it reads
"get: jest.fn(dimension => { ... })" (leave the body unchanged) and ensure
surrounding mocks addEventListener and removeEventListener remain as-is.
- Around line 282-290: The addEventListener mock includes redundant parentheses
around the returned object; update the mock (the addEventListener: jest.fn(() =>
({ remove: jest.fn() }))) to remove the unnecessary parentheses so it matches
the Prettier-consistent formatting used elsewhere (refer to the addEventListener
mock and the inner remove: jest.fn() symbol).
- Around line 567-577: Remove the duplicate useSafeBottomPadding export from one
of the mocks to avoid inconsistent behavior (keep it only in either
jest.mock('@selfxyz/mobile-sdk-alpha/hooks'...) or
jest.mock('@selfxyz/mobile-sdk-alpha'...), not both), and fix the
indentation/formatting inside the jest.mock('@selfxyz/mobile-sdk-alpha', ...)
block so NFCScannerScreen, SelfClientProvider and useSafeBottomPadding align
consistently with the surrounding object properties; ensure the final mock
object only overrides the specific members needed (e.g., NFCScannerScreen,
SelfClientProvider) and does not re-export useSafeBottomPadding if it is already
provided by the /hooks mock.

In @app/src/components/proof-request/WalletAddressModal.tsx:
- Around line 44-53: The handleCopy callback starts a setTimeout but never
clears it, risking state updates after unmount; modify handleCopy to save the
timer ID (e.g., let timeoutId = window.setTimeout(...)) into a ref (e.g.,
timeoutRef) and add a useEffect cleanup that clears the timeout
(clearTimeout(timeoutRef.current)) when the component unmounts or when
onClose/address change; ensure you null out the ref after clearing and update
dependencies for useCallback/useEffect to avoid leaks.

In @app/src/screens/verification/ProvingScreenRouter.tsx:
- Around line 94-102: The catch block currently logs the full selectError (in
the try around setSelectedDocument and navigation.replace), which may expose
sensitive document data; change the error handling in that catch to avoid
logging error objects or message contents—replace console.error('Failed to
auto-select document:', selectError) with a generic error log (e.g., "Failed to
auto-select document") or a non-sensitive error code/flag, and keep the existing
fallback behavior (reset hasRoutedRef.current = false and
navigation.replace('DocumentSelectorForProving')) so routing still works without
exposing sensitive details.
- Around line 111-120: The catch block currently logs the full loadError (which
may contain sensitive stack traces); change the console.warn in the catch of the
async load routine so it emits a generic message only (e.g., "Failed to load
documents for routing") and does not include loadError details, keep the
existing check for controller.signal.aborted, the setError('Unable to load
documents.') call, and the reset of hasRoutedRef.current = false so behavior is
unchanged except for removing sensitive error payload from logs.

In @app/src/utils/disclosureUtils.ts:
- Around line 9-13: The listToString function uses the wrong conjunction "nor";
update listToString to use "or" (or the appropriate positive conjunction) when
joining items: replace the two-item join in listToString (currently list.join('
nor ')) to use " or ", and replace the final conjunction in the multi-item
branch (currently ' nor ') with " or " so strings read "A or B" and "A, B, or
C"; keep the existing behavior for slicing and joining but substitute the
correct conjunction in both the two-item and last-item cases.

In
@app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx:
- Around line 24-43: The tests currently call jest.requireActual('react') inside
the jest.mock callbacks for useFocusEffect and WalletAddressModal which can
cause OOM in CI; instead remove those nested requireActual calls and either
import React as a top-level ES6 import or construct the minimal mock objects
directly in the mock callbacks (e.g., for useFocusEffect, call the provided
callback via a no-op effect shim; for WalletAddressModal, return a plain
object/component using the provided testID) so that neither jest.mock block
calls jest.requireActual('react') at runtime.

In @packages/mobile-sdk-alpha/src/constants/colors.ts:
- Around line 22-24: Add the two newly defined color constants to the public
re-exports: add "green600" and "iosSeparator" to the export list in the
constants index (the file that re-exports color constants), and add a short
comment next to iosSeparator indicating it is iOS-only/platform-specific; ensure
the identifiers match exactly (green600, iosSeparator) so they become available
via the main constants export.

In @packages/mobile-sdk-alpha/src/index.ts:
- Around line 102-108: The @deprecated JSDoc is incorrectly applied to the
validation exports; remove the deprecation comment from the export block that
exports checkDocumentExpiration, getDocumentAttributes,
isDocumentValidForProving, and pickBestDocumentToSelect so those functions are
exported without deprecation. Then place the @deprecated note only where
extractMRZInfo is exported (e.g., above the export for extractMRZInfo or
alongside createSelfClient().extractMRZInfo / the './mrz' export) so the
deprecation applies solely to extractMRZInfo.
🧹 Nitpick comments (11)
app/src/utils/devUtils.ts (1)

11-11: Consider runtime flag instead of compile-time constant for safer feature rollout.

IS_EUCLID_ENABLED is hardcoded to true, permanently enabling the EUCLID UI redesign for the recovery phrase screen. This works correctly—it cleanly switches between the new RecoveryPhraseScreen component and the legacy ExpandableBottomLayout UI, and it controls header behavior in account navigation.

However, since this is a feature toggle, a runtime flag (e.g., from AsyncStorage or environment config) would allow safer gradual rollout and easier rollback without recompilation if issues are discovered post-deploy. Compile-time constants make this deployment decision permanent.

packages/mobile-sdk-alpha/src/documents/validation.ts (1)

36-39: Consider handling potential NaN from parseInt.

If dateOfExpiry contains non-numeric characters in the expected positions (e.g., "XX1231"), parseInt will return NaN, causing the date comparison to behave unexpectedly.

♻️ Optional defensive improvement
 const year = parseInt(dateOfExpiry.slice(0, 2), 10);
+if (isNaN(year)) return false;
 const fullyear = 2000 + year;
 const month = parseInt(dateOfExpiry.slice(2, 4), 10) - 1;
+if (isNaN(month)) return false;
 const day = parseInt(dateOfExpiry.slice(4, 6), 10);
+if (isNaN(day)) return false;
app/src/screens/account/settings/ProofSettingsScreen.tsx (1)

20-84: Well-structured settings screen with good UX logic.

The component correctly implements the toggle dependency where skipDocumentSelectorIfSingle is disabled when skipDocumentSelector is true (line 70), and the explanatory text at lines 75-80 helps users understand the setting interaction. The testIDs are properly set for testing.

One minor accessibility consideration: the Switch components lack accessibilityLabel props which would help screen reader users understand the toggle purpose.

♿ Optional: Add accessibility labels
 <Switch
   value={skipDocumentSelector}
   onValueChange={setSkipDocumentSelector}
   trackColor={{ false: slate200, true: blue600 }}
   thumbColor={white}
   testID="skip-document-selector-toggle"
+  accessibilityLabel="Always skip document selection"
 />
 <Switch
   value={skipDocumentSelectorIfSingle}
   onValueChange={setSkipDocumentSelectorIfSingle}
   trackColor={{ false: slate200, true: blue600 }}
   thumbColor={white}
   disabled={skipDocumentSelector}
   testID="skip-document-selector-if-single-toggle"
+  accessibilityLabel="Skip when only one document"
 />
app/src/components/proof-request/DisclosureItem.tsx (1)

72-82: Well-implemented info button with good touch target.

The hitSlop of 10 on all sides improves the touch target size, which is good for accessibility. Consider adding accessibilityRole="button" and an accessibilityLabel for screen reader users.

♿ Optional: Improve accessibility
 <Pressable
   onPress={onInfoPress}
   hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
   testID={`${testID}-info-button`}
+  accessibilityRole="button"
+  accessibilityLabel={`More information about ${text}`}
 >
packages/mobile-sdk-alpha/tests/documents/validation.test.ts (1)

81-116: Good use of synthetic ICAO MRZ test vectors.

The test uses the well-known ICAO sample MRZ (P<UTOERIKSSON<<ANNA<MARIA...) which follows the coding guidelines for using published sample MRZ strings. The expiry date manipulation at line 113 correctly targets positions 57-63 in the TD3 format where the expiry date resides.

One observation: the expiredPassport object is initialized at line 99-108 with an already-expired MRZ, then line 113 reassigns the MRZ. The initial value at line 100 already contains 1204159 (expired date). This redundant reassignment could be simplified.

🧹 Minor: Remove redundant MRZ reassignment
   it('returns false for expired passport', () => {
-    // Passport expired in 2012
-    const expiredPassport: PassportData = {
-      mrz: 'P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<L898902C36UTO7408122F1204159ZE184226B<<<<<10',
-      dsc: 'mock-dsc',
-      eContent: [1, 2, 3],
-      signedAttr: [1, 2, 3],
-      encryptedDigest: [1, 2, 3],
-      documentType: 'passport',
-      documentCategory: 'passport',
-      mock: false,
-    };
-
-    // Modify MRZ to have expired date (120415 = April 15, 2012)
-    const mrzWithExpiredDate =
-      'P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<L898902C36UTO7408122F1204159ZE184226B<<<<<10';
-    expiredPassport.mrz = mrzWithExpiredDate.slice(0, 57) + '120415' + mrzWithExpiredDate.slice(63);
+    // MRZ with expiry date 120415 (April 15, 2012 - expired)
+    const expiredPassport: PassportData = {
+      mrz: 'P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<L898902C36UTO7408122F1204159ZE184226B<<<<<10',
+      dsc: 'mock-dsc',
+      eContent: [1, 2, 3],
+      signedAttr: [1, 2, 3],
+      encryptedDigest: [1, 2, 3],
+      documentType: 'passport',
+      documentCategory: 'passport',
+      mock: false,
+    };

     expect(isDocumentValidForProving(mockMetadata, expiredPassport)).toBe(false);
   });
app/src/screens/verification/ProveScreen.tsx (1)

62-73: Consider extracting getDocumentTypeName to a shared utility.

This helper is duplicated in DocumentSelectorForProvingScreen.tsx (lines 99-110). While the existing getDocumentTypeName in utils/documentAttributes.ts uses single-letter codes ('p', 'i', 'a'), this version uses full category names. Consider consolidating to avoid drift.

app/src/components/documents/IDSelectorItem.tsx (1)

130-132: Consider placing isDisabledState before its usage for readability.

While function hoisting makes this work, placing the export before the component (near line 29 after the type) would improve code readability for developers scanning top-to-bottom.

app/src/screens/dev/IDSelectorTestScreen.tsx (2)

36-108: Significant code duplication with DocumentSelectorForProvingScreen.

The helpers getCountryName, getDocumentDisplayName, and determineDocumentState are nearly identical to those in DocumentSelectorForProvingScreen.tsx. Consider extracting to a shared utility file (e.g., utils/documentDisplayUtils.ts) to maintain consistency and reduce maintenance burden.


82-108: Use isDocumentValidForProving() from the SDK for consistency with DocumentSelectorForProvingScreen.

Both checkDocumentExpiration() and isDocumentValidForProving() yield consistent results for document expiry state. However, DocumentSelectorForProvingScreen uses the SDK's isDocumentValidForProving() wrapper, while this code calls checkDocumentExpiration() directly. Since isDocumentValidForProving() is the public SDK API for this check, using it here would maintain consistency across the codebase.

app/src/components/proof-request/index.ts (1)

30-56: Misaligned section comments reduce readability.

The inline comments don't match the exports that follow them:

  • // Icons (line 30) precedes BottomActionBar exports
  • // Bottom action bar (line 34) precedes icon exports
  • // Connected wallet badge (line 49) precedes DisclosureItem
  • // Disclosure item (line 52) precedes ProofMetadataBar

Consider reordering exports to match comments or updating the comments to reflect the current structure.

♻️ Suggested reorganization
-// Icons
 export { BottomActionBar } from '@/components/proof-request/BottomActionBar';
 export { BottomVerifyBar } from '@/components/proof-request/BottomVerifyBar';

-// Bottom action bar
+// Icons
 export {
   ChevronUpDownIcon,
   CopyIcon,
   DocumentIcon,
   FilledCircleIcon,
   InfoCircleIcon,
   WalletIcon,
 } from '@/components/proof-request/icons';

+// Connected wallet badge
 export {
   ConnectedWalletBadge,
   truncateAddress,
 } from '@/components/proof-request/ConnectedWalletBadge';

-// Connected wallet badge
+// Disclosure item
 export { DisclosureItem } from '@/components/proof-request/DisclosureItem';

-// Disclosure item
+// Metadata bar
 export {
   ProofMetadataBar,
   formatTimestamp,
 } from '@/components/proof-request/ProofMetadataBar';
app/jest.setup.js (1)

617-649: Consider extracting shared extractMRZInfo logic.

The extractMRZInfo implementation is duplicated between useSelfClient (lines 586-611) and createSelfClient (lines 622-647). While acceptable in test mocks, extracting to a shared helper would reduce maintenance burden.

♻️ Example refactor
// Define once at the top of the mock
const mockExtractMRZInfo = jest.fn(mrzString => {
  if (!mrzString || typeof mrzString !== 'string') {
    throw new Error('Invalid MRZ string provided');
  }
  if (mrzString.includes('L898902C3')) {
    return {
      documentNumber: 'L898902C3',
      validation: { overall: true },
      firstName: 'ANNA',
      lastName: 'ERIKSSON',
      nationality: 'UTO',
      dateOfBirth: '740812',
      sex: 'F',
      expirationDate: '120415',
    };
  }
  throw new Error('Invalid MRZ format');
});

// Then reuse in both mocks
extractMRZInfo: mockExtractMRZInfo,

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
app/src/components/proof-request/WalletAddressModal.tsx (2)

46-53: Consider narrowing the cleanup effect dependencies.

The cleanup effect depends on visible, address, and onClose. If address or onClose change while the copy timeout is active, the timeout will be cleared, potentially preventing the modal from auto-closing. Since handleCopy already captures the correct values, consider removing address and onClose from the cleanup effect dependencies to only trigger cleanup on unmount or visibility change.

♻️ Suggested refinement
-  // Clear timeout on unmount or when modal closes/address changes
+  // Clear timeout on unmount
   useEffect(() => {
     return () => {
       if (timeoutRef.current) {
         clearTimeout(timeoutRef.current);
         timeoutRef.current = null;
       }
     };
-  }, [visible, address, onClose]);
+  }, []);

171-195: Consider allowing manual close during copy feedback.

The Close button is hidden while copied is true (lines 171-195), and the Copy button is disabled (line 136). This means during the 800ms feedback window, users cannot manually dismiss the modal and must wait for auto-close. While this may be intentional to ensure users see the "Copied!" confirmation, consider keeping the Close button visible but perhaps labeled differently (e.g., "Done") for better UX.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ea959d and fccb65c.

📒 Files selected for processing (6)
  • app/jest.setup.js
  • app/src/components/proof-request/WalletAddressModal.tsx
  • app/src/utils/disclosureUtils.ts
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/utils/disclosureUtils.ts
🧰 Additional context used
📓 Path-based instructions (32)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
  • app/src/components/proof-request/WalletAddressModal.tsx
  • packages/mobile-sdk-alpha/src/index.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
  • app/src/components/proof-request/WalletAddressModal.tsx
  • packages/mobile-sdk-alpha/src/index.ts
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
  • app/src/components/proof-request/WalletAddressModal.tsx
  • packages/mobile-sdk-alpha/src/index.ts
packages/mobile-sdk-alpha/**/*.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

packages/mobile-sdk-alpha/**/*.{ts,tsx}: Check types across the codebase by running yarn types
Run yarn types or yarn typecheck to check TypeScript types across the codebase
Run yarn build to build the package for distribution
Before committing changes, ensure TypeScript types are valid by running yarn types
Before committing changes, ensure the build succeeds by running yarn build
Before creating a PR, ensure yarn types passes (TypeScript validation)
Before creating a PR, ensure yarn build succeeds (package builds correctly)
Ensure no breaking changes to public API or document them properly
Verify cross-platform compatibility for both React Native and Web environments
This package uses TypeScript with strict type checking
Use ESLint with TypeScript-specific rules
Use platform detection Platform.OS === 'web' when adding platform-specific code
Maintain type definitions that are complete and accurate

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/src/index.ts
packages/mobile-sdk-alpha/**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Run yarn lint to check for linting issues or yarn lint:fix to automatically fix them

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/src/index.ts
packages/mobile-sdk-alpha/**/index.{ts,tsx}

📄 CodeRabbit inference engine (packages/mobile-sdk-alpha/AGENTS.md)

Run yarn validate:exports to verify that exports are properly configured

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/src/index.ts
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}: Review alpha mobile SDK code for:

  • API consistency with core SDK
  • Platform-neutral abstractions
  • Performance considerations
  • Clear experimental notes or TODOs

Files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/src/index.ts
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.test.{ts,tsx,js,jsx}: Use renderHook for testing custom React hooks instead of rendering components.
Mock console.error in tests to avoid test output clutter while testing error scenarios.
Test error boundaries and recovery mechanisms in React components.
Mock SQLite operations with executeSql method in database tests using utilities from tests/__setup__/databaseMocks.ts.

**/*.test.{ts,tsx,js,jsx}: Never use require('react-native') in test files; use ES6 import statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines
Never use require('react') in test files; use ES6 import React from 'react' instead to avoid nested require() calls that cause out-of-memory errors

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Implement comprehensive error boundaries in React components.

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/components/proof-request/WalletAddressModal.tsx
**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}: Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)
Apply Jaro–Winkler fuzzy matching algorithm with ≥0.92 threshold for OFAC name verification
Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation
Protect all PII by committing via domain-separated hashes using Poseidon hash function with 'ofac-v1' domain separator
Implement per-issuer salt for additional privacy in OFAC hash commitments, with unique salt per issuing country

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{compliance,ofac,verification,identity,utils}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Normalize names using case-folding, Unicode NFKC normalization, and diacritics removal for OFAC matching

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{compliance,ofac,verification,identity,age}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use ISO 8601 format (YYYY-MM-DD) for all date inputs in compliance verification

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{age,verification,identity,compliance}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement age verification with day-level precision for 'olderThan' checks accepting ISO 8601 date inputs

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{circuits,age,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of age without disclosing actual date of birth

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}: Implement forbidden country validation using Bloom filter with false positive rate ≤1e-6
Validate country codes in ISO 3166-1 alpha-3 format for forbidden country checks

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{circuits,country,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of country non-inclusion without revealing actual country code

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{compliance,country,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement graceful degradation for country validation when filter is unavailable

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}: Use UTC timestamps only for all compliance verification operations
Allow ±5 minutes clock drift tolerance in timestamp validation for compliance checks

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{compliance,verification,proof}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Enforce 24-hour verification window with drift adjustment for compliance proof validity

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{mobile,client,app,time,verification}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use server-signed time tokens or chain block timestamps for trusted time in mobile clients, do not trust device wall-clock alone

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
  • app/src/components/proof-request/WalletAddressModal.tsx
**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}: Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Achieve proof generation in <60 seconds on mid-tier mobile devices

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
  • app/src/components/proof-request/WalletAddressModal.tsx
**/{compliance,verification,proof,zk,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain peak memory usage below 300MB for compliance verification operations

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}: Make all network calls idempotent with exponential backoff retry logic
Implement exponential backoff with jitter for compliance verification retry logic

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/{compliance,audit,log,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain privacy-preserving audit logs for compliance verification operations

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
{app,packages/mobile-sdk-alpha}/**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never create nested require('react-native') calls in tests as this causes out-of-memory errors in CI/CD pipelines; use ES6 import statements instead and avoid dynamic require() calls in beforeEach/afterEach hooks

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn types passes (TypeScript validation) before creating a PR

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/components/proof-request/WalletAddressModal.tsx
app/**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.test.{ts,tsx,js,jsx}: Ensure yarn test passes (unit tests) before creating a PR
Avoid nested require('react') or require('react-native') calls in test files - use ES6 import statements instead
Put all imports at the top of test files - avoid dynamic imports in hooks
Never use require() calls in beforeEach/afterEach hooks in test files
Verify no memory leaks introduced, including test memory patterns
Use ES6 import statements exclusively - never use require('react') or require('react-native') in test files

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
app/tests/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Do not create nested require('react-native') calls in tests - causes OOM in CI

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
app/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{ts,tsx,js,jsx}: Ensure web build succeeds with yarn web before creating a PR
Do not include sensitive data in logs - avoid logging PII, credentials, and tokens
Use react-native-dotenv for environment configuration via @env import
Confirm no sensitive data exposed before PR merge

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
  • app/src/components/proof-request/WalletAddressModal.tsx
**/*.{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/screens/verification/DocumentSelectorForProvingScreen.test.tsx
**/jest.setup.{js,cjs}

📄 CodeRabbit inference engine (.cursor/rules/test-memory-optimization.mdc)

Only use require() calls in Jest setup files (jest.setup.js) for one-time module mocking and initialization; never create nested require() calls within test execution contexts

Files:

  • app/jest.setup.js
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/components/proof-request/WalletAddressModal.tsx
🧠 Learnings (50)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Address CodeRabbitAI feedback during PR review process
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Flag security-sensitive operations in PR descriptions for review
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Achieve proof generation in <60 seconds on mid-tier mobile devices
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Write integration tests that exercise real validation logic from the SDK
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test `isPassportDataValid()` with realistic, synthetic passport data (never use real user data)
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Identity Verification Hub manages multi-step verification process for passports and EU ID cards, handles document attestation through zero-knowledge proofs, and implements verification paths (E-PASSPORT and EU_ID_CARD) in `contracts/contracts/IdentityVerificationHubImplV2.sol`.
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Ensure no breaking changes to public API or document them properly

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/jest.setup.js
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/index.{ts,tsx} : Run `yarn validate:exports` to verify that exports are properly configured

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/jest.setup.js
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-08-25T14:25:57.586Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.586Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/jest.setup.js
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use ES6 `import` statements instead of `require()` when possible

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Prefer top-level imports over nested requires in test files

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/jest.setup.js
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Verify cross-platform compatibility for both React Native and Web environments

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/jest.setup.js
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : This package uses TypeScript with strict type checking

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Maintain type definitions that are complete and accurate

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use real imports from `selfxyz/mobile-sdk-alpha` in tests instead of mocking the entire package

Applied to files:

  • packages/mobile-sdk-alpha/src/constants/index.ts
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test `isPassportDataValid()` with realistic, synthetic passport data (never use real user data)

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-13T18:00:46.963Z
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Verify `extractMRZInfo()` using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Write integration tests that exercise real validation logic from the SDK

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Verify no memory leaks introduced, including test memory patterns

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Never use real user PII (personally identifiable information) in tests - use only synthetic, anonymized, or approved test vectors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Ensure `parseNFCResponse()` works with representative, synthetic NFC data

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Ensure `yarn test` passes (unit tests) before creating a PR

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Avoid mocking the entire package in Jest setup or replacing real functions with mock implementations

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Avoid nested `require('react')` or `require('react-native')` calls in test files - use ES6 import statements instead

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/tests/**/*.{ts,tsx,js,jsx} : Do not create nested `require('react-native')` calls in tests - causes OOM in CI

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:43.224Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T19:18:43.224Z
Learning: Applies to {app,packages/mobile-sdk-alpha}/**/*.{test,spec}.{js,ts,jsx,tsx} : Never create nested require('react-native') calls in tests as this causes out-of-memory errors in CI/CD pipelines; use ES6 import statements instead and avoid dynamic require() calls in beforeEach/afterEach hooks

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/__tests__/**/*.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.spec.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.spec.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/__tests__/**/*.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/tests/setup.ts : Use `vi.mock()` instead of `require()` calls in Vitest setup files; ensure React Native mocks are established once at setup time, not during test execution

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Test error boundaries and recovery mechanisms in React components.

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : React Native is mocked in `tests/setup.ts` using `vi.mock()` - use imports in test files instead of require()

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Avoid dynamic `require()` calls in `beforeEach`/`afterEach` hooks to prevent out-of-memory errors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/jest.setup.js
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to jest.setup.js : Implement comprehensive mocks in `jest.setup.js` for all native modules including Firebase, Keychain, NFC, Analytics, and third-party modules.

Applied to files:

  • app/jest.setup.js
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Use setup file mocks for React Native (jest.setup.js for Jest or tests/setup.ts for Vitest) which run once during test initialization, allowing test files to safely import mocked React Native modules without causing nested require() issues

Applied to files:

  • app/jest.setup.js
📚 Learning: 2025-09-11T19:41:16.601Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 1055
File: app/src/components/homeScreen/idCard.tsx:6-6
Timestamp: 2025-09-11T19:41:16.601Z
Learning: The React Native app in selfxyz/self does not implement responsive layouts for orientation changes. The codebase consistently uses Dimensions.get('window') rather than useWindowDimensions(), indicating that orientation handling is not a priority or architectural pattern in this project.

Applied to files:

  • app/jest.setup.js
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/jest.setup.{js,cjs} : Only use `require()` calls in Jest setup files (jest.setup.js) for one-time module mocking and initialization; never create nested require() calls within test execution contexts

Applied to files:

  • app/jest.setup.js
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test both React Native and Web environments when adding platform-specific code

Applied to files:

  • app/jest.setup.js
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use Vitest for testing, not Jest, with setup configuration in `tests/setup.ts`

Applied to files:

  • app/jest.setup.js
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement custom modal system with `useModal` hook and callback registry in React Native.

Applied to files:

  • app/src/components/proof-request/WalletAddressModal.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{tsx,jsx,ts,js} : Implement proper cleanup in useEffect and component unmount hooks in React.

Applied to files:

  • app/src/components/proof-request/WalletAddressModal.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Prevent memory leaks in native modules in React Native.

Applied to files:

  • app/src/components/proof-request/WalletAddressModal.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement proper cleanup of sensitive data after use.

Applied to files:

  • app/src/components/proof-request/WalletAddressModal.tsx
📚 Learning: 2025-11-18T12:17:14.819Z
Learnt from: seshanthS
Repo: selfxyz/self PR: 1337
File: packages/mobile-sdk-alpha/src/processing/mrz.ts:189-194
Timestamp: 2025-11-18T12:17:14.819Z
Learning: In packages/mobile-sdk-alpha/src/processing/mrz.ts, the checkScannedInfo function and related TD1 extraction/validation logic are only reached on Android. iOS uses native Swift parsing (LiveMRZScannerView.swift) that bypasses this TypeScript layer.

Applied to files:

  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Document complex native module changes in PRs

Applied to files:

  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Before committing changes, ensure TypeScript types are valid by running `yarn types`

Applied to files:

  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement certificate validation for passport data verification.

Applied to files:

  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py} : Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation

Applied to files:

  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-09-10T14:47:40.945Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1041
File: app/src/providers/passportDataProvider.tsx:297-301
Timestamp: 2025-09-10T14:47:40.945Z
Learning: In app/src/providers/passportDataProvider.tsx: The deleteDocumentDirectlyFromKeychain function is a low-level utility used by the DocumentsAdapter and should not include error handling since callers like deleteDocument() already implement appropriate try/catch with logging for Keychain operations.

Applied to files:

  • packages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py} : Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)

Applied to files:

  • packages/mobile-sdk-alpha/src/index.ts
⏰ 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-common
  • GitHub Check: type-check
  • GitHub Check: e2e-ios
  • GitHub Check: Android E2E Tests Demo App
  • GitHub Check: android-build-test
  • GitHub Check: analyze-android
🔇 Additional comments (7)
packages/mobile-sdk-alpha/src/constants/index.ts (1)

33-34: No changes needed.

The exports iosSeparator and separatorColor serve distinct purposes:

  • iosSeparator: 'rgba(60,60,67,0.36)' — iOS system standard separator color (transparent RGBA)
  • separatorColor: '#E0E0E0' — Light gray separator for other contexts

These are not redundant. Platform-specific color constants like iosSeparator are standard practice in cross-platform SDKs and improve clarity for developers. The new exports are backward-compatible additions to the public API.

Likely an incorrect or invalid review comment.

packages/mobile-sdk-alpha/src/index.ts (2)

125-128: LGTM: Deprecation properly documented.

The deprecation notice for extractMRZInfo is clear and provides migration guidance. This is a non-breaking change since the export remains available while steering users toward the recommended createSelfClient().extractMRZInfo approach.


36-36: Exports are properly configured and ready for validation.

The DocumentAttributes type and four utility functions (checkDocumentExpiration, getDocumentAttributes, isDocumentValidForProving, pickBestDocumentToSelect) are correctly exported from the documents/validation module. All type definitions exist and the package export conditions support React Native, browser, and Node.js platforms.

Before merge, ensure the standard validation suite passes:

  • yarn types – TypeScript type checking
  • yarn validate:exports – Export configuration validation
  • yarn build – Build verification
app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx (2)

24-46: LGTM: Proper mock avoiding memory issues.

The custom useFocusEffect mock correctly uses ES6 imports and avoids nested require() calls, following the test-memory-optimization guidelines. The Map-based execution tracking is appropriate for the test environment.

Based on learnings, avoiding nested require() calls prevents OOM in CI.


193-469: Excellent test coverage and structure.

The test suite comprehensively covers:

  • Loading states and initial rendering
  • Document selection logic including auto-selection of valid documents
  • Navigation flows after approval
  • Error handling with proper console spy cleanup

The use of stable mock objects (lines 140-160) and proper async handling with waitFor() demonstrates good testing practices.

app/jest.setup.js (2)

113-122: LGTM: Consistent Dimensions mock enhancements.

The Dimensions.get mock has been properly enhanced to:

  • Accept optional dimension parameter ('window' or 'screen')
  • Return per-dimension objects when specified, or full map when not
  • Include fontScale: 1 for completeness
  • Provide addEventListener/removeEventListener stubs

The implementation is consistently duplicated across main React Native mock, mobile-sdk-alpha React Native mock, and mobile-sdk-alpha Dimensions module mock, which is appropriate for test isolation.

Also applies to: 282-290, 373-385


567-570: Comprehensive mobile-sdk-alpha mocks.

The expanded mocks for @selfxyz/mobile-sdk-alpha provide:

  • Proper hook mocks with realistic behavior
  • Memoized useSelfClient instance to test component memoization
  • MRZ extraction logic with validation (matching test data with 'L898902C3')
  • Callback-based validation in isPassportDataValid
  • Complete SDK events and haptic feedback stubs

The useSafeBottomPadding mock returning basePadding + 50 is acceptable for test scenarios.

Also applies to: 574-691

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
app/src/screens/verification/ProveScreen.tsx (2)

110-149: Cache fallback logic is sound but consider error handling.

The cache-first approach (lines 113-123) is well-implemented. However, if loadDocumentCatalog() fails, line 125 will throw when accessing catalog.selectedDocumentId on undefined.

🛡️ Suggested defensive check
       if (cachedData) {
         catalog = cachedData.catalog;
       } else {
         catalog = await loadDocumentCatalog();
-        // Note: We don't have allDocuments here, so we only partially cache
-        // This is okay since upstream screens will have the full cache
       }
+      
+      if (!catalog) {
+        console.warn('Failed to load document catalog for proof history');
+        return;
+      }

       const selectedDocumentId = catalog.selectedDocumentId;

244-247: Avoid logging wallet addresses in production.

This logs the user's points wallet address. Per coding guidelines, user identifiers should be redacted or masked in logs.

🔒 Suggested fix
-            console.log(
-              'enhancing app with whitelisted points address',
-              address,
-            );
+            console.log('enhancing app with whitelisted points address');
🤖 Fix all issues with AI agents
In @app/src/screens/verification/DocumentSelectorForProvingScreen.tsx:
- Line 373: Replace the raw error logging in the catch around the
setSelectedDocument call so you do not print the full error object; update the
console.error that currently prints selectionError to either a generic message
("Failed to set selected document") or a sanitized property like
selectionError?.message, and ensure this change applies to the catch handling
for the saveDocumentCatalogDirectlyToKeychain/setSelectedDocument flow to avoid
leaking stack traces or internal keychain details.

In @app/src/screens/verification/ProveScreen.tsx:
- Line 218: The console.log call printing the full selectedApp object in the
useEffect exposes sensitive identifiers (userId/sessionId); remove the
console.log or replace it with a redacted log that only prints non-sensitive
fields (e.g., selectedApp?.appName or a boolean/presence check), targeting the
console.log('useEffect selectedApp', selectedApp) occurrence in ProveScreen.tsx
and ensure you do not log selectedApp.userId or selectedApp.sessionId.

In @app/src/screens/verification/ProvingScreenRouter.tsx:
- Line 112: Replace the direct error dump in the ProvingScreenRouter
auto-selection failure with a sanitized message: instead of logging selectError
raw, call the existing sanitizeErrorMessage(selectError) (or log a generic
'Failed to auto-select document' message) so the console.error in the
auto-select document path does not expose sensitive details.
🧹 Nitpick comments (8)
app/src/providers/passportDataProvider.tsx (1)

793-842: Consider cache invalidation for existing document selection.

When an existing document is found (lines 800-812), the code updates selectedDocumentId and saves the catalog but doesn't clear the cache. This could leave consumers with stale catalog data showing the wrong selected document.

💡 Suggested fix
     // Update selected document to this one
     catalog.selectedDocumentId = contentHash;
     await saveDocumentCatalogDirectlyToKeychain(catalog);
+
+    // Clear document cache since catalog selectedDocumentId changed
+    useDocumentCacheStore.getState().clearCache();
+
     return contentHash;
   }
app/src/screens/verification/ProvingScreenRouter.tsx (1)

190-194: Consider using Tamagui's Button component for consistency.

Lines 184-204 use a View with onPress for the Retry button. For better accessibility and consistency with the design system, consider using Tamagui's Button component which provides proper press states and accessibility features.

♻️ Suggested refactor
-        <View
-          paddingHorizontal={24}
-          paddingVertical={12}
-          borderRadius={8}
-          borderWidth={1}
-          borderColor={proofRequestColors.slate200}
-          onPress={() => {
-            hasRoutedRef.current = false;
-            loadAndRoute();
-          }}
-          pressStyle={{ opacity: 0.7 }}
-          testID="proving-router-retry"
-        >
-          <Text
-            fontFamily={dinot}
-            fontSize={16}
-            color={proofRequestColors.slate500}
-          >
-            Retry
-          </Text>
-        </View>
+        <Button
+          paddingHorizontal={24}
+          paddingVertical={12}
+          borderRadius={8}
+          borderWidth={1}
+          borderColor={proofRequestColors.slate200}
+          backgroundColor={proofRequestColors.white}
+          onPress={() => {
+            hasRoutedRef.current = false;
+            loadAndRoute();
+          }}
+          pressStyle={{ opacity: 0.7 }}
+          testID="proving-router-retry"
+        >
+          <Text
+            fontFamily={dinot}
+            fontSize={16}
+            color={proofRequestColors.slate500}
+          >
+            Retry
+          </Text>
+        </Button>

Import Button from tamagui:

-import { Text, View } from 'tamagui';
+import { Button, Text, View } from 'tamagui';
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (2)

371-371: Consider passing scrollOffset through navigation state instead of params.

Line 371 passes scrollOffset as a route param to the Prove screen. For transient UI state like scroll position, consider using navigation state or a separate state management solution to avoid polluting the URL/route params.

This is a minor consideration - route params work fine, but navigation state might be more semantically appropriate for ephemeral UI state.


421-438: Consider using Tamagui Button for the Retry button.

Similar to ProvingScreenRouter, using View with onPress (lines 421-438) instead of a proper Button component reduces accessibility. Consider using Tamagui's Button for consistent interaction patterns.

app/src/navigation/verification.ts (1)

30-30: Consider UX impact of disabled animations.

animation: 'none' on Line 30 removes all screen transitions. While this might be intentional for the proving flow, abrupt screen changes can feel jarring. Consider using a subtle animation like 'fade' for better UX.

This is a minor UX consideration - if the no-animation experience is intentional (perhaps for security/focus reasons), the current implementation is fine.

app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx (2)

25-47: useFocusEffect mock calls cleanup immediately after callback execution.

The mock invokes cleanup() right after callback() completes (lines 39-42). In production, cleanup only runs when the screen loses focus or unmounts. This could mask bugs where cleanup interferes with ongoing async operations.

Consider deferring cleanup or not calling it automatically:

♻️ Suggested approach
       if (!executionMap.has(callback)) {
         executionMap.set(callback, true);
-        // Schedule callback to run after current render (simulates focus effect)
         Promise.resolve().then(() => {
-          const cleanup = callback();
-          if (typeof cleanup === 'function') {
-            cleanup();
-          }
+          callback();
+          // Don't call cleanup - let tests control unmount behavior
         });
       }

Alternatively, store the cleanup function and expose a helper for tests that need to simulate blur/unmount.


104-117: Double type assertion obscures type safety in test fixtures.

The as unknown as IDDocument cast (line 116) bypasses TypeScript's structural checks entirely. While acceptable for tests, consider creating a minimal mock that satisfies the actual interface to catch API drift earlier.

app/src/screens/verification/ProveScreen.tsx (1)

63-74: Local getDocumentTypeName helper handles different input format than exported utility.

The function in ProveScreen.tsx (lines 63-74) handles full documentCategory strings (passport, id_card, aadhaar), while the exported getDocumentTypeName in app/src/utils/documentAttributes.ts (lines 228-239) handles single-letter codes (p, i, a). Both serve different contexts, but this creates a maintenance risk—if a new category is added, developers could miss updating one of the two.

Consider consolidating into a single utility that handles both input formats or document the distinction clearly if keeping them separate.

@transphorm transphorm force-pushed the justin/self-1754-proving-screen-selective-disclosure branch from 32f731d to f8b3c65 Compare January 9, 2026 00:46
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/screens/verification/ProveScreen.tsx (1)

212-212: Critical: Remove PII logging in production.

console.log('useEffect selectedApp', selectedApp) logs the entire selectedApp object which contains userId, disclosures, sessionId, and other sensitive data. This violates the coding guideline to never log PII, credentials, or identifiers.

🛡️ Fix: Remove or redact the log
-    console.log('useEffect selectedApp', selectedApp);
+    // Debug logging removed - selectedApp contains sensitive user data

If logging is needed for debugging, redact sensitive fields:

-    console.log('useEffect selectedApp', selectedApp);
+    console.log('useEffect selectedApp', {
+      appName: selectedApp?.appName,
+      sessionId: selectedApp?.sessionId ? '***' : undefined,
+    });
🧹 Nitpick comments (3)
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (1)

105-116: Duplicate utility function across files.

getDocumentTypeName is also defined in ProvingScreenRouter.tsx (line 27) and ProveScreen.tsx (line 63). Extract this to a shared utility (e.g., @/utils/documentAttributes.ts which already has a similar getDocumentTypeName function) to eliminate duplication.

♻️ Suggested approach

Import from the existing utility or create a new shared one:

-function getDocumentTypeName(category: string | undefined): string {
-  switch (category) {
-    case 'passport':
-      return 'Passport';
-    case 'id_card':
-      return 'ID Card';
-    case 'aadhaar':
-      return 'Aadhaar';
-    default:
-      return 'Document';
-  }
-}
+import { getDocumentTypeName } from '@/utils/documentAttributes';

Note: The existing getDocumentTypeName in documentAttributes.ts uses different keys ('p', 'i', 'a'). Consider consolidating the mapping logic to handle both category formats in one place.

app/src/screens/verification/ProvingScreenRouter.tsx (1)

27-38: Duplicate utility - see DocumentSelectorForProvingScreen.tsx.

Same getDocumentTypeName function duplicated here. Consolidate into a shared utility.

app/src/screens/verification/ProveScreen.tsx (1)

63-74: Third duplicate of getDocumentTypeName.

Extract to @/utils/documentAttributes.ts along with the other two occurrences.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 32f731d and f8b3c65.

📒 Files selected for processing (4)
  • app/src/navigation/index.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/navigation/index.tsx
🧰 Additional context used
📓 Path-based instructions (22)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Implement comprehensive error boundaries in React components.

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}: Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)
Apply Jaro–Winkler fuzzy matching algorithm with ≥0.92 threshold for OFAC name verification
Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation
Protect all PII by committing via domain-separated hashes using Poseidon hash function with 'ofac-v1' domain separator
Implement per-issuer salt for additional privacy in OFAC hash commitments, with unique salt per issuing country

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,ofac,verification,identity,utils}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Normalize names using case-folding, Unicode NFKC normalization, and diacritics removal for OFAC matching

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,ofac,verification,identity,age}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use ISO 8601 format (YYYY-MM-DD) for all date inputs in compliance verification

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{age,verification,identity,compliance}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement age verification with day-level precision for 'olderThan' checks accepting ISO 8601 date inputs

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{circuits,age,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of age without disclosing actual date of birth

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}: Implement forbidden country validation using Bloom filter with false positive rate ≤1e-6
Validate country codes in ISO 3166-1 alpha-3 format for forbidden country checks

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{circuits,country,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of country non-inclusion without revealing actual country code

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,country,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement graceful degradation for country validation when filter is unavailable

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}: Use UTC timestamps only for all compliance verification operations
Allow ±5 minutes clock drift tolerance in timestamp validation for compliance checks

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,verification,proof}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Enforce 24-hour verification window with drift adjustment for compliance proof validity

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{mobile,client,app,time,verification}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use server-signed time tokens or chain block timestamps for trusted time in mobile clients, do not trust device wall-clock alone

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}: Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Achieve proof generation in <60 seconds on mid-tier mobile devices

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,verification,proof,zk,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain peak memory usage below 300MB for compliance verification operations

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}: Make all network calls idempotent with exponential backoff retry logic
Implement exponential backoff with jitter for compliance verification retry logic

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
**/{compliance,audit,log,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain privacy-preserving audit logs for compliance verification operations

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn types passes (TypeScript validation) before creating a PR

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
app/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{ts,tsx,js,jsx}: Ensure web build succeeds with yarn web before creating a PR
Do not include sensitive data in logs - avoid logging PII, credentials, and tokens
Use react-native-dotenv for environment configuration via @env import
Confirm no sensitive data exposed before PR merge

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
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/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
🧠 Learnings (28)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Address CodeRabbitAI feedback during PR review process
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Flag security-sensitive operations in PR descriptions for review
📚 Learning: 2025-12-13T18:00:46.963Z
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement lazy loading for screens using `React.lazy()` in React Native applications.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-09-10T14:47:40.945Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1041
File: app/src/providers/passportDataProvider.tsx:297-301
Timestamp: 2025-09-10T14:47:40.945Z
Learning: In app/src/providers/passportDataProvider.tsx: The deleteDocumentDirectlyFromKeychain function is a low-level utility used by the DocumentsAdapter and should not include error handling since callers like deleteDocument() already implement appropriate try/catch with logging for Keychain operations.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-12-17T15:27:42.298Z
Learnt from: transphorm
Repo: selfxyz/self PR: 1516
File: app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx:51-52
Timestamp: 2025-12-17T15:27:42.298Z
Learning: In app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx, ethers.Mnemonic.isValidMnemonic should not be used as a gate for pasting recovery phrases because it produces false negatives and rejects valid mnemonics. Allow users to paste any clipboard content; validation should only occur when the user attempts to restore the account.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Do not log sensitive data in production, including identity verification and passport information.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., `***-***-1234` for passport numbers, `J*** D***` for names).

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,error,message,response}/**/*.{ts,tsx,js,py} : Provide clear error messages in compliance verification without exposing PII

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx} : Do not include sensitive data in logs - avoid logging PII, credentials, and tokens

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: The main App.tsx file is located at app/App.tsx (not in app/src), and it properly wraps the entire app with SelfClientProvider at the top of the provider hierarchy, enabling useSelfClient() hook usage throughout all navigation screens.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement custom modal system with `useModal` hook and callback registry in React Native.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-08-26T14:41:41.821Z
Learnt from: shazarre
Repo: selfxyz/self PR: 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/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: SelfClientProvider is wrapped in app/App.tsx, providing context for useSelfClient() hook usage throughout the React Native app navigation stacks.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Achieve proof generation in <60 seconds on mid-tier mobile devices

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx} : Confirm no sensitive data exposed before PR merge

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement proper cleanup of sensitive data after use.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Never use real user PII (personally identifiable information) in tests - use only synthetic, anonymized, or approved test vectors

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Integrate haptic feedback using `useHapticNavigation` hook in React Native navigation.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use React Navigation with `createStaticNavigation` for type-safe navigation in React Native applications.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Tamagui for UI components in React Native applications.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
Repo: selfxyz/self PR: 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/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Zustand for global state management in React Native applications.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use custom hooks for complex state (`useModal`, `useHapticNavigation`) instead of inline logic.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Lazy load screens and components to optimize bundle size in React Native.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
🧬 Code graph analysis (2)
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (11)
packages/mobile-sdk-alpha/src/documents/validation.ts (2)
  • getDocumentAttributes (115-134)
  • isDocumentValidForProving (145-159)
app/src/utils/documentAttributes.ts (1)
  • getDocumentTypeName (228-239)
app/src/components/documents/IDSelectorItem.tsx (1)
  • IDSelectorState (29-29)
app/src/navigation/index.tsx (1)
  • RootStackParamList (62-197)
app/src/stores/documentCacheStore.ts (1)
  • useDocumentCacheStore (52-92)
app/src/utils/disclosureUtils.ts (1)
  • getDisclosureItems (19-84)
app/src/components/proof-request/ProofRequestCard.tsx (1)
  • ProofRequestCard (48-134)
app/src/components/proof-request/ConnectedWalletBadge.tsx (1)
  • ConnectedWalletBadge (25-88)
app/src/components/proof-request/DisclosureItem.tsx (1)
  • DisclosureItem (29-85)
app/src/components/proof-request/BottomActionBar.tsx (1)
  • BottomActionBar (28-121)
app/src/components/proof-request/WalletAddressModal.tsx (1)
  • WalletAddressModal (27-204)
app/src/screens/verification/ProvingScreenRouter.tsx (6)
app/src/utils/documentAttributes.ts (1)
  • getDocumentTypeName (228-239)
app/src/navigation/index.tsx (1)
  • RootStackParamList (62-197)
app/src/stores/documentCacheStore.ts (1)
  • useDocumentCacheStore (52-92)
packages/mobile-sdk-alpha/src/documents/validation.ts (2)
  • isDocumentValidForProving (145-159)
  • pickBestDocumentToSelect (169-190)
app/src/components/proof-request/designTokens.ts (1)
  • proofRequestColors (10-32)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • blue600 (10-10)
⏰ 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: type-check
  • GitHub Check: Android E2E Tests Demo App
  • GitHub Check: e2e-ios
  • GitHub Check: android-build-test
  • GitHub Check: analyze-android
🔇 Additional comments (7)
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (2)

277-278: Verify error objects don't contain PII.

The loadError object may include sensitive document metadata or user identifiers. Consider logging only a sanitized error message or error type rather than the full error object in production builds.


293-304: Well-structured async handling and cleanup.

The abort controller pattern with proper cleanup on unmount and cancellation checks before state updates is solid. Good use of useFocusEffect for refresh-on-focus behavior.

app/src/screens/verification/ProvingScreenRouter.tsx (2)

131-132: Sanitize error before logging.

Similar to DocumentSelectorForProvingScreen.tsx, the selectError and loadError objects (line 156) could expose sensitive information. Consider logging only error types or sanitized messages.


65-171: Solid routing logic with proper abort handling and fallbacks.

The routing decision tree is clear: no valid docs → onboarding, skip conditions met → auto-select + Prove, otherwise → selector. The fallback at lines 133-137 when auto-selection fails is a good defensive pattern.

app/src/screens/verification/ProveScreen.tsx (3)

113-123: Cache integration looks correct.

The conditional cache usage with fallback to fresh load follows the established pattern. The comment at lines 121-122 acknowledges the partial caching limitation, which is acceptable since upstream screens populate the full cache.


346-373: Improved scroll measurement with dual-check pattern.

The hasLayoutMeasurements guard at line 153 combined with the bidirectional measurement checks in handleContentSizeChange and handleScrollViewLayout ensures the verify button is enabled correctly once both dimensions are known. Good fix for potential timing issues.


376-433: Clean UI restructuring with ProofRequestCard.

The migration to the composable ProofRequestCard with ConnectedWalletBadge, DisclosureItem, BottomVerifyBar, and WalletAddressModal components improves maintainability and consistency with DocumentSelectorForProvingScreen. The testID attributes are properly set for testing.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/screens/verification/ProveScreen.tsx (1)

212-212: Potential PII exposure in log statement.

console.log('useEffect selectedApp', selectedApp) logs the entire selectedApp object, which contains userId. Per coding guidelines, avoid logging PII including user identifiers.

🔒 Suggested fix
-    console.log('useEffect selectedApp', selectedApp);
+    console.log('useEffect selectedApp sessionId:', selectedApp?.sessionId);

Or remove the log entirely if it's a debugging artifact.

🤖 Fix all issues with AI agents
In @app/src/components/proof-request/icons.tsx:
- Around line 141-146: Reformat the JSX Path element in the icons component so
its attributes are placed on a single line and run the formatter; specifically
update the <Path ... /> element (the Path JSX node that currently has d, stroke,
strokeWidth, strokeLinecap on separate lines) to a single-line attribute form
and then run `yarn fmt --write` to satisfy the pipeline formatting check.

In @app/src/components/proof-request/ProofRequestCard.tsx:
- Around line 48-61: The component default for timestamp in ProofRequestCard
currently uses timestamp = new Date() which allocates a new Date on every
render; change this so the default Date is created once and reused by computing
an effectiveTimestamp inside the component (e.g., create a single
defaultTimestamp via useMemo or a ref at mount and then set effectiveTimestamp =
timestamp ?? defaultTimestamp) and replace all uses of timestamp with
effectiveTimestamp so child components don’t get a new Date every render.
🧹 Nitpick comments (6)
app/src/components/Disclosures.tsx (1)

68-96: Remove commented-out code.

The DiscloseAddress component and its interface are commented out. If this code is no longer needed, remove it entirely. If it's planned for future use, create a TODO or track it in an issue rather than leaving dead code in the codebase.

app/src/components/proof-request/ProofRequestHeader.tsx (1)

92-101: Consider moving hardcoded minHeight to design tokens.

Line 97 uses minHeight={75}, which appears to be a magic number. For consistency with the design system, consider adding this to proofRequestSpacing in designTokens.ts.

Suggested refactor

In designTokens.ts:

export const proofRequestSpacing = {
  // ... existing values
  headerMessageMinHeight: 75,
} as const;

Then in this file:

       <Text
         fontFamily={dinot}
         fontSize={16}
         color={proofRequestColors.slate400}
         lineHeight={24}
-        minHeight={75}
+        minHeight={proofRequestSpacing.headerMessageMinHeight}
         testID={`${testID}-request-message`}
       >
app/src/components/proof-request/ProofRequestCard.tsx (1)

62-80: Consider memoizing requestMessage for performance.

The requestMessage is reconstructed on every render, even when appName and documentType haven't changed. For better performance, especially if this component re-renders frequently, consider memoizing it.

Suggested optimization
+  const requestMessage = React.useMemo(
+    () => (
-  const requestMessage = (
-    <>
+      <>
       <Text color={proofRequestColors.white} fontFamily={dinot}>
         {appName}
       </Text>
       {/* ... rest of the message ... */}
-    </>
-  );
+      </>
+    ),
+    [appName, documentType]
+  );
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (1)

383-383: Fix Prettier formatting per pipeline failure.

The CI flagged a formatting issue on this line. Run yarn fmt --write to resolve.

♻️ Suggested formatting fix
-  }, [selectedDocumentId, canContinue, submitting, setSelectedDocument, navigation]);
+  }, [
+    selectedDocumentId,
+    canContinue,
+    submitting,
+    setSelectedDocument,
+    navigation,
+  ]);
app/src/utils/disclosureUtils.ts (1)

9-16: Edge case: empty list handling.

listToString([]) returns undefined since list[0] on an empty array is undefined. While getDisclosureItems guards against this by filtering empty arrays at line 42, the function itself could be more defensive.

♻️ Optional defensive fix
 function listToString(list: string[]): string {
+  if (list.length === 0) {
+    return '';
+  }
   if (list.length === 1) {
     return list[0];
   } else if (list.length === 2) {
app/src/screens/verification/ProveScreen.tsx (1)

63-74: Code duplication: getDocumentTypeName is defined in multiple places.

This helper is duplicated between ProveScreen.tsx and DocumentSelectorForProvingScreen.tsx. Consider extracting to a shared utility in @/utils/disclosureUtils.ts or @/utils/documentAttributes.ts.

Note: app/src/utils/documentAttributes.ts already has a getDocumentTypeName but it expects short codes ('p', 'i', 'a') rather than category strings ('passport', 'id_card', 'aadhaar').

♻️ Suggested refactor

Add to app/src/utils/disclosureUtils.ts:

export function getDocumentTypeName(category: string | undefined): string {
  switch (category) {
    case 'passport':
      return 'Passport';
    case 'id_card':
      return 'ID Card';
    case 'aadhaar':
      return 'Aadhaar';
    default:
      return 'Document';
  }
}

Then import it in both screens instead of defining locally.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f8b3c65 and a472865.

📒 Files selected for processing (11)
  • app/src/components/Disclosures.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/proof-request/ProofMetadataBar.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/icons.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/utils/disclosureUtils.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/components/proof-request/ProofMetadataBar.tsx
  • app/src/components/documents/IDSelectorSheet.tsx
🧰 Additional context used
📓 Path-based instructions (22)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Implement comprehensive error boundaries in React components.

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}: Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)
Apply Jaro–Winkler fuzzy matching algorithm with ≥0.92 threshold for OFAC name verification
Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation
Protect all PII by committing via domain-separated hashes using Poseidon hash function with 'ofac-v1' domain separator
Implement per-issuer salt for additional privacy in OFAC hash commitments, with unique salt per issuing country

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,ofac,verification,identity,utils}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Normalize names using case-folding, Unicode NFKC normalization, and diacritics removal for OFAC matching

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,ofac,verification,identity,age}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use ISO 8601 format (YYYY-MM-DD) for all date inputs in compliance verification

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{age,verification,identity,compliance}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement age verification with day-level precision for 'olderThan' checks accepting ISO 8601 date inputs

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{circuits,age,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of age without disclosing actual date of birth

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}: Implement forbidden country validation using Bloom filter with false positive rate ≤1e-6
Validate country codes in ISO 3166-1 alpha-3 format for forbidden country checks

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{circuits,country,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of country non-inclusion without revealing actual country code

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,country,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement graceful degradation for country validation when filter is unavailable

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}: Use UTC timestamps only for all compliance verification operations
Allow ±5 minutes clock drift tolerance in timestamp validation for compliance checks

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,proof}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Enforce 24-hour verification window with drift adjustment for compliance proof validity

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{mobile,client,app,time,verification}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use server-signed time tokens or chain block timestamps for trusted time in mobile clients, do not trust device wall-clock alone

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}: Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Achieve proof generation in <60 seconds on mid-tier mobile devices

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
**/{compliance,verification,proof,zk,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain peak memory usage below 300MB for compliance verification operations

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}: Make all network calls idempotent with exponential backoff retry logic
Implement exponential backoff with jitter for compliance verification retry logic

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,audit,log,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain privacy-preserving audit logs for compliance verification operations

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn types passes (TypeScript validation) before creating a PR

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
app/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{ts,tsx,js,jsx}: Ensure web build succeeds with yarn web before creating a PR
Do not include sensitive data in logs - avoid logging PII, credentials, and tokens
Use react-native-dotenv for environment configuration via @env import
Confirm no sensitive data exposed before PR merge

Files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
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/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/components/proof-request/DisclosureItem.tsx
  • app/src/components/Disclosures.tsx
  • app/src/utils/disclosureUtils.ts
  • app/src/components/proof-request/ConnectedWalletBadge.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
  • app/src/components/proof-request/icons.tsx
🧠 Learnings (27)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Flag security-sensitive operations in PR descriptions for review
Learnt from: transphorm
Repo: selfxyz/self PR: 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.
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Tamagui for UI components in React Native applications.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Document complex native module changes in PRs
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement custom modal system with `useModal` hook and callback registry in React Native.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to jest.setup.js : Implement comprehensive mocks in `jest.setup.js` for all native modules including Firebase, Keychain, NFC, Analytics, and third-party modules.
📚 Learning: 2025-12-13T18:00:46.963Z
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement lazy loading for screens using `React.lazy()` in React Native applications.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-09-10T14:47:40.945Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1041
File: app/src/providers/passportDataProvider.tsx:297-301
Timestamp: 2025-09-10T14:47:40.945Z
Learning: In app/src/providers/passportDataProvider.tsx: The deleteDocumentDirectlyFromKeychain function is a low-level utility used by the DocumentsAdapter and should not include error handling since callers like deleteDocument() already implement appropriate try/catch with logging for Keychain operations.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-17T15:27:42.298Z
Learnt from: transphorm
Repo: selfxyz/self PR: 1516
File: app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx:51-52
Timestamp: 2025-12-17T15:27:42.298Z
Learning: In app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx, ethers.Mnemonic.isValidMnemonic should not be used as a gate for pasting recovery phrases because it produces false negatives and rejects valid mnemonics. Allow users to paste any clipboard content; validation should only occur when the user attempts to restore the account.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Do not log sensitive data in production, including identity verification and passport information.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., `***-***-1234` for passport numbers, `J*** D***` for names).

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,error,message,response}/**/*.{ts,tsx,js,py} : Provide clear error messages in compliance verification without exposing PII

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: The main App.tsx file is located at app/App.tsx (not in app/src), and it properly wraps the entire app with SelfClientProvider at the top of the provider hierarchy, enabling useSelfClient() hook usage throughout all navigation screens.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-08-26T14:41:41.821Z
Learnt from: shazarre
Repo: selfxyz/self PR: 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/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement custom modal system with `useModal` hook and callback registry in React Native.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: SelfClientProvider is wrapped in app/App.tsx, providing context for useSelfClient() hook usage throughout the React Native app navigation stacks.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
  • app/src/components/proof-request/ProofRequestCard.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Achieve proof generation in <60 seconds on mid-tier mobile devices

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,verification,proof}/**/*.{ts,tsx,js,py} : Enforce 24-hour verification window with drift adjustment for compliance proof validity

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx} : Do not include sensitive data in logs - avoid logging PII, credentials, and tokens

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx} : Confirm no sensitive data exposed before PR merge

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement proper cleanup of sensitive data after use.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Never use real user PII (personally identifiable information) in tests - use only synthetic, anonymized, or approved test vectors

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Integrate haptic feedback using `useHapticNavigation` hook in React Native navigation.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use React Navigation with `createStaticNavigation` for type-safe navigation in React Native applications.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Tamagui for UI components in React Native applications.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/proof-request/ProofRequestHeader.tsx
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
Repo: selfxyz/self PR: 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/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Zustand for global state management in React Native applications.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use custom hooks for complex state (`useModal`, `useHapticNavigation`) instead of inline logic.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
🧬 Code graph analysis (7)
app/src/components/proof-request/DisclosureItem.tsx (3)
app/src/components/proof-request/index.ts (5)
  • DisclosureItemProps (11-11)
  • DisclosureItem (50-50)
  • proofRequestColors (66-66)
  • FilledCircleIcon (39-39)
  • InfoCircleIcon (40-40)
app/src/components/proof-request/designTokens.ts (1)
  • proofRequestColors (10-32)
app/src/components/proof-request/icons.tsx (2)
  • FilledCircleIcon (95-102)
  • InfoCircleIcon (107-121)
app/src/components/Disclosures.tsx (2)
common/src/utils/appType.ts (1)
  • SelfAppDisclosureConfig (37-50)
app/src/utils/disclosureUtils.ts (2)
  • ORDERED_DISCLOSURE_KEYS (22-33)
  • getDisclosureText (59-89)
app/src/components/proof-request/ConnectedWalletBadge.tsx (3)
app/src/components/proof-request/index.ts (5)
  • ConnectedWalletBadgeProps (9-9)
  • ConnectedWalletBadge (45-45)
  • proofRequestColors (66-66)
  • WalletIcon (41-41)
  • truncateAddress (46-46)
app/src/components/proof-request/designTokens.ts (1)
  • proofRequestColors (10-32)
app/src/components/proof-request/icons.tsx (1)
  • WalletIcon (126-148)
app/src/screens/verification/ProveScreen.tsx (4)
app/src/utils/documentAttributes.ts (1)
  • getDocumentTypeName (228-239)
app/src/stores/documentCacheStore.ts (1)
  • useDocumentCacheStore (52-92)
app/src/utils/disclosureUtils.ts (1)
  • getDisclosureItems (35-53)
app/src/components/proof-request/ProofRequestCard.tsx (1)
  • ProofRequestCard (48-134)
app/src/components/proof-request/ProofRequestHeader.tsx (3)
app/src/components/proof-request/index.ts (3)
  • ProofRequestHeaderProps (26-26)
  • ProofRequestHeader (60-60)
  • proofRequestColors (66-66)
app/src/components/proof-request/designTokens.ts (1)
  • proofRequestColors (10-32)
app/tests/__setup__/mocks/ui.js (1)
  • Image (98-98)
app/src/components/proof-request/ProofRequestCard.tsx (4)
app/src/components/proof-request/index.ts (7)
  • ProofRequestCardProps (25-25)
  • ProofRequestCard (58-58)
  • proofRequestColors (66-66)
  • proofRequestSpacing (67-67)
  • ProofRequestHeader (60-60)
  • ProofMetadataBar (54-54)
  • formatTimestamp (55-55)
app/src/components/proof-request/designTokens.ts (2)
  • proofRequestColors (10-32)
  • proofRequestSpacing (34-40)
app/src/components/proof-request/ProofRequestHeader.tsx (1)
  • ProofRequestHeader (30-104)
app/src/components/proof-request/ProofMetadataBar.tsx (2)
  • ProofMetadataBar (22-72)
  • formatTimestamp (78-89)
app/src/components/proof-request/icons.tsx (1)
app/src/components/proof-request/index.ts (7)
  • IconProps (13-13)
  • ChevronUpDownIcon (36-36)
  • CopyIcon (37-37)
  • DocumentIcon (38-38)
  • FilledCircleIcon (39-39)
  • InfoCircleIcon (40-40)
  • WalletIcon (41-41)
🪛 GitHub Actions: Mobile CI
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx

[warning] Code style issues found. Run 'yarn fmt --write' or Prettier with --write to fix.

app/src/components/proof-request/icons.tsx

[warning] Code style issues found. Run 'yarn fmt --write' or Prettier with --write to fix.

🪛 GitHub Check: build-deps
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx

[warning] 383-383:
Replace selectedDocumentId,·canContinue,·submitting,·setSelectedDocument,·navigation with ⏎····selectedDocumentId,⏎····canContinue,⏎····submitting,⏎····setSelectedDocument,⏎····navigation,⏎··

app/src/components/proof-request/icons.tsx

[warning] 141-141:
Replace ⏎······d="M2·10H22"⏎······stroke={color}⏎······strokeWidth="2"⏎······strokeLinecap="round"⏎··· with ·d="M2·10H22"·stroke={color}·strokeWidth="2"·strokeLinecap="round"

🪛 GitHub Check: workspace-lint
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx

[warning] 383-383:
Replace selectedDocumentId,·canContinue,·submitting,·setSelectedDocument,·navigation with ⏎····selectedDocumentId,⏎····canContinue,⏎····submitting,⏎····setSelectedDocument,⏎····navigation,⏎··

app/src/components/proof-request/icons.tsx

[warning] 141-141:
Replace ⏎······d="M2·10H22"⏎······stroke={color}⏎······strokeWidth="2"⏎······strokeLinecap="round"⏎··· with ·d="M2·10H22"·stroke={color}·strokeWidth="2"·strokeLinecap="round"

⏰ 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-common
  • GitHub Check: type-check
  • GitHub Check: Android E2E Tests Demo App
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-android
🔇 Additional comments (19)
app/src/components/Disclosures.tsx (1)

25-40: LGTM - Clean refactoring to centralized disclosure utilities.

The refactoring to use getDisclosureText and ORDERED_DISCLOSURE_KEYS from the utility module improves maintainability by centralizing the disclosure text generation logic. The guard clauses properly handle edge cases.

app/src/components/proof-request/ProofRequestHeader.tsx (1)

74-86: URL ellipsize configuration looks good.

The use of numberOfLines={1} and ellipsizeMode="middle" for the app URL is appropriate for displaying long URLs while keeping the domain visible.

app/src/components/proof-request/ProofRequestCard.tsx (1)

114-127: ScrollView configuration looks solid.

The ScrollView properly handles refs, event handlers, and initial scroll offset. The conditional contentOffset logic correctly handles the optional initialScrollOffset prop.

app/src/components/proof-request/DisclosureItem.tsx (1)

25-85: Well-structured disclosure item component.

The component is cleanly implemented with:

  • Proper TypeScript typing and default values
  • Conditional rendering based on props (isLast, onInfoPress)
  • Good accessibility with hitSlop on the info button (line 75)
  • Proper testID support throughout
  • Design token usage for colors

The uppercase text transformation and letter spacing align with the design requirements.

app/src/components/proof-request/icons.tsx (1)

16-128: Default icon colors are correctly aligned with design tokens.

All hardcoded colors in icons.tsx match the corresponding values in proofRequestColors from designTokens.ts:

  • #94A3B8slate400
  • #FFFFFFwhite
  • #10B981emerald500
  • #3B82F6blue500

Design consistency is maintained.

app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (6)

56-135: Helper functions look solid.

The state determination logic properly delegates to SDK's isDocumentValidForProving for expiration checks (which aligns with the documented UX-only pattern where authoritative validation happens in circuits). The silent catch in getDocumentDisplayName (lines 77-79) is acceptable since it gracefully falls back to displaying without country info.


137-205: State initialization and memoization are well-structured.

Good use of useMemo for derived values like logoSource, url, and disclosureItems to avoid unnecessary recalculations. The component properly accesses the SDK client via useSelfClient() hook.


241-291: Robust async handling with proper cancellation.

Excellent use of AbortController to prevent state updates after component unmount or when a new request supersedes an in-flight one. The cache-first strategy with fallback to fresh load is sensible for performance.


299-336: Good cleanup and document processing logic.

The useEffect cleanup properly aborts pending requests on unmount. The document sorting (real before mock, then alphabetical) provides a sensible UX priority.


366-401: Verify error logging doesn't expose sensitive document data.

At lines 378 and 396, selectionError is logged directly. While the error message itself ("Failed to set selected document") is generic, the selectionError object could potentially include document identifiers or other sensitive context in its stack trace.

Consider sanitizing the error before logging:

-      console.error('Failed to set selected document:', selectionError);
+      console.error('Failed to set selected document');

Or if you need error details for debugging, ensure the underlying setSelectedDocument function doesn't include PII in thrown errors.


489-561: UI composition is clean and well-structured.

The component properly handles loading, error, and empty states with appropriate user feedback. Good use of Tamagui components and comprehensive testID props for testability. The conditional wallet modal rendering correctly guards against undefined userId.

app/src/utils/disclosureUtils.ts (2)

22-53: Clean disclosure filtering logic.

The ordered keys approach provides a single source of truth for display order. The filtering logic correctly handles both boolean flags and empty arrays.


55-89: Good centralization of disclosure text.

This serves as the single source of truth for disclosure display text across the app, as documented. The switch statement covers all keys in ORDERED_DISCLOSURE_KEYS.

app/src/components/proof-request/ConnectedWalletBadge.tsx (2)

25-88: Well-structured badge component.

Clean conditional rendering pattern with the Pressable wrapper. The component properly uses design tokens and follows Tamagui conventions.


94-103: Clean address truncation utility.

The function correctly handles edge cases where the address is too short to truncate meaningfully. The +2 accounts for the .. separator.

app/src/screens/verification/ProveScreen.tsx (4)

110-149: Cache usage is appropriate.

The cache-first approach aligns with DocumentSelectorForProvingScreen. The comment at lines 121-122 correctly notes this is a partial cache scenario since allDocuments isn't available here.


346-373: Layout measurement handling properly addresses race conditions.

The dual check pattern in both handleContentSizeChange and handleScrollViewLayout ensures the button enables as soon as both measurements are available, regardless of which callback fires last. This addresses the "min height so text doesn't jump" issue from commit history.


258-297: Proper use of centralized disclosure utility.

The disclosureItems computation correctly delegates to the new getDisclosureItems utility, ensuring consistency with DocumentSelectorForProvingScreen.


375-433: UI composition follows the new proof-request pattern.

The screen properly integrates the new ProofRequestCard layout with ConnectedWalletBadge, DisclosureItem list, and modals. The initialScrollOffset from route params enables scroll state preservation when navigating back from document selector.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/screens/verification/ProveScreen.tsx (1)

210-210: Remove PII logging immediately.

This console.log statement outputs the entire selectedApp object, which contains sensitive user data including userId, disclosures, endpoint, and potentially other PII. This directly violates the coding guidelines that state: "NEVER log sensitive data including PII."

🔒 Proposed fix
-    console.log('useEffect selectedApp', selectedApp);
+    // Removed PII logging - selectedApp contains userId and disclosures

If debugging is needed, log only non-sensitive fields:

console.log('useEffect selectedApp sessionId:', selectedApp?.sessionId);

Based on coding guidelines: "NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers."

🤖 Fix all issues with AI agents
In @app/src/screens/verification/ProvingScreenRouter.tsx:
- Line 117: Replace the production console logs that print full error objects to
avoid leaking sensitive data: in the ProvingScreenRouter where you currently
call console.error('Failed to auto-select document:', selectError) (and the
similar console.warn('Failed to load documents for routing:', loadError)),
remove the raw error object from the production log and either log a safe,
non-sensitive message only or wrap the detailed error output in a __DEV__ check
so full error objects are only printed in development; ensure you update the
exact calls referencing selectError and loadError (and any surrounding try/catch
in the auto-select and load documents code paths) accordingly.
🧹 Nitpick comments (4)
app/tests/src/screens/verification/ProvingScreenRouter.test.tsx (1)

242-255: Consider adding a test for retry functionality.

The error state test verifies that navigation doesn't occur on failure, but there's no test for the retry button behavior (lines 201-204 in the component). Testing that pressing retry resets the error state and re-triggers loadAndRoute would improve coverage.

💡 Suggested test case
it('allows retry after error', async () => {
  mockLoadDocumentCatalog
    .mockRejectedValueOnce(new Error('failure'))
    .mockResolvedValueOnce({ documents: [] });
  mockGetAllDocuments.mockResolvedValue({});

  const { getByTestId } = render(<ProvingScreenRouter />);

  await waitFor(() => {
    expect(mockLoadDocumentCatalog).toHaveBeenCalledTimes(1);
  });

  // Simulate retry
  fireEvent.press(getByTestId('proving-router-retry'));

  await waitFor(() => {
    expect(mockLoadDocumentCatalog).toHaveBeenCalledTimes(2);
  });
});
app/src/components/proof-request/BottomActionBar.tsx (1)

47-64: Dynamic padding recalculation on every render could cause layout flicker.

Dimensions.get('window') is called on every render. While the result is memoized, dimension changes during orientation changes or split-screen scenarios will cause recalculation. Consider using useWindowDimensions hook instead, which subscribes to dimension changes more efficiently.

♻️ Suggested improvement
-import {
-  ActivityIndicator,
-  Dimensions,
-  Pressable,
-  StyleSheet,
-} from 'react-native';
+import {
+  ActivityIndicator,
+  Pressable,
+  StyleSheet,
+  useWindowDimensions,
+} from 'react-native';

// Inside the component:
-  const { height: screenHeight } = Dimensions.get('window');
+  const { height: screenHeight } = useWindowDimensions();
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (1)

305-346: Significant code duplication between handleSheetSelect and handleApprove.

Both functions perform nearly identical operations: validate state, set submitting, call setSelectedDocument, navigate to Prove, and handle errors. The only difference is that handleSheetSelect closes the sheet first. Consider extracting the common logic.

♻️ Proposed refactor
+  const performApproval = useCallback(async (closeSheet = false) => {
+    if (!selectedDocumentId || !canContinue || submitting) {
+      return;
+    }
+
+    setSubmitting(true);
+    setError(null);
+    try {
+      await setSelectedDocument(selectedDocumentId);
+      if (closeSheet) {
+        setSheetOpen(false);
+      }
+      navigation.navigate('Prove', { scrollOffset: scrollOffsetRef.current });
+    } catch (selectionError) {
+      console.error('Failed to set selected document:', selectionError);
+      setError('Failed to select document. Please try again.');
+    } finally {
+      setSubmitting(false);
+    }
+  }, [selectedDocumentId, canContinue, submitting, setSelectedDocument, navigation]);
+
+  const handleSheetSelect = useCallback(() => performApproval(true), [performApproval]);
+  const handleApprove = useCallback(() => performApproval(false), [performApproval]);
app/src/components/proof-request/BottomVerifyBar.tsx (1)

40-46: Consider forwarding testID to the inner button component.

The testID prop is applied to the wrapper View but not passed to HeldPrimaryButtonProveScreen. For comprehensive test coverage, you may want to propagate a derived testID to the button component if it supports one.

💡 Suggested improvement
       <HeldPrimaryButtonProveScreen
         onVerify={onVerify}
         selectedAppSessionId={selectedAppSessionId}
         hasScrolledToBottom={hasScrolledToBottom}
         isReadyToProve={isReadyToProve}
         isDocumentExpired={isDocumentExpired}
+        testID={`${testID}-button`}
       />

await setSelectedDocument(docToSelect);
navigation.replace('Prove');
} catch (selectError) {
console.error('Failed to auto-select document:', selectError);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# First, let's look at the file context around line 117
echo "=== Context around line 117 in ProvingScreenRouter.tsx ==="
find . -name "ProvingScreenRouter.tsx" -type f | head -1 | xargs cat -n | sed -n '110,125p'

# Find setSelectedDocument function
echo -e "\n=== Searching for setSelectedDocument definition ==="
rg -n "setSelectedDocument" --type ts --type tsx -B 2 -A 15 | head -100

# Look for error throwing patterns
echo -e "\n=== Checking for error objects in verification context ==="
rg -n "throw.*Error\|throw new" app/src/screens/verification/ --type ts --type tsx | head -20

Repository: selfxyz/self

Length of output: 1065


🏁 Script executed:

#!/bin/bash

# Look for the setSelectedDocument function more carefully
echo "=== Finding setSelectedDocument function ==="
rg -n "const setSelectedDocument|function setSelectedDocument|setSelectedDocument\s*=" --type ts --type tsx -A 20 | head -150

# Check if it's from a hook
echo -e "\n=== Searching for useSelectedDocument or similar hook ==="
rg -n "useSelectedDocument|selectedDocument" app/src/screens/verification/ProvingScreenRouter.tsx --type tsx -B 3 -A 3

Repository: selfxyz/self

Length of output: 232


🏁 Script executed:

#!/bin/bash

# Search without type filter - just use rg with pattern
echo "=== Finding setSelectedDocument function ==="
rg -n "setSelectedDocument" -A 20 | head -200

# Search in the verification directory specifically
echo -e "\n=== Looking in verification directory ==="
find app/src -path "*verification*" -name "*.ts" -o -path "*verification*" -name "*.tsx" | head -20

# Look for imports and state context in ProvingScreenRouter
echo -e "\n=== Checking imports in ProvingScreenRouter.tsx ==="
rg -n "import\|setSelectedDocument" app/src/screens/verification/ProvingScreenRouter.tsx | head -30

Repository: selfxyz/self

Length of output: 18785


🏁 Script executed:

#!/bin/bash

# Get the full ProvingScreenRouter.tsx file to understand context
echo "=== Full ProvingScreenRouter.tsx file ==="
wc -l app/src/screens/verification/ProvingScreenRouter.tsx

# Read first 150 lines to see imports and state setup
head -150 app/src/screens/verification/ProvingScreenRouter.tsx

Repository: selfxyz/self

Length of output: 5458


🏁 Script executed:

#!/bin/bash

# Find the usePassport hook definition
echo "=== Finding usePassport hook ==="
rg -n "usePassport\|export.*usePassport" -A 3 --type ts | head -50

# Find PassportProvider or passportDataProvider files
echo -e "\n=== Finding passportDataProvider files ==="
find app/src -name "*passport*" -type f | head -20

Repository: selfxyz/self

Length of output: 508


🏁 Script executed:

#!/bin/bash

# Read the passportDataProvider file to understand setSelectedDocument
wc -l app/src/providers/passportDataProvider.tsx

# Get context around setSelectedDocument definition
rg -n "setSelectedDocument\s*[:=]|const setSelectedDocument|function setSelectedDocument" app/src/providers/passportDataProvider.tsx -A 20 | head -150

Repository: selfxyz/self

Length of output: 3664


🏁 Script executed:

#!/bin/bash

# Look at the full setSelectedDocument function and surrounding context
echo "=== Full setSelectedDocument implementation ==="
sed -n '768,780p' app/src/providers/passportDataProvider.tsx

# Now look for loadDocumentCatalogDirectlyFromKeychain and saveDocumentCatalogDirectlyToKeychain
echo -e "\n=== Looking for loadDocumentCatalogDirectlyFromKeychain ==="
rg -n "loadDocumentCatalogDirectlyFromKeychain" app/src/providers/passportDataProvider.tsx -A 15 | head -80

echo -e "\n=== Looking for saveDocumentCatalogDirectlyToKeychain ==="
rg -n "saveDocumentCatalogDirectlyToKeychain" app/src/providers/passportDataProvider.tsx -A 15 | head -80

Repository: selfxyz/self

Length of output: 6304


🏁 Script executed:

#!/bin/bash

# Check what errors could come from Keychain operations
echo "=== Looking for Keychain error handling ==="
rg -n "Keychain\." app/src/providers/passportDataProvider.tsx | head -30

# Check if there's any error handling or redaction in the file
echo -e "\n=== Checking for error handling patterns ==="
rg -n "try.*catch|catch.*Error|throw" app/src/providers/passportDataProvider.tsx | head -30

# Check line 768-800 to see full context
echo -e "\n=== Context around setSelectedDocument (768-800) ==="
sed -n '765,810p' app/src/providers/passportDataProvider.tsx

Repository: selfxyz/self

Length of output: 3125


🏁 Script executed:

#!/bin/bash

# Check if there's any __DEV__ wrapping or production logging checks in the file
echo "=== Checking for development-only logging patterns ==="
rg -n "__DEV__|process.env.NODE_ENV" app/src/screens/verification/ProvingScreenRouter.tsx

# Check how DocumentCatalog is structured to understand what could be logged
echo -e "\n=== Looking for DocumentCatalog type definition ==="
rg -n "type DocumentCatalog|interface DocumentCatalog" -A 10 | head -50

# Check DocumentMetadata structure
echo -e "\n=== Looking for DocumentMetadata structure ==="
rg -n "type DocumentMetadata|interface DocumentMetadata" -A 15 | head -80

Repository: selfxyz/self

Length of output: 4880


🏁 Script executed:

#!/bin/bash

# Check how errors from Keychain operations are structured
echo "=== Looking for Keychain error examples in code ==="
rg -n "Keychain\.(get|set).*catch|catch.*Keychain" -A 5 app/src/providers/passportDataProvider.tsx | head -60

# Check if there are any error redaction utilities
echo -e "\n=== Looking for error redaction or sanitization utilities ==="
find app/src -name "*sanitize*" -o -name "*redact*" -o -name "*mask*" | head -20

# Check the test file to understand what errors setSelectedDocument can throw
echo -e "\n=== Checking test expectations for setSelectedDocument ==="
rg -n "setSelectedDocument.*mockRejectedValue\|setSelectedDocument.*throw" app/tests/src/screens/verification/ProvingScreenRouter.test.tsx -B 2 -A 5

Repository: selfxyz/self

Length of output: 230


🏁 Script executed:

#!/bin/bash

# Check the actual implementation of loadDocumentCatalogDirectlyFromKeychain for error types
echo "=== Full loadDocumentCatalogDirectlyFromKeychain implementation ==="
sed -n '467,550p' app/src/providers/passportDataProvider.tsx

# Check what errors could be thrown from saveDocumentCatalogDirectlyToKeychain
echo -e "\n=== Full saveDocumentCatalogDirectlyToKeychain ==="
sed -n '749,758p' app/src/providers/passportDataProvider.tsx

# Check test file for expected errors
echo -e "\n=== Checking test for setSelectedDocument error handling ==="
sed -n '330,365p' app/tests/src/screens/verification/ProvingScreenRouter.test.tsx

Repository: selfxyz/self

Length of output: 4393


🏁 Script executed:

#!/bin/bash

# Check if there are other error logs in the same file and how they're handled
echo "=== All console.error and console.warn in ProvingScreenRouter.tsx ==="
rg -n "console\.(error|warn)" app/src/screens/verification/ProvingScreenRouter.tsx -B 2 -A 1

# Check similar error handling in other verification screens
echo -e "\n=== Error handling in other verification screens ==="
rg -n "console\.(error|warn)" app/src/screens/verification/ -l

Repository: selfxyz/self

Length of output: 842


🏁 Script executed:

#!/bin/bash

# Check what error properties Keychain operations can expose
echo "=== Looking for Keychain error documentation or usage ==="
rg -n "Keychain\..*Error|error\.message|error\.code" app/src/providers/passportDataProvider.tsx -B 2 -A 2 | head -50

# Check if there's a development check pattern used elsewhere in the app
echo -e "\n=== Checking for __DEV__ patterns in app ==="
find app/src -name "*.tsx" -o -name "*.ts" | xargs grep -l "__DEV__" | head -5

# Check one file to see __DEV__ usage pattern
echo -e "\n=== Example __DEV__ usage pattern ==="
rg -n "__DEV__" app/src/screens/ -B 2 -A 2 | head -20

Repository: selfxyz/self

Length of output: 522


🏁 Script executed:

#!/bin/bash

# Check how the coding guidelines are applied - look for examples of proper error handling in verification context
echo "=== Looking for verification/identity error handling patterns ==="
find app/src -path "*verification*" -o -path "*identity*" -o -path "*compliance*" | xargs grep -l "console\." 2>/dev/null | head -5

# Look at ProveScreen for comparison
echo -e "\n=== Error logging in ProveScreen (same verification context) ==="
rg -n "console\.(error|warn|log)" app/src/screens/verification/ProveScreen.tsx -B 2 -A 1 | head -40

# Check if there's a pattern of logging without sensitive data
echo -e "\n=== Check general error handling pattern elsewhere ==="
rg -n "catch.*Error|console\.error" app/src/screens/documents/management/ManageDocumentsScreen.tsx -B 2 -A 2 | head -30

Repository: selfxyz/self

Length of output: 1256


🏁 Script executed:

#!/bin/bash

# Verify the exact error that could be logged - check DocumentCatalog structure once more
echo "=== Confirming DocumentCatalog.documents content ==="
sed -n '39,47p' common/src/utils/types.ts

# Check if there are any redaction utilities or patterns in the codebase
echo -e "\n=== Search for redaction/masking patterns ==="
rg -n "mask|redact|sanitize" app/src --type ts --type tsx | grep -i "error\|log" | head -20

# Confirm production status - is this code always executed?
echo -e "\n=== Verify this is production code path ==="
sed -n '110,125p' app/src/screens/verification/ProvingScreenRouter.tsx

Repository: selfxyz/self

Length of output: 1401


Redact or avoid logging the full error object in production.

The selectError could leak document metadata when Keychain operations fail. Even if caught errors appear simple (e.g., "Selection failed"), complex Keychain failures might expose document identifiers or metadata in the error object. Log only a safe message without the error object, or wrap in __DEV__ if verbose logging is needed for development only. Note: the same concern applies to line 141's console.warn('Failed to load documents for routing:', loadError).

🤖 Prompt for AI Agents
In @app/src/screens/verification/ProvingScreenRouter.tsx at line 117, Replace
the production console logs that print full error objects to avoid leaking
sensitive data: in the ProvingScreenRouter where you currently call
console.error('Failed to auto-select document:', selectError) (and the similar
console.warn('Failed to load documents for routing:', loadError)), remove the
raw error object from the production log and either log a safe, non-sensitive
message only or wrap the detailed error output in a __DEV__ check so full error
objects are only printed in development; ensure you update the exact calls
referencing selectError and loadError (and any surrounding try/catch in the
auto-select and load documents code paths) accordingly.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
app/src/screens/verification/ProveScreen.tsx (1)

196-197: Remove or sanitize production log containing potential PII.

The console.log('useEffect selectedApp', selectedApp) may log the userId field which is sensitive data. Per coding guidelines, avoid logging PII in production.

Recommended fix
-    console.log('useEffect selectedApp', selectedApp);
+    // Debug logging removed - selectedApp may contain userId (PII)

Or if debugging is needed during development, gate it:

-    console.log('useEffect selectedApp', selectedApp);
+    if (__DEV__) {
+      console.log('useEffect selectedApp sessionId:', selectedApp?.sessionId);
+    }
🤖 Fix all issues with AI agents
In @app/src/providers/passportDataProvider.tsx:
- Line 333: There are multiple blank-line formatting violations in
passportDataProvider.tsx (notably around the area near lines referenced in the
review, e.g., ~line 333 and ~line 835); remove the extra empty lines so there is
at most one consecutive blank line between blocks, then reformat the file (run
Prettier/ESLint auto-fix or save with your editor) to ensure the
no-multiple-empty-lines rule is satisfied; target the relevant
component/function blocks in passportDataProvider.tsx and collapse any
double/triple blank lines to a single blank line and commit the changes.

In
@app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx:
- Around line 63-64: Remove the stray extra blank line introduced in the test
file DocumentSelectorForProvingScreen.test.tsx (around the test declarations),
leaving no empty lines where the linter flagged one so the file conforms to the
project's lint rules.

In @app/tests/src/screens/verification/ProvingScreenRouter.test.tsx:
- Around line 49-50: Remove the extra blank line reported by the linter in the
test file ProvingScreenRouter.test.tsx (around the area referenced in the
review) so the file has no unintended empty lines at that location; simply
delete the blank line between the surrounding test code blocks so the file
passes static analysis.
🧹 Nitpick comments (4)
app/src/screens/verification/ProvingScreenRouter.tsx (1)

174-194: Consider using a Pressable or TouchableOpacity for the retry button.

The Tamagui View with onPress works, but using a proper pressable component provides better accessibility semantics (focusable, accessible role). This is a minor UX enhancement.

Suggested improvement
-          <View
+          <Pressable
             paddingHorizontal={24}
             paddingVertical={12}
             borderRadius={8}
             borderWidth={1}
             borderColor={proofRequestColors.slate200}
             onPress={() => {
               hasRoutedRef.current = false;
               loadAndRoute();
             }}
             pressStyle={{ opacity: 0.7 }}
             testID="proving-router-retry"
+            accessible={true}
+            accessibilityRole="button"
+            accessibilityLabel="Retry loading documents"
           >
app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx (1)

24-46: Consider potential memory leak in useFocusEffect mock.

The executionMap Map tracks callbacks but never clears them. In a large test suite, this could accumulate entries. Consider clearing the map in beforeEach or using WeakMap instead.

Potential improvement
 jest.mock('@react-navigation/native', () => {
   const actual = jest.requireActual('@react-navigation/native');
-
-  // Track execution per component instance using a Map
-  const executionMap = new Map<object, boolean>();
+  // Use WeakMap to allow garbage collection of callbacks
+  const executionMap = new WeakMap<object, boolean>();

   return {
     ...actual,
     useFocusEffect: (callback: () => void | (() => void)) => {
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx (2)

288-329: Consolidate duplicate approval logic between handleSheetSelect and handleApprove.

These two handlers have nearly identical logic - both set submitting state, call setSelectedDocument, navigate to Prove with scroll offset, and handle errors. The only difference is handleSheetSelect closes the sheet first.

Consider extracting the shared logic to reduce duplication.

Proposed consolidation
+ const performApproval = useCallback(async (closeSheet = false) => {
+   if (!selectedDocumentId || !canContinue || submitting) {
+     return;
+   }
+
+   setSubmitting(true);
+   setError(null);
+   try {
+     await setSelectedDocument(selectedDocumentId);
+     if (closeSheet) {
+       setSheetOpen(false);
+     }
+     navigation.navigate('Prove', { scrollOffset: scrollOffsetRef.current });
+   } catch (selectionError) {
+     console.error('Failed to set selected document:', selectionError);
+     setError('Failed to select document. Please try again.');
+   } finally {
+     setSubmitting(false);
+   }
+ }, [selectedDocumentId, canContinue, submitting, setSelectedDocument, navigation]);
+
- const handleSheetSelect = useCallback(async () => {
-   // ... 20+ lines of duplicate code
- }, [...]);
-
- const handleApprove = async () => {
-   // ... 20+ lines of duplicate code
- };
+ const handleSheetSelect = useCallback(() => performApproval(true), [performApproval]);
+ const handleApprove = useCallback(() => performApproval(false), [performApproval]);

372-390: Retry button should use a proper pressable component for accessibility.

Same suggestion as in ProvingScreenRouter - using a dedicated pressable component improves accessibility semantics.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97698a0 and 0953717.

📒 Files selected for processing (6)
  • app/src/providers/passportDataProvider.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
🧰 Additional context used
📓 Path-based instructions (27)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,jsx,ts,tsx}: NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.
ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., ***-***-1234 for passport numbers, J*** D*** for names).

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Use React Navigation with createStaticNavigation for type-safe navigation in React Native applications.
Implement platform-specific handling with Platform.OS === 'ios' ? 'iOS' : 'Android' checks before platform-specific code in React Native.
Initialize native modules with initializeNativeModules() before any native operations in React Native.
Implement lazy loading for screens using React.lazy() in React Native applications.
Implement custom modal system with useModal hook and callback registry in React Native.
Integrate haptic feedback using useHapticNavigation hook in React Native navigation.
Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.
Use Zustand for global state management in React Native applications.
Use custom hooks for complex state (useModal, useHapticNavigation) instead of inline logic.
Use AsyncStorage for simple data, SQLite for complex data, and Keychain for sensitive data in React Native.
Use @/ alias for src imports and @tests/ alias for test imports in TypeScript/JavaScript files.
Use conditional rendering with Platform.OS for platform-specific code in React Native.
Use Tamagui for UI components in React Native applications.
Do not log sensitive data in production, including identity verification and passport information.
Use Keychain for secure storage of sensitive data in React Native.
Implement proper cleanup of sensitive data after use.
Implement certificate validation for passport data verification.
Always use try-catch for async operations in React Native and TypeScript code.
Implement graceful degradation when native modules fail in React Native.
Provide user-friendly error messages in UI and error handlers.
Lazy load screens and components to optimize bundle size in React Native.
Prevent memory leaks in native modules in React Native.

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

Implement comprehensive error boundaries in React components.

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
**/*.{tsx,jsx,ts,js}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper cleanup in useEffect and component unmount hooks in React.

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py}: Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)
Apply Jaro–Winkler fuzzy matching algorithm with ≥0.92 threshold for OFAC name verification
Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation
Protect all PII by committing via domain-separated hashes using Poseidon hash function with 'ofac-v1' domain separator
Implement per-issuer salt for additional privacy in OFAC hash commitments, with unique salt per issuing country

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,ofac,verification,identity,utils}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Normalize names using case-folding, Unicode NFKC normalization, and diacritics removal for OFAC matching

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,ofac,verification,identity,age}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use ISO 8601 format (YYYY-MM-DD) for all date inputs in compliance verification

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{age,verification,identity,compliance}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement age verification with day-level precision for 'olderThan' checks accepting ISO 8601 date inputs

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{circuits,age,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of age without disclosing actual date of birth

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,country,verification,identity}/**/*.{ts,tsx,js,py}: Implement forbidden country validation using Bloom filter with false positive rate ≤1e-6
Validate country codes in ISO 3166-1 alpha-3 format for forbidden country checks

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{circuits,country,verification,zk,proof}/**/*.{circom,ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement zero-knowledge proof of country non-inclusion without revealing actual country code

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,country,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Implement graceful degradation for country validation when filter is unavailable

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,identity,age,country}/**/*.{ts,tsx,js,py}: Use UTC timestamps only for all compliance verification operations
Allow ±5 minutes clock drift tolerance in timestamp validation for compliance checks

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,proof}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Enforce 24-hour verification window with drift adjustment for compliance proof validity

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{mobile,client,app,time,verification}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Use server-signed time tokens or chain block timestamps for trusted time in mobile clients, do not trust device wall-clock alone

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt}: Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Achieve proof generation in <60 seconds on mid-tier mobile devices

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
**/{compliance,verification,proof,zk,identity,age,country}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain peak memory usage below 300MB for compliance verification operations

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

**/{compliance,verification,service,api}/**/*.{ts,tsx,js,py}: Make all network calls idempotent with exponential backoff retry logic
Implement exponential backoff with jitter for compliance verification retry logic

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
**/{compliance,audit,log,verification}/**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (.cursor/rules/compliance-verification.mdc)

Maintain privacy-preserving audit logs for compliance verification operations

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Ensure yarn types passes (TypeScript validation) before creating a PR

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
app/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.{ts,tsx,js,jsx}: Ensure web build succeeds with yarn web before creating a PR
Do not include sensitive data in logs - avoid logging PII, credentials, and tokens
Use react-native-dotenv for environment configuration via @env import
Confirm no sensitive data exposed before PR merge

Files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
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/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.test.{ts,tsx,js,jsx}: Use renderHook for testing custom React hooks instead of rendering components.
Mock console.error in tests to avoid test output clutter while testing error scenarios.
Test error boundaries and recovery mechanisms in React components.
Mock SQLite operations with executeSql method in database tests using utilities from tests/__setup__/databaseMocks.ts.

**/*.test.{ts,tsx,js,jsx}: Never use require('react-native') in test files; use ES6 import statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines
Never use require('react') in test files; use ES6 import React from 'react' instead to avoid nested require() calls that cause out-of-memory errors

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
{app,packages/mobile-sdk-alpha}/**/*.{test,spec}.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Never create nested require('react-native') calls in tests as this causes out-of-memory errors in CI/CD pipelines; use ES6 import statements instead and avoid dynamic require() calls in beforeEach/afterEach hooks

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
app/**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

app/**/*.test.{ts,tsx,js,jsx}: Ensure yarn test passes (unit tests) before creating a PR
Avoid nested require('react') or require('react-native') calls in test files - use ES6 import statements instead
Put all imports at the top of test files - avoid dynamic imports in hooks
Never use require() calls in beforeEach/afterEach hooks in test files
Verify no memory leaks introduced, including test memory patterns
Use ES6 import statements exclusively - never use require('react') or require('react-native') in test files

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
app/tests/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Do not create nested require('react-native') calls in tests - causes OOM in CI

Files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
**/*.{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/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
🧠 Learnings (59)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Achieve proof generation in <60 seconds on mid-tier mobile devices
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.
📚 Learning: 2025-12-13T18:00:46.963Z
Learnt from: seshanthS
Repo: selfxyz/self PR: 1497
File: app/src/screens/verification/ProveScreen.tsx:125-161
Timestamp: 2025-12-13T18:00:46.963Z
Learning: In app/src/screens/verification/ProveScreen.tsx: The document expiration check using checkDocumentExpiration() is UX-only to prevent wasted gas and provide better user experience. The authoritative expiration validation is enforced in the circuits and smart contracts using trusted time sources (block timestamps), not device clock.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-08-26T14:41:41.821Z
Learnt from: shazarre
Repo: selfxyz/self PR: 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/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement lazy loading for screens using `React.lazy()` in React Native applications.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: The main App.tsx file is located at app/App.tsx (not in app/src), and it properly wraps the entire app with SelfClientProvider at the top of the provider hierarchy, enabling useSelfClient() hook usage throughout all navigation screens.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use platform-specific initial routes: web uses 'Home', mobile uses 'Splash' in React Navigation.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Lazy load screens and components to optimize bundle size in React Native.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use React Navigation with `createStaticNavigation` for type-safe navigation in React Native applications.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx} : Confirm no sensitive data exposed before PR merge

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Do not log sensitive data in production, including identity verification and passport information.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-09-10T14:47:40.945Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1041
File: app/src/providers/passportDataProvider.tsx:297-301
Timestamp: 2025-09-10T14:47:40.945Z
Learning: In app/src/providers/passportDataProvider.tsx: The deleteDocumentDirectlyFromKeychain function is a low-level utility used by the DocumentsAdapter and should not include error handling since callers like deleteDocument() already implement appropriate try/catch with logging for Keychain operations.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : NEVER log sensitive data including PII (names, DOB, passport numbers, addresses), credentials, tokens, API keys, private keys, or session identifiers.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-10-23T12:08:55.529Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1236
File: packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx:356-378
Timestamp: 2025-10-23T12:08:55.529Z
Learning: In packages/mobile-sdk-alpha/src/flows/onboarding/document-nfc-screen.tsx, the NFC native events emitted via NativeEventEmitter are generic status strings (e.g., "PACE succeeded", "BAC failed", "Reading DG1 succeeded") and do not contain sensitive MRZ data or passport numbers, so they do not require sanitization before logging.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.{ts,tsx,js,jsx} : Do not include sensitive data in logs - avoid logging PII, credentials, and tokens

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-17T15:27:42.298Z
Learnt from: transphorm
Repo: selfxyz/self PR: 1516
File: app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx:51-52
Timestamp: 2025-12-17T15:27:42.298Z
Learning: In app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx, ethers.Mnemonic.isValidMnemonic should not be used as a gate for pasting recovery phrases because it produces false negatives and rejects valid mnemonics. Allow users to paste any clipboard content; validation should only occur when the user attempts to restore the account.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : ALWAYS redact/mask sensitive fields in logs using consistent patterns (e.g., `***-***-1234` for passport numbers, `J*** D***` for names).

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,error,message,response}/**/*.{ts,tsx,js,py} : Provide clear error messages in compliance verification without exposing PII

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-08-26T14:49:11.190Z
Learnt from: shazarre
Repo: selfxyz/self PR: 936
File: app/src/screens/passport/PassportNFCScanScreen.tsx:28-31
Timestamp: 2025-08-26T14:49:11.190Z
Learning: SelfClientProvider is wrapped in app/App.tsx, providing context for useSelfClient() hook usage throughout the React Native app navigation stacks.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement custom modal system with `useModal` hook and callback registry in React Native.

Applied to files:

  • app/src/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-08-23T02:02:02.556Z
Learnt from: transphorm
Repo: selfxyz/self PR: 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/screens/verification/ProvingScreenRouter.tsx
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test `isPassportDataValid()` with realistic, synthetic passport data (never use real user data)

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
  • app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Write integration tests that exercise real validation logic from the SDK

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Verify `extractMRZInfo()` using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Use real imports from `selfxyz/mobile-sdk-alpha` in tests instead of mocking the entire package

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Verify no memory leaks introduced, including test memory patterns

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Never use real user PII (personally identifiable information) in tests - use only synthetic, anonymized, or approved test vectors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Avoid mocking the entire package in Jest setup or replacing real functions with mock implementations

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Ensure `parseNFCResponse()` works with representative, synthetic NFC data

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement certificate validation for passport data verification.

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Avoid nested `require('react')` or `require('react-native')` calls in test files - use ES6 import statements instead

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/tests/**/*.{ts,tsx,js,jsx} : Do not create nested `require('react-native')` calls in tests - causes OOM in CI

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:43.224Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T19:18:43.224Z
Learning: Applies to {app,packages/mobile-sdk-alpha}/**/*.{test,spec}.{js,ts,jsx,tsx} : Never create nested require('react-native') calls in tests as this causes out-of-memory errors in CI/CD pipelines; use ES6 import statements instead and avoid dynamic require() calls in beforeEach/afterEach hooks

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/__tests__/**/*.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.spec.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Never use `require('react-native')` in test files; use ES6 `import` statements instead to avoid nested require() calls that cause out-of-memory errors in CI/CD pipelines

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.spec.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/__tests__/**/*.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Never use `require('react')` in test files; use ES6 `import React from 'react'` instead to avoid nested require() calls that cause out-of-memory errors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Applies to **/tests/setup.ts : Use `vi.mock()` instead of `require()` calls in Vitest setup files; ensure React Native mocks are established once at setup time, not during test execution

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.test.{ts,tsx,js,jsx} : Test error boundaries and recovery mechanisms in React components.

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : React Native is mocked in `tests/setup.ts` using `vi.mock()` - use imports in test files instead of require()

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Avoid dynamic `require()` calls in `beforeEach`/`afterEach` hooks to prevent out-of-memory errors

Applied to files:

  • app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Verify cross-platform compatibility for both React Native and Web environments

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Include trusted time anchor in proof generation and verify time anchor authenticity before proof generation in mobile implementations

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Ensure no breaking changes to public API or document them properly

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Document complex native module changes in PRs

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-12-25T19:19:04.954Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:04.954Z
Learning: Applies to app/**/*.test.{ts,tsx,js,jsx} : Ensure `yarn test` passes (unit tests) before creating a PR

Applied to files:

  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:19:35.354Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-12-25T19:19:35.354Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.test.{ts,tsx} : Test both React Native and Web environments when adding platform-specific code

Applied to files:

  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-12-25T19:18:22.033Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/test-memory-optimization.mdc:0-0
Timestamp: 2025-12-25T19:18:22.033Z
Learning: Use setup file mocks for React Native (jest.setup.js for Jest or tests/setup.ts for Vitest) which run once during test initialization, allowing test files to safely import mocked React Native modules without causing nested require() issues

Applied to files:

  • app/tests/src/screens/verification/ProvingScreenRouter.test.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{mobile,client,app,proof,zk}/**/*.{ts,tsx,js,swift,kt} : Achieve proof generation in <60 seconds on mid-tier mobile devices

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,verification,proof}/**/*.{ts,tsx,js,py} : Enforce 24-hour verification window with drift adjustment for compliance proof validity

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Implement proper cleanup of sensitive data after use.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Integrate haptic feedback using `useHapticNavigation` hook in React Native navigation.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Tamagui for UI components in React Native applications.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use custom hooks for complex state (`useModal`, `useHapticNavigation`) instead of inline logic.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:06:55.970Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T14:06:55.970Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use Zustand for global state management in React Native applications.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py} : Validate passport numbers by removing whitespace/punctuation and performing country-specific format validation

Applied to files:

  • app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-12-25T19:18:43.224Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-25T19:18:43.224Z
Learning: Document any breaking changes in the PR

Applied to files:

  • app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-11-25T14:07:28.188Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/compliance-verification.mdc:0-0
Timestamp: 2025-11-25T14:07:28.188Z
Learning: Applies to **/{compliance,ofac,verification,identity}/**/*.{ts,tsx,js,py} : Implement three-tier OFAC verification system: Passport Number Check (direct passport validation), Name + DOB Check (full name with exact date of birth), and Name + Year Check (name with year of birth, defaulting to Jan-01)

Applied to files:

  • app/src/providers/passportDataProvider.tsx
🧬 Code graph analysis (2)
app/src/screens/verification/ProvingScreenRouter.tsx (5)
app/src/providers/passportDataProvider.tsx (2)
  • usePassport (864-866)
  • setSelectedDocument (765-775)
packages/mobile-sdk-alpha/src/documents/validation.ts (2)
  • isDocumentValidForProving (145-159)
  • pickBestDocumentToSelect (169-190)
app/src/utils/documentUtils.ts (1)
  • getDocumentTypeName (8-19)
app/src/components/proof-request/designTokens.ts (1)
  • proofRequestColors (10-32)
packages/mobile-sdk-alpha/src/constants/colors.ts (1)
  • blue600 (10-10)
app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx (2)
packages/mobile-sdk-alpha/src/index.ts (4)
  • useSelfClient (81-81)
  • getDocumentAttributes (104-104)
  • isDocumentValidForProving (105-105)
  • DocumentMetadata (38-38)
app/src/providers/passportDataProvider.tsx (1)
  • usePassport (864-866)
🪛 GitHub Actions: Mobile CI
app/src/providers/passportDataProvider.tsx

[warning] 333-333: yarn lint: Prettier formatting issue. Delete extraneous newline (prettier/prettier).


[warning] 835-835: yarn lint: Prettier formatting issue. Delete extraneous newline (prettier/prettier).


[error] 835-835: yarn lint: ESLint: 'no-multiple-empty-lines' violation. More than 1 blank line is not allowed.

🪛 GitHub Actions: Workspace CI
app/src/providers/passportDataProvider.tsx

[warning] 333-333: Prettier formatting issue: Delete . (prettier/prettier)


[warning] 835-835: Prettier formatting issue: Delete . (prettier/prettier)


[error] 835-835: No more than one blank line is allowed. (no-multiple-empty-lines)

🪛 GitHub Check: build-deps
app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx

[warning] 224-224:
Delete


[failure] 64-64:
More than 1 blank line not allowed


[warning] 64-64:
Delete

app/src/screens/verification/DocumentSelectorForProvingScreen.tsx

[warning] 209-209:
Replace ⏎····getAllDocuments,⏎····loadDocumentCatalog,⏎····pickInitialDocument,⏎·· with getAllDocuments,·loadDocumentCatalog,·pickInitialDocument

app/tests/src/screens/verification/ProvingScreenRouter.test.tsx

[warning] 186-186:
Delete


[warning] 157-157:
Delete


[failure] 50-50:
More than 1 blank line not allowed


[warning] 50-50:
Delete

app/src/screens/verification/ProveScreen.tsx

[warning] 128-128:
Replace ⏎····addProofHistory,⏎····loadDocumentCatalog,⏎····provingStore.uuid,⏎····selectedApp,⏎·· with addProofHistory,·loadDocumentCatalog,·provingStore.uuid,·selectedApp

app/src/providers/passportDataProvider.tsx

[warning] 333-333:
Delete


[failure] 835-835:
More than 1 blank line not allowed


[warning] 835-835:
Delete

🪛 GitHub Check: workspace-lint
app/tests/src/screens/verification/DocumentSelectorForProvingScreen.test.tsx

[warning] 224-224:
Delete


[failure] 64-64:
More than 1 blank line not allowed


[warning] 64-64:
Delete

app/src/screens/verification/DocumentSelectorForProvingScreen.tsx

[warning] 209-209:
Replace ⏎····getAllDocuments,⏎····loadDocumentCatalog,⏎····pickInitialDocument,⏎·· with getAllDocuments,·loadDocumentCatalog,·pickInitialDocument

app/tests/src/screens/verification/ProvingScreenRouter.test.tsx

[warning] 186-186:
Delete


[warning] 157-157:
Delete


[failure] 50-50:
More than 1 blank line not allowed


[warning] 50-50:
Delete

app/src/screens/verification/ProveScreen.tsx

[warning] 128-128:
Replace ⏎····addProofHistory,⏎····loadDocumentCatalog,⏎····provingStore.uuid,⏎····selectedApp,⏎·· with addProofHistory,·loadDocumentCatalog,·provingStore.uuid,·selectedApp

app/src/providers/passportDataProvider.tsx

[warning] 333-333:
Delete


[failure] 835-835:
More than 1 blank line not allowed


[warning] 835-835:
Delete

⏰ 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: type-check
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-android
  • GitHub Check: Android E2E Tests Demo App

@transphorm transphorm merged commit 850e3b9 into dev Jan 9, 2026
32 checks passed
@transphorm transphorm deleted the justin/self-1754-proving-screen-selective-disclosure branch January 9, 2026 21:56
jcortejoso pushed a commit that referenced this pull request Jan 15, 2026
* add document selector test screen

* clean up mock docs

* update selection options

* Add DocumentSelectorForProving screen and route proof flows through it (#1555)

* Add document selector to proving flow

* fix formatting

* improvements

* redirect user to document not found screen when no documents

* option flow tweaks and tests

* wip tweaks

* fix scrollview bottom padding (#1556)

* tighten up selection text

* create inerstitial

* save wip

* remove not accepted state

* save wip design

* formatting

* update design

* update layout

* Update proving flow tests (#1559)

* Refactor ProveScreen to ProofRequestCard layout and preserve scroll position (#1560)

* Refactor prove screen layout

* fix: amount of hooks rendered needs to be the same for all variants

* long URL ellipsis

* keep titles consistent

* lint

---------

Co-authored-by: Leszek Stachowski <[email protected]>

* wip fix tests

* fix tests

* formatting

* agent feedback

* fix tests

* save wip

* remove text

* fix types

* save working header update

* no transition

* cache document load for proving flow

* save fixes

* small fixes

* match disclosure text

* design updates

* fix approve flow

* fix document type flash

* add min height so text doesn't jump

* update lock

* formatting

* save refactor wip

* don't enable euclid yet

* fix tests

* fix staleness check

* fix select box description

* remove id selector screen

* vertically center

* button updates

* Remove proving document cache (#1567)

* formatting

---------

Co-authored-by: Leszek Stachowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants