Skip to content

Conversation

@seshanthS
Copy link
Collaborator

@seshanthS seshanthS commented Jan 16, 2026

Description

  • Hides unregistered docs from the selector in DocumentSelectorForProvingScreen
  • Update shouldSkip condition to include registration check.

Tested

Manually tested the following cases,

  • Have a total of one document which has failed registration - should show no registered documents
  • Have a total of two failed documents - Should show no registered documents
  • Have a total of 2 docs with 1 not registered - DocumentSelectorForProvingScreen should show only registered document

How to QA

  1. Delete all documents
  2. Register a mock document, exit when it asks for fingerprint/faceId
  3. Open a proof request through deeplink
  4. App should show "no documents found" instead of "Are you new here" screen
  5. Register another mock document completely
  6. Open a proof request through deeplink
  7. The document selector should show only the selected document.

Summary by CodeRabbit

  • Bug Fixes
    • Document selection interface now displays only registered documents instead of all available documents
    • Auto-progression to the proving step now requires selected documents to have registered status

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

The verification flow now enforces registration requirements. Documents are filtered to show only registered ones in the selector UI, and auto-navigation to the Prove screen occurs only when the single valid document is also registered.

Changes

Cohort / File(s) Summary
Registered Document Filtering
app/src/screens/verification/DocumentSelectorForProvingScreen.tsx, app/src/screens/verification/ProvingScreenRouter.tsx
Added registration checks: filter documents list to include only metadata.isRegistered entries; extended auto-skip condition in router to require first valid document has isRegistered true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • transphorm
  • remicolin

Poem

📋 Only registered docs grace the display,
Auto-skip flows when registrations align,
Filters and guards pave the proving way,
Each document verified, authenticated fine! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: filtering unregistered documents from the DocumentSelectorForProvingScreen UI.
Description check ✅ Passed The description covers all required sections with sufficient detail about what changed, how it was tested, and clear QA steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent 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 5b51109 and 5ef2810.

📒 Files selected for processing (2)
  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/ProvingScreenRouter.tsx
🧠 Learnings (5)
📓 Common learnings
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: 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: 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`.
📚 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/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 certificate validation for passport data verification.

Applied to files:

  • app/src/screens/verification/DocumentSelectorForProvingScreen.tsx
  • app/src/screens/verification/ProvingScreenRouter.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
📚 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
⏰ 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: test-common
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-android
🔇 Additional comments (2)
app/src/screens/verification/ProvingScreenRouter.tsx (1)

90-94: Looks good — skip now gated by registration.

This matches the intended behavior for single-doc auto-navigation.

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

220-223: No action needed—isRegistered is guaranteed for all catalog entries.

The registration state is ensured at app initialization by checkAndUpdateRegistrationStates() in SplashScreen, which runs before any navigation occurs. All legacy documents with undefined isRegistered are resolved to boolean values, and new documents default to false. The filter correctly shows only registered documents, which is the intended behavior for the proving flow.

✏️ Tip: You can disable this entire section by setting review_details to false in your review 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.

@seshanthS seshanthS requested a review from transphorm January 16, 2026 12:20
@seshanthS seshanthS changed the title Hotfix - Hide unregistered docs from DocumentSelectorForProvingScreen Hide unregistered docs from DocumentSelectorForProvingScreen Jan 16, 2026
@transphorm
Copy link
Member

nice. let's get this in to the next build

@seshanthS seshanthS merged commit e32a2a3 into dev Jan 20, 2026
24 checks passed
@seshanthS seshanthS deleted the hotfix/hideNotRegisteredDocs branch January 20, 2026 18:47
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