Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Nov 7, 2025

Going to merge after 2.9 release

Summary

  • create app/src/lib for framework-agnostic utilities and update imports across the app
  • move analytics, cloud backup, notifications, logging, and support helpers into app/src/services with matching test and config updates
  • relocate NFC/QR/haptics integrations plus dev/test utilities and refresh build aliases, ESLint, and Vite chunk configuration

Testing

  • yarn lint
  • yarn types
  • yarn build
  • CI=1 YARN_ENABLE_PROGRESS_BARS=0 FORCE_COLOR=0 yarn test

Codex Task

Summary by CodeRabbit

  • Refactor
    • Large module reorganization: services and integrations consolidated and import paths updated across the app.
  • New Features
    • Added cloud-backup helper constants and a retry utility; introduced a shared extra vertical padding token.
  • Tests
    • Updated test mocks and aliases to match the new module layout.
  • Notes
    • No user-facing UI or behavioral changes expected.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Large-scale import and module reorganization: utilities moved from @/utils into domain folders (@/services, @/integrations, @/config), colors/fonts centralized to mobile-sdk-alpha, proving pipeline signatures and locations changed, new cloud-backup helpers and retry util added, devtools/mocks introduced, and many tests updated to match paths.

Changes

Cohort / File(s) Summary
ESLint & Build / Vite
app/.eslintrc.cjs, app/vite.config.ts
Updated ESLint override targets and Vite alias mappings to new service/integration/devtools paths and proving chunks.
Entry & Boot
app/index.js, app/jest.setup.js
Adjusted local crypto polyfill import and test setup mocks to new integration/service paths.
Global UI / Components
app/src/components/*, app/src/components/NavBar/*, app/src/components/LoadingUI.tsx
Repointed colors/fonts/assets to @selfxyz/mobile-sdk-alpha and assets folder; haptics → @/integrations/haptics; normalized SVG asset paths.
Screens
app/src/screens/**/**.tsx (many)
Consolidated color/font/asset/haptics imports across screens to new SDK/constants/services; no logic changes.
Hooks & Providers
app/src/hooks/*, app/src/providers/*
Analytics, logging, notifications, Sentry imports moved to @/services / @/config; updated dynamic imports.
NFC & Haptics Integrations
app/src/integrations/nfc/*, app/src/integrations/haptics/index.ts
Created/relocated NFC and haptics integration entry points; adjusted re-exports and import ordering.
Proving Pipeline
app/src/proving/*, app/src/utils/provingapp/src/proving/*
Moved proving modules out of utils/proving; changed getLoadingScreenText/getProvingTimeEstimate signatures; updated consumers.
Cloud Backup & Crypto
app/src/services/cloud-backup/*, app/src/utils/crypto/{mnemonic,cryptoLoader}.ts, app/src/utils/retry.ts
Added cloud-backup/helpers.ts with file/folder constants and iOS provider setup; moved FILE_NAME/FOLDER/ENCRYPTED_FILE_PATH out of mnemonic; added withRetries util; added parse/isMnemonic.
Logging & Notifications
app/src/services/logging/*, app/src/services/notifications/*
Relocated logger modules to @/services/logging; updated native bridge path; moved notification service into @/services.
Devtools & Mocks
app/src/devtools/*, app/src/devtools/mocks/*, app/src/devtools/testing/*
New devtools aggregation and mock/testing re-exports; Vite aliases updated to use devtools mocks.
Tests & Test Helpers
app/tests/**, app/tests/build/**
Updated many test import paths and mocks to match refactor (analytics, remoteConfig, nfc, cloud-backup, logging, proving).
Docs Cleanup
packages/mobile-sdk-alpha/docs/*
Deleted several migration and error docs (MIGRATION_*, errors.md).

Sequence Diagram(s)

sequenceDiagram
  participant Component as App Component
  participant OldUtils as Old `@/utils/*`
  participant NewModules as New Modules (`@/services`,`@/integrations`,`@/proving`)
  rect rgb(220,235,255)
    note over Component,OldUtils: Before
    Component->>OldUtils: import analytics(), haptic, colors, proving utils...
  end
  rect rgb(220,255,220)
    note over Component,NewModules: After (refactor)
    Component->>NewModules: import analytics() from `@/services/analytics`
    Component->>NewModules: import haptics from `@/integrations/haptics`
    Component->>NewModules: import colors/fonts from `@selfxyz/mobile-sdk-alpha`
    Component->>NewModules: call getLoadingScreenText(sigAlg, exp, type)
  end
  rect rgb(255,240,220)
    note over NewModules: Proving signature change
    NewModules->>NewModules: getLoadingScreenText(signatureAlgorithm, curveOrExponent, type)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Specific areas requiring attention (medium+ priority):

  • app/src/proving/loadingScreenStateText.ts and all call sites — signature changed (now accepts signatureAlgorithm, curveOrExponent, type). Verify every consumer passes individual params (tests already updated but runtime call sites must be validated).
  • Cloud-backup split & crypto changes — FILE_NAME/FOLDER/ENCRYPTED_FILE_PATH moved to services/cloud-backup/helpers.ts and mnemonic parsing moved; validate consumers, iOS CloudStorage.setProviderOptions side-effect, and that no leftover imports reference removed constants.
  • withRetries introduction in app/src/utils/retry.ts — ensure callers use the new module path and backoff behavior/logging are acceptable for retry-sensitive flows.
  • Vite alias and devtools mocks — confirm alias entries (@/integrations/nfc/nfcScanner → devtools mock) do not leak into production builds and chunk mappings resolve correctly.
  • Logging native bridge and expanded logging exports — ensure type imports and native bridge paths align with platform bridge registration to avoid runtime type/bridge mismatch.
  • Tests: many mocks updated — run full test suite (esp. proving, NFC, cloud-backup, logging, analytics) to catch unresolved imports.

Possibly related PRs

Suggested reviewers

  • aaronmgdr
  • remicolin

Poem

🧭 Paths rebased, modules aligned,
colors gathered, haptics signed.
Proving split and backups named,
tests updated, aliases framed.
A tidy map where imports find their mind.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Reorganize mobile app /src and /tests folders' clearly and accurately describes the main refactoring effort: restructuring the app source and test directories.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/restructure-utils-and-organize-project-files

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 marked this pull request as ready for review November 7, 2025 05:18
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

self/app/vite.config.ts

Lines 50 to 55 in 1a96451

'react-native-passport-reader': resolve(
__dirname,
'src/mocks/react-native-passport-reader.ts',
),
'@/utils/nfcScanner': resolve(__dirname, 'src/mocks/nfcScanner.ts'),
crypto: resolve(__dirname, '../common/src/polyfills/crypto.ts'),

P1 Badge Update Vite mock alias for relocated NFC scanner

The web build still aliases @/utils/nfcScanner to the mock implementation, but the refactor moved the scanner to @/integrations/nfc/nfcScanner and all imports were updated accordingly. Because the alias wasn’t updated, Vite now resolves those imports to the real React Native implementation, which depends on NativeModules and the native passport reader module and will fail when bundling for the web. The alias should point at the new path so the mock continues to replace the native module in web builds.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

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

📜 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 1a96451 and 09337e3.

⛔ Files ignored due to path filters (1)
  • app/Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • app/vite.config.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,ts,tsx,jsx,sol,nr}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,tsx,jsx,sol,nr}: 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/vite.config.ts
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Type checking must pass before PRs (yarn types)

Files:

  • app/vite.config.ts
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/utils/**/*.{js,ts,tsx,jsx} : Shared utilities should be placed under `@/utils`.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/ios/**/*.{m,mm,swift} : Document complex native iOS module changes in the PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Use actual imports from selfxyz/mobile-sdk-alpha in tests
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Module mapping `@/` → `src/`, `tests/` → `tests/src/` must be maintained across the project.
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.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and 'tests/' to 'tests/src/'
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/screens/**/*.{js,ts,tsx,jsx} : Lazy load screens using `React.lazy()`, organize screens by feature modules.
📚 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/vite.config.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/tests/setup.ts : Provide Vitest setup file at packages/mobile-sdk-alpha/tests/setup.ts to suppress console noise

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Use actual imports from selfxyz/mobile-sdk-alpha in tests

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Ensure parseNFCResponse() works with representative, synthetic NFC data

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Avoid introducing circular dependencies

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and 'tests/' to 'tests/src/'

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/vitest.config.ts : Use Vitest in the SDK with a Node environment configured in packages/mobile-sdk-alpha/vitest.config.ts

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Do NOT mock selfxyz/mobile-sdk-alpha in tests (avoid jest.mock('selfxyz/mobile-sdk-alpha') and replacing real functions with mocks)

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Write integration tests that exercise the real validation logic (not mocks)

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Test isPassportDataValid() with realistic synthetic passport data (never real user data)

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to jest.setup.js : Comprehensive mocks for all native modules must be set up in `jest.setup.js`.

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Verify extractMRZInfo() using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/screens/**/*.{js,ts,tsx,jsx} : Lazy load screens using `React.lazy()`, organize screens by feature modules.

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/navigation/**/*.{js,ts,tsx,jsx} : Platform-specific initial routes: web uses 'Home', mobile uses 'Splash'.

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Lazy load screens/components, optimize bundle size, prevent memory leaks in native modules, and ensure resource cleanup.

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Always use `@/` for src imports and `tests/` for test imports; prefer platform-specific imports with conditional rendering.

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/utils/**/*.{js,ts,tsx,jsx} : Shared utilities should be placed under `@/utils`.

Applied to files:

  • app/vite.config.ts
📚 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/vite.config.ts
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/**/*.{ios,android,web}.{ts,tsx,js,jsx} : Explain platform-specific code paths in the PR description (files with .ios, .android, or .web extensions)

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/**/*.{js,ts,tsx,jsx} : Always handle platform differentiation with `Platform.OS` checks before platform-specific logic.

Applied to files:

  • app/vite.config.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: type-check
  • GitHub Check: analyze-ios
  • GitHub Check: analyze-android
  • GitHub Check: build-deps
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
🔇 Additional comments (1)
app/vite.config.ts (1)

186-186: Index.ts contains imports from old @selfxyz/common/utils/proving location that may indicate incomplete refactoring.

Files have been correctly moved to app/src/features/proving/ and chunk configuration in vite.config.ts is accurate. However, app/src/features/proving/index.ts (line 14) still imports from @selfxyz/common/utils/proving while re-exporting locally from features/proving.

Verify whether:

  • @selfxyz/common/utils/proving is an intentional external dependency (shared library pattern), or
  • These imports should be consolidated into the local features/proving structure per the migration strategy

If this is an incomplete refactor, consolidate the utilities locally to maintain the module reorganization goal.

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/app/LoadingScreen.tsx (1)

101-103: Log the actual error for better debugging.

The catch block logs a message but not the error itself, making it harder to diagnose document loading failures.

Apply this diff:

-      } catch {
-        console.error('Error loading selected document:');
+      } catch (error) {
+        console.error('Error loading selected document:', error);
         await init(selfClient, 'dsc', true);
🧹 Nitpick comments (3)
packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md (1)

110-110: Clarify the package reference in the analytics/auth adapter consolidation task.

The phrase "through a new package" is ambiguous in the context of existing mobile-sdk-alpha infrastructure and learnings indicating re-exports via packages/mobile-sdk-alpha/src/index.ts. Specify whether this consolidation task publishes through the mobile-sdk-alpha package or creates a separate package, and clarify if this is current PR scope or future work.

app/src/screens/app/LoadingScreen.tsx (1)

222-314: Remove unused styles to reduce dead code.

The StyleSheet definition spans ~90 lines but none of the styles are used in this component (as indicated by the eslint-disable comment). Since LoadingScreen only renders the <LoadingUI> component, these styles should either be moved to LoadingUI if needed there, or removed entirely.

Apply this diff to remove the dead code:

-// eslint-disable-next-line @typescript-eslint/no-unused-vars
-const styles = StyleSheet.create({
-  container: {
-    flex: 1,
-    position: 'relative',
-    backgroundColor: black,
-    justifyContent: 'center',
-    alignItems: 'center',
-  },
-  card: {
-    width: '92%',
-    borderRadius: 16,
-    paddingVertical: 20,
-    alignItems: 'center',
-    backgroundColor: zinc900,
-    shadowColor: black,
-    shadowOffset: { width: 0, height: 4 },
-    shadowOpacity: 0.2,
-    shadowRadius: 12,
-    elevation: 8,
-  },
-  title: {
-    color: white,
-    fontSize: 24,
-    fontFamily: advercase,
-    textAlign: 'center',
-    letterSpacing: 1,
-    fontWeight: '100',
-    marginVertical: 30,
-  },
-  animation: {
-    width: 60,
-    height: 60,
-    marginTop: 30,
-    marginBottom: 0,
-  },
-  animationAndTitleGroup: {
-    alignItems: 'center',
-  },
-  estimatedTimeSection: {
-    width: '100%',
-    alignItems: 'center',
-  },
-  estimatedTimeBorder: {
-    width: '100%',
-    height: 1,
-    backgroundColor: '#232329',
-  },
-  estimatedTimeRow: {
-    flexDirection: 'row',
-    alignItems: 'center',
-    justifyContent: 'center',
-    width: '100%',
-    textTransform: 'uppercase',
-    marginTop: 18,
-  },
-  estimatedTimeLabel: {
-    color: slate400,
-    marginRight: 8,
-    fontSize: 11,
-    letterSpacing: 0.44,
-    fontFamily: dinot,
-  },
-  estimatedTimeValue: {
-    color: white,
-    fontSize: 11,
-    letterSpacing: 0.44,
-    fontFamily: dinot,
-  },
-  warningSection: {
-    position: 'absolute',
-    bottom: 40,
-    left: 0,
-    right: 0,
-    alignItems: 'center',
-    justifyContent: 'center',
-  },
-  warningText: {
-    color: slate400,
-    fontSize: 11,
-    paddingTop: 16,
-    letterSpacing: 0.44,
-    textTransform: 'uppercase',
-    fontFamily: dinot,
-    textAlign: 'center',
-  },
-  stateMessage: {
-    color: slate400,
-    fontSize: 14,
-    paddingTop: 8,
-    textAlign: 'center',
-  },
-});
-
 export default LoadingScreen;
app/src/services/cloud-backup/helpers.ts (1)

16-18: Consider lazy initialization over module-level side effects.

The CloudStorage.setProviderOptions call executes immediately when this module is imported, which could cause issues if:

  • The native module isn't ready yet
  • Tests import this module unexpectedly
  • The module is imported in a non-iOS context by accident

Consider moving this to a dedicated initialization function that's called explicitly at app startup, or lazily initialize on first use of cloud backup functionality.

Example lazy initialization approach:

+let isInitialized = false;
+
+export function ensureCloudStorageInitialized() {
+  if (!isInitialized && Platform.OS === 'ios') {
+    CloudStorage.setProviderOptions({ scope: CloudStorageScope.AppData });
+    isInitialized = true;
+  }
+}
-if (Platform.OS === 'ios') {
-  CloudStorage.setProviderOptions({ scope: CloudStorageScope.AppData });
-}

Then call ensureCloudStorageInitialized() at the start of each cloud backup function in ios.ts.

📜 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 91a0138 and 8ac17b3.

📒 Files selected for processing (19)
  • app/src/devtools/index.ts (1 hunks)
  • app/src/devtools/mocks/index.ts (1 hunks)
  • app/src/devtools/testing/index.ts (1 hunks)
  • app/src/lib/async/retry.ts (1 hunks)
  • app/src/lib/crypto/cryptoLoader.ts (1 hunks)
  • app/src/lib/crypto/mnemonic.ts (2 hunks)
  • app/src/providers/passportDataProvider.tsx (2 hunks)
  • app/src/proving/index.ts (2 hunks)
  • app/src/proving/validateDocument.ts (1 hunks)
  • app/src/screens/app/LoadingScreen.tsx (1 hunks)
  • app/src/screens/dev/DevLoadingScreen.tsx (1 hunks)
  • app/src/services/cloud-backup/helpers.ts (1 hunks)
  • app/src/services/cloud-backup/index.ts (1 hunks)
  • app/src/services/cloud-backup/ios.ts (1 hunks)
  • app/tests/src/utils/proving/validateDocument.test.ts (1 hunks)
  • app/tests/utils/proving/loadingScreenStateText.test.ts (1 hunks)
  • app/tests/utils/proving/provingUtils.test.ts (1 hunks)
  • app/vite.config.ts (2 hunks)
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • app/src/devtools/mocks/index.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/providers/passportDataProvider.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,ts,tsx,jsx,sol,nr}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,tsx,jsx,sol,nr}: 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/proving/validateDocument.ts
  • app/src/devtools/testing/index.ts
  • app/src/services/cloud-backup/ios.ts
  • app/src/lib/async/retry.ts
  • app/src/lib/crypto/cryptoLoader.ts
  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/lib/crypto/mnemonic.ts
  • app/src/devtools/index.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
  • app/tests/utils/proving/provingUtils.test.ts
  • app/src/proving/index.ts
  • app/src/screens/app/LoadingScreen.tsx
  • app/src/services/cloud-backup/helpers.ts
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Type checking must pass before PRs (yarn types)

Files:

  • app/src/proving/validateDocument.ts
  • app/src/devtools/testing/index.ts
  • app/src/services/cloud-backup/ios.ts
  • app/src/lib/async/retry.ts
  • app/src/lib/crypto/cryptoLoader.ts
  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/lib/crypto/mnemonic.ts
  • app/src/devtools/index.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
  • app/tests/utils/proving/provingUtils.test.ts
  • app/src/proving/index.ts
  • app/src/screens/app/LoadingScreen.tsx
  • app/src/services/cloud-backup/helpers.ts
app/src/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:

  • Component architecture and reusability
  • State management patterns
  • Performance optimizations
  • TypeScript type safety
  • React hooks usage and dependencies
  • Navigation patterns

Files:

  • app/src/proving/validateDocument.ts
  • app/src/devtools/testing/index.ts
  • app/src/services/cloud-backup/ios.ts
  • app/src/lib/async/retry.ts
  • app/src/lib/crypto/cryptoLoader.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/lib/crypto/mnemonic.ts
  • app/src/devtools/index.ts
  • app/src/proving/index.ts
  • app/src/screens/app/LoadingScreen.tsx
  • app/src/services/cloud-backup/helpers.ts
**/*.{test,spec}.{ts,js,tsx,jsx}

⚙️ CodeRabbit configuration file

**/*.{test,spec}.{ts,js,tsx,jsx}: Review test files for:

  • Test coverage completeness
  • Test case quality and edge cases
  • Mock usage appropriateness
  • Test readability and maintainability

Files:

  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/tests/utils/proving/provingUtils.test.ts
🧠 Learnings (36)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/utils/**/*.{js,ts,tsx,jsx} : Shared utilities should be placed under `@/utils`.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/ios/**/*.{m,mm,swift} : Document complex native iOS module changes in the PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Module mapping `@/` → `src/`, `tests/` → `tests/src/` must be maintained across the project.
📚 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/proving/validateDocument.ts
  • app/src/devtools/testing/index.ts
  • app/src/services/cloud-backup/ios.ts
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/devtools/index.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
  • app/tests/utils/proving/provingUtils.test.ts
  • app/src/proving/index.ts
  • app/src/screens/app/LoadingScreen.tsx
  • app/src/services/cloud-backup/helpers.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Use actual imports from selfxyz/mobile-sdk-alpha in tests

Applied to files:

  • app/src/proving/validateDocument.ts
  • app/src/devtools/testing/index.ts
  • app/src/services/cloud-backup/ios.ts
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/src/lib/crypto/cryptoLoader.ts
  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/devtools/index.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
  • app/tests/utils/proving/provingUtils.test.ts
  • app/src/screens/app/LoadingScreen.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/proving/validateDocument.ts
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Test isPassportDataValid() with realistic synthetic passport data (never real user data)

Applied to files:

  • app/src/proving/validateDocument.ts
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts

Applied to files:

  • app/src/devtools/testing/index.ts
  • app/src/services/cloud-backup/ios.ts
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/src/lib/crypto/cryptoLoader.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/devtools/index.ts
  • app/src/proving/index.ts
  • app/src/services/cloud-backup/helpers.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/utils/**/*.{js,ts,tsx,jsx} : Shared utilities should be placed under `@/utils`.

Applied to files:

  • app/src/devtools/testing/index.ts
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/src/devtools/index.ts
  • app/vite.config.ts
  • app/tests/utils/proving/provingUtils.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/tests/setup.ts : Provide Vitest setup file at packages/mobile-sdk-alpha/tests/setup.ts to suppress console noise

Applied to files:

  • app/src/devtools/testing/index.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Module mapping `@/` → `src/`, `tests/` → `tests/src/` must be maintained across the project.

Applied to files:

  • app/src/devtools/testing/index.ts
  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/vite.config.ts
  • app/tests/utils/proving/provingUtils.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Always use `@/` for src imports and `tests/` for test imports; prefer platform-specific imports with conditional rendering.

Applied to files:

  • app/src/devtools/testing/index.ts
  • app/vite.config.ts
  • app/tests/utils/proving/provingUtils.test.ts
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/ios/**/*.{m,mm,swift} : Document complex native iOS module changes in the PR

Applied to files:

  • app/src/services/cloud-backup/ios.ts
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Avoid introducing circular dependencies

Applied to files:

  • app/src/services/cloud-backup/ios.ts
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/vite.config.ts
  • app/src/services/cloud-backup/helpers.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/README.md : Document new/updated SDK modules and usage in packages/mobile-sdk-alpha/README.md

Applied to files:

  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Update the app to consume the mobile-sdk-alpha package and replace local modules with SDK imports

Applied to files:

  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Do NOT mock selfxyz/mobile-sdk-alpha in tests (avoid jest.mock('selfxyz/mobile-sdk-alpha') and replacing real functions with mocks)

Applied to files:

  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/src/devtools/index.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
  • app/tests/utils/proving/provingUtils.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/crypto/** : Place crypto adapters and utilities in packages/mobile-sdk-alpha/src/crypto/

Applied to files:

  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/src/services/cloud-backup/helpers.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Use strict TypeScript type checking across the codebase

Applied to files:

  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Never use real user PII in tests; use only synthetic, anonymized, or approved test vectors

Applied to files:

  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/proving/** : Place proof input generation in packages/mobile-sdk-alpha/src/proving/

Applied to files:

  • app/src/lib/crypto/cryptoLoader.ts
  • app/tests/utils/proving/provingUtils.test.ts
  • app/src/proving/index.ts
📚 Learning: 2025-07-28T19:18:48.270Z
Learnt from: transphorm
Repo: selfxyz/self PR: 795
File: app/src/screens/prove/ProveScreen.tsx:5-5
Timestamp: 2025-07-28T19:18:48.270Z
Learning: The import path 'selfxyz/common/utils/scope' is valid when the common package has a "./utils/*" export mapping in package.json, even if ESLint shows resolution errors before the package is built. The package.json exports field properly maps "./utils/*" to the compiled files in dist/.

Applied to files:

  • app/src/lib/crypto/cryptoLoader.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Write integration tests that exercise the real validation logic (not mocks)

Applied to files:

  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Verify extractMRZInfo() using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Ensure parseNFCResponse() works with representative, synthetic NFC data

Applied to files:

  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/tests/utils/proving/loadingScreenStateText.test.ts
  • app/vite.config.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and 'tests/' to 'tests/src/'

Applied to files:

  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/vite.config.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks

Applied to files:

  • app/tests/src/utils/proving/validateDocument.test.ts
  • app/vite.config.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/devtools/index.ts
  • app/vite.config.ts
📚 Learning: 2025-10-07T14:25:57.507Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 1230
File: packages/mobile-sdk-alpha/package.json:66-75
Timestamp: 2025-10-07T14:25:57.507Z
Learning: Always verify directory existence from the correct package root before flagging missing directories as critical issues, especially when the package.json "files" array includes them.

Applied to files:

  • app/vite.config.ts
  • app/src/services/cloud-backup/helpers.ts
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/**/*.{ios,android,web}.{ts,tsx,js,jsx} : Explain platform-specific code paths in the PR description (files with .ios, .android, or .web extensions)

Applied to files:

  • app/vite.config.ts
  • app/src/screens/app/LoadingScreen.tsx
  • app/src/services/cloud-backup/helpers.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to jest.setup.js : Comprehensive mocks for all native modules must be set up in `jest.setup.js`.

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/**/*.{js,ts,tsx,jsx} : Use `react-navigation/native` with `createStaticNavigation` for type-safe navigation in React Native.

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/screens/**/*.{js,ts,tsx,jsx} : Lazy load screens using `React.lazy()`, organize screens by feature modules.

Applied to files:

  • app/vite.config.ts
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/navigation/**/*.{js,ts,tsx,jsx} : Platform-specific initial routes: web uses 'Home', mobile uses 'Splash'.

Applied to files:

  • app/vite.config.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Lazy load screens/components, optimize bundle size, prevent memory leaks in native modules, and ensure resource cleanup.

Applied to files:

  • app/vite.config.ts
  • app/src/screens/app/LoadingScreen.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/vite.config.ts
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/android/**/*.{kt,java} : Document complex native Android module changes in the PR

Applied to files:

  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to **/*.{js,ts,tsx,jsx,sol,nr} : 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/services/cloud-backup/helpers.ts
🧬 Code graph analysis (1)
app/src/services/cloud-backup/helpers.ts (1)
packages/mobile-sdk-demo/tests/mocks/react-native.ts (1)
  • Platform (14-25)
⏰ 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). (8)
  • GitHub Check: type-check
  • GitHub Check: build-deps
  • GitHub Check: e2e-ios
  • GitHub Check: android-e2e
  • GitHub Check: ios-e2e
  • GitHub Check: android-build-test
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
🔇 Additional comments (17)
app/src/screens/app/LoadingScreen.tsx (1)

18-22: LGTM! Import reorganization aligns with PR objectives.

The import path updates correctly reflect the new module structure: framework-agnostic utilities to @/lib/*, services to @/services/*, and platform integrations to @/integrations/*. No behavioral changes introduced.

app/src/services/cloud-backup/ios.ts (1)

7-10: LGTM! Clean import refactoring.

The import paths correctly reflect the new module organization from @/utils/* to @/lib/* and @/services/*.

app/src/services/cloud-backup/index.ts (1)

12-21: LGTM! Import reorganization is consistent.

All import paths have been correctly updated to reflect the new module structure. The changes align with the PR's objective to move utilities into @/lib/*, @/services/*, and @/types/*.

app/src/lib/crypto/mnemonic.ts (1)

31-57: LGTM! Robust mnemonic parsing with proper validation.

The parseMnemonic function correctly:

  • Handles JSON parsing errors gracefully
  • Validates structure with the isMnemonic type guard
  • Validates cryptographic validity with ethers.Mnemonic.isValidMnemonic
  • Provides clear, actionable error messages

This is a solid implementation for security-critical cryptographic material handling.

app/src/proving/validateDocument.ts (1)

30-30: LGTM - Analytics import path updated correctly.

The import path change from @/utils/analytics to @/services/analytics aligns with the PR's reorganization strategy and maintains the same usage pattern.

app/src/lib/crypto/cryptoLoader.ts (1)

17-17: LGTM - Proving utilities import path updated correctly.

The dynamic import path change from @/utils/proving/validateDocument to @/proving/validateDocument correctly reflects the proving utilities relocation.

app/vite.config.ts (3)

38-57: LGTM - Alias paths updated to devtools/mocks structure.

The alias configuration correctly redirects React Native modules and NFC scanner to the devtools mocks directory. The consistency between the alias definitions and the module structure supports proper web build mocking.


181-181: LGTM - Chunk configuration now correctly references the mocked file.

The chunk path './src/devtools/mocks/nfcScanner.ts' now matches the alias target from lines 54-57, resolving the previous review concern. This ensures the mocked NFC scanner is properly included in web build chunks.


186-190: All proving module paths verified and valid.

File verification confirms that all proving modules referenced in the chunk configuration exist at their designated locations. No structural issues detected.

app/tests/utils/proving/provingUtils.test.ts (1)

7-7: LGTM - Test import updated to new proving module location.

The import path change from @/utils/proving to @/proving correctly reflects the module reorganization while maintaining access to the same utilities (re-exported from @selfxyz/common/utils/proving).

app/tests/src/utils/proving/validateDocument.test.ts (2)

13-13: LGTM - Test imports aligned with new module structure.

The import path change from @/utils/proving/validateDocument to @/proving/validateDocument correctly reflects the source file relocation while maintaining all test functionality.


17-22: LGTM - Mock path updated to match source file imports.

The analytics mock path change from @/utils/analytics to @/services/analytics correctly aligns with the import used in the source file (line 30 of validateDocument.ts), ensuring the mock intercepts the right module.

app/src/proving/index.ts (2)

5-8: LGTM - Helpful documentation added.

The added comments clearly explain the module's composition, distinguishing between cross-workspace utilities and app-specific helpers. This improves maintainability.


21-21: LGTM - Export path updated to new proving module location.

The export source change from @/utils/proving/loadingScreenStateText to @/proving/loadingScreenStateText correctly reflects the internal file reorganization while maintaining the same public API.

app/src/devtools/testing/index.ts (1)

6-6: No action required.

The module @/devtools/testing/utils exists at app/src/devtools/testing/utils.ts. The barrel export is valid and properly targets an existing module. The code change is correct.

app/src/devtools/index.ts (1)

6-7: No issues found—barrel exports are correctly configured.

Both @/devtools/mocks and @/devtools/testing modules exist with their index files, so the barrel exports at lines 6-7 are valid and properly structured.

app/tests/utils/proving/loadingScreenStateText.test.ts (1)

7-10: Import path updated correctly for module reorganization.

The import path change from @/utils/proving/loadingScreenStateText to @/proving/loadingScreenStateText aligns with the PR's objective to refactor utilities into specialized directories.

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

🧹 Nitpick comments (1)
app/src/lib/async/retry.ts (1)

20-30: Consider adding a minimum delay for first retry.

The delay calculation delayMultiplier * i results in 0ms on the first retry (when i = 0). For transient failures like network issues or rate limits, an immediate retry might hit the same problem without giving the system time to recover.

Consider one of these approaches:

Option 1: Start delay from 1 instead of 0

-        await new Promise(resolve => setTimeout(resolve, delayMultiplier * i));
+        await new Promise(resolve => setTimeout(resolve, delayMultiplier * (i + 1)));

Option 2: Add a minimum delay

-        await new Promise(resolve => setTimeout(resolve, delayMultiplier * i));
+        await new Promise(resolve => setTimeout(resolve, Math.max(100, delayMultiplier * i)));

Additionally, consider logging the error message to aid debugging:

-        AppLogger.info('retry #', i);
+        AppLogger.info(`retry #${i}:`, latestError?.message || 'unknown error');
📜 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 8ac17b3 and 7ccc282.

📒 Files selected for processing (7)
  • app/.eslintrc.cjs (1 hunks)
  • app/src/lib/async/retry.ts (1 hunks)
  • app/tests/utils/proving/loadingScreenStateText.test.ts (10 hunks)
  • packages/mobile-sdk-alpha/docs/MIGRATION_COMPLETED.md (0 hunks)
  • packages/mobile-sdk-alpha/docs/MIGRATION_PLAN.md (0 hunks)
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md (0 hunks)
  • packages/mobile-sdk-alpha/docs/errors.md (0 hunks)
💤 Files with no reviewable changes (4)
  • packages/mobile-sdk-alpha/docs/MIGRATION_COMPLETED.md
  • packages/mobile-sdk-alpha/docs/errors.md
  • packages/mobile-sdk-alpha/docs/MIGRATION_PROMPTS.md
  • packages/mobile-sdk-alpha/docs/MIGRATION_PLAN.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/.eslintrc.cjs
  • app/tests/utils/proving/loadingScreenStateText.test.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{js,ts,tsx,jsx,sol,nr}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,tsx,jsx,sol,nr}: 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/lib/async/retry.ts
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Type checking must pass before PRs (yarn types)

Files:

  • app/src/lib/async/retry.ts
app/src/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:

  • Component architecture and reusability
  • State management patterns
  • Performance optimizations
  • TypeScript type safety
  • React hooks usage and dependencies
  • Navigation patterns

Files:

  • app/src/lib/async/retry.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/ios/**/*.{m,mm,swift} : Document complex native iOS module changes in the PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/utils/**/*.{js,ts,tsx,jsx} : Shared utilities should be placed under `@/utils`.
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Always use try-catch for async operations, ensure user-friendly error messages, and implement comprehensive error boundaries.

Applied to files:

  • app/src/lib/async/retry.ts
🧬 Code graph analysis (1)
app/src/lib/async/retry.ts (1)
app/src/services/logging/index.ts (1)
  • AppLogger (73-73)
⏰ 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). (8)
  • GitHub Check: type-check
  • GitHub Check: build-deps
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: android-e2e
  • GitHub Check: ios-e2e
  • GitHub Check: analyze-ios
  • GitHub Check: analyze-android
🔇 Additional comments (1)
app/src/lib/async/retry.ts (1)

7-19: Previous documentation and initialization issues resolved.

Good work addressing the earlier feedback—the JSDoc now correctly states "linear backoff" (matching the implementation), and latestError is properly initialized as Error | undefined.

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 (2)
app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx (1)

57-116: Add error handling for async operations and validate types after JSON.parse.

The restoreAccount callback lacks try-catch blocks around multiple async operations. If any of these calls throw (lines 64, 73, 75, or 106), the app could crash and leave restoring=true, potentially blocking the UI permanently.

Additionally, line 77 uses a type assertion (secret as string) on data from JSON.parse() without validation. If the parsed data doesn't match the expected shape, this could cause runtime errors.

Apply this diff to add error handling:

 const restoreAccount = useCallback(async () => {
   setRestoring(true);
+  try {
     const slimMnemonic = mnemonic?.trim();
     if (!slimMnemonic || !ethers.Mnemonic.isValidMnemonic(slimMnemonic)) {
       setRestoring(false);
       return;
     }
     const result = await restoreAccountFromMnemonic(slimMnemonic);

     if (!result) {
       console.warn('Failed to restore account');
       navigation.navigate('Launch');
       setRestoring(false);
       return;
     }

     const passportDataAndSecret = (await loadPassportDataAndSecret()) as string;
     const { passportData, secret } = JSON.parse(passportDataAndSecret);
+    
+    if (typeof secret !== 'string') {
+      console.warn('Invalid secret format in passport data');
+      navigation.navigate('Launch');
+      setRestoring(false);
+      return;
+    }
+
     const { isRegistered, csca } = await isUserRegisteredWithAlternativeCSCA(
       passportData,
-      secret as string,
+      secret,
       {
         getCommitmentTree(docCategory) {
           return useProtocolStore.getState()[docCategory].commitment_tree;
         },
         getAltCSCA(docCategory) {
           if (docCategory === 'aadhaar') {
             const publicKeys = useProtocolStore.getState().aadhaar.public_keys;
             return publicKeys
               ? Object.fromEntries(publicKeys.map(key => [key, key]))
               : {};
           }

           return useProtocolStore.getState()[docCategory].alternative_csca;
         },
       },
     );
     if (!isRegistered) {
       console.warn(
         'Secret provided did not match a registered passport. Please try again.',
       );
       reStorePassportDataWithRightCSCA(passportData, csca as string);
       navigation.navigate('Launch');
       setRestoring(false);
       return;
     }

     setRestoring(false);
     await markCurrentDocumentAsRegistered(selfClient);
     trackEvent(BackupEvents.ACCOUNT_RECOVERY_COMPLETED);
     navigation.navigate('AccountVerifiedSuccess');
+  } catch (error) {
+    console.warn('Error during account recovery');
+    setRestoring(false);
+    navigation.navigate('Launch');
+  }
 }, [
   mnemonic,
   navigation,
   restoreAccountFromMnemonic,
   selfClient,
   trackEvent,
   useProtocolStore,
 ]);
app/src/screens/dev/CreateMockScreen.tsx (1)

399-414: Guard document expiry decrement by expiryYears
The decrement button is gated on age <= 0, so as long as age is positive we can keep tapping it past zero and end up storing documents with negative expiry years. That breaks downstream consumers of generateMockDocument/storePassportData because the mock becomes invalid. Clamp the action to expiryYears instead.

                   onPress={() => {
-                    buttonTap();
-                    setExpiryYears(expiryYears - 1);
-                    trackEvent(MockDataEvents.DECREASE_EXPIRY_YEARS);
+                    if (expiryYears <= 0) {
+                      return;
+                    }
+                    buttonTap();
+                    setExpiryYears(expiryYears - 1);
+                    trackEvent(MockDataEvents.DECREASE_EXPIRY_YEARS);
                   }}
-                  disabled={age <= 0}
+                  disabled={expiryYears <= 0}
🧹 Nitpick comments (1)
app/src/components/FeedbackModalScreen.tsx (1)

78-90: Add haptic feedback for consistency.

The secondary button callback lacks haptic feedback, while the primary button (line 56) and close button (line 73) both provide it. This creates an inconsistent user experience.

Apply this diff to add haptic feedback:

 const onSecondaryButtonPress = useCallback(async () => {
+  confirmTap();
+
   if (!modalParams?.onSecondaryButtonPress) {
     return;
   }
📜 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 a15d84b and c598c44.

📒 Files selected for processing (88)
  • app/src/components/Disclosures.tsx (1 hunks)
  • app/src/components/ErrorBoundary.tsx (1 hunks)
  • app/src/components/FeedbackModal.tsx (1 hunks)
  • app/src/components/FeedbackModalScreen.tsx (1 hunks)
  • app/src/components/LoadingUI.tsx (2 hunks)
  • app/src/components/Mnemonic.tsx (1 hunks)
  • app/src/components/NavBar/AadhaarNavBar.tsx (1 hunks)
  • app/src/components/NavBar/DefaultNavBar.tsx (1 hunks)
  • app/src/components/NavBar/DocumentFlowNavBar.tsx (1 hunks)
  • app/src/components/NavBar/HomeNavBar.tsx (1 hunks)
  • app/src/components/NavBar/IdDetailsNavBar.tsx (1 hunks)
  • app/src/components/NavBar/WebViewNavBar.tsx (1 hunks)
  • app/src/components/Tips.tsx (1 hunks)
  • app/src/components/WebViewFooter.tsx (1 hunks)
  • app/src/components/homeScreen/idCard.tsx (1 hunks)
  • app/src/config/remoteConfig.ts (3 hunks)
  • app/src/config/remoteConfig.web.ts (3 hunks)
  • app/src/hooks/useFeedbackModal.ts (1 hunks)
  • app/src/integrations/nfc/nfcScanner.ts (1 hunks)
  • app/src/layouts/ExpandableBottomLayout.tsx (1 hunks)
  • app/src/layouts/SimpleScrolledTitleLayout.tsx (1 hunks)
  • app/src/navigation/account.ts (1 hunks)
  • app/src/navigation/account.web.ts (1 hunks)
  • app/src/navigation/devTools.ts (1 hunks)
  • app/src/navigation/documents.ts (1 hunks)
  • app/src/navigation/verification.ts (1 hunks)
  • app/src/providers/authProvider.tsx (1 hunks)
  • app/src/providers/passportDataProvider.tsx (1 hunks)
  • app/src/providers/remoteConfigProvider.tsx (1 hunks)
  • app/src/providers/selfClientProvider.tsx (2 hunks)
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx (2 hunks)
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx (1 hunks)
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx (1 hunks)
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx (1 hunks)
  • app/src/screens/account/settings/CloudBackupScreen.tsx (1 hunks)
  • app/src/screens/account/settings/SettingsScreen.tsx (3 hunks)
  • app/src/screens/app/DeferredLinkingInfoScreen.tsx (1 hunks)
  • app/src/screens/app/LaunchScreen.tsx (1 hunks)
  • app/src/screens/app/LoadingScreen.tsx (1 hunks)
  • app/src/screens/app/ModalScreen.tsx (1 hunks)
  • app/src/screens/app/SplashScreen.tsx (1 hunks)
  • app/src/screens/dev/CreateMockScreen.tsx (2 hunks)
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx (1 hunks)
  • app/src/screens/dev/DevFeatureFlagsScreen.tsx (1 hunks)
  • app/src/screens/dev/DevLoadingScreen.tsx (1 hunks)
  • app/src/screens/dev/DevPrivateKeyScreen.tsx (1 hunks)
  • app/src/screens/dev/DevSettingsScreen.tsx (2 hunks)
  • app/src/screens/documents/aadhaar/AadhaarUploadErrorScreen.tsx (1 hunks)
  • app/src/screens/documents/aadhaar/AadhaarUploadScreen.tsx (1 hunks)
  • app/src/screens/documents/aadhaar/AadhaarUploadedSuccessScreen.tsx (1 hunks)
  • app/src/screens/documents/management/DocumentDataInfoScreen.tsx (1 hunks)
  • app/src/screens/documents/management/IdDetailsScreen.tsx (1 hunks)
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx (1 hunks)
  • app/src/screens/documents/scanning/DocumentCameraScreen.tsx (2 hunks)
  • app/src/screens/documents/scanning/DocumentCameraTroubleScreen.tsx (2 hunks)
  • app/src/screens/documents/scanning/DocumentNFCMethodSelectionScreen.tsx (1 hunks)
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx (2 hunks)
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx (1 hunks)
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx (1 hunks)
  • app/src/screens/documents/selection/CountryPickerScreen.tsx (1 hunks)
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx (1 hunks)
  • app/src/screens/documents/selection/IDPickerScreen.tsx (1 hunks)
  • app/src/screens/home/HomeScreen.tsx (1 hunks)
  • app/src/screens/home/ProofHistoryDetailScreen.tsx (2 hunks)
  • app/src/screens/home/ProofHistoryList.tsx (2 hunks)
  • app/src/screens/home/ProofHistoryScreen.tsx (2 hunks)
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx (1 hunks)
  • app/src/screens/onboarding/DisclaimerScreen.tsx (1 hunks)
  • app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx (1 hunks)
  • app/src/screens/shared/ComingSoonScreen.tsx (1 hunks)
  • app/src/screens/shared/WebViewScreen.tsx (1 hunks)
  • app/src/screens/verification/ProofRequestStatusScreen.tsx (1 hunks)
  • app/src/screens/verification/ProveScreen.tsx (1 hunks)
  • app/src/screens/verification/QRCodeTroubleScreen.tsx (1 hunks)
  • app/src/screens/verification/QRCodeViewFinderScreen.tsx (2 hunks)
  • app/src/services/analytics.ts (1 hunks)
  • app/src/services/cloud-backup/index.ts (1 hunks)
  • app/src/services/cloud-backup/ios.ts (1 hunks)
  • app/src/utils/crypto/cryptoLoader.ts (1 hunks)
  • app/src/utils/crypto/mnemonic.ts (2 hunks)
  • app/src/utils/retry.ts (1 hunks)
  • app/src/utils/styleUtils.ts (1 hunks)
  • app/tests/src/RemoteConfig.test.ts (1 hunks)
  • app/tests/src/components/ErrorBoundary.test.tsx (1 hunks)
  • app/tests/src/hooks/useAppUpdates.test.tsx (1 hunks)
  • app/tests/src/providers/remoteConfigProvider.test.tsx (1 hunks)
  • app/tests/utils/analytics.test.ts (1 hunks)
  • app/tests/utils/ethers.test.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • app/tests/src/RemoteConfig.test.ts
🚧 Files skipped from review as they are similar to previous changes (46)
  • app/src/screens/documents/management/DocumentDataInfoScreen.tsx
  • app/src/integrations/nfc/nfcScanner.ts
  • app/src/screens/app/DeferredLinkingInfoScreen.tsx
  • app/src/screens/home/ProofHistoryList.tsx
  • app/src/layouts/ExpandableBottomLayout.tsx
  • app/src/providers/selfClientProvider.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx
  • app/src/screens/documents/aadhaar/AadhaarUploadedSuccessScreen.tsx
  • app/src/screens/app/ModalScreen.tsx
  • app/src/components/Disclosures.tsx
  • app/src/screens/home/ProofHistoryScreen.tsx
  • app/src/services/analytics.ts
  • app/src/providers/authProvider.tsx
  • app/src/navigation/account.ts
  • app/src/screens/documents/aadhaar/AadhaarUploadErrorScreen.tsx
  • app/src/screens/documents/aadhaar/AadhaarUploadScreen.tsx
  • app/src/screens/dev/DevFeatureFlagsScreen.tsx
  • app/src/providers/passportDataProvider.tsx
  • app/src/components/NavBar/AadhaarNavBar.tsx
  • app/src/screens/documents/scanning/DocumentCameraScreen.tsx
  • app/src/components/NavBar/DefaultNavBar.tsx
  • app/src/components/NavBar/HomeNavBar.tsx
  • app/src/components/NavBar/DocumentFlowNavBar.tsx
  • app/src/screens/home/HomeScreen.tsx
  • app/src/screens/documents/management/IdDetailsScreen.tsx
  • app/src/screens/onboarding/DisclaimerScreen.tsx
  • app/src/navigation/verification.ts
  • app/src/screens/dev/DevSettingsScreen.tsx
  • app/src/screens/app/LaunchScreen.tsx
  • app/src/components/NavBar/WebViewNavBar.tsx
  • app/src/screens/dev/DevPrivateKeyScreen.tsx
  • app/src/screens/verification/ProofRequestStatusScreen.tsx
  • app/src/components/FeedbackModal.tsx
  • app/src/navigation/account.web.ts
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/verification/QRCodeViewFinderScreen.tsx
  • app/src/screens/documents/scanning/DocumentCameraTroubleScreen.tsx
  • app/src/components/Tips.tsx
  • app/src/components/LoadingUI.tsx
  • app/src/screens/documents/scanning/DocumentNFCMethodSelectionScreen.tsx
  • app/src/screens/shared/ComingSoonScreen.tsx
  • app/src/screens/documents/selection/CountryPickerScreen.tsx
  • app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx
  • app/src/components/Mnemonic.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,ts,tsx,jsx,sol,nr}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,tsx,jsx,sol,nr}: 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/navigation/documents.ts
  • app/src/utils/styleUtils.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/tests/utils/ethers.test.ts
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/utils/retry.ts
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/navigation/devTools.ts
  • app/src/components/WebViewFooter.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/src/config/remoteConfig.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/hooks/useFeedbackModal.ts
  • app/src/services/cloud-backup/ios.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/verification/QRCodeTroubleScreen.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/tests/utils/analytics.test.ts
  • app/src/components/ErrorBoundary.tsx
  • app/src/utils/crypto/cryptoLoader.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/providers/remoteConfigProvider.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/config/remoteConfig.web.ts
  • app/src/utils/crypto/mnemonic.ts
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Type checking must pass before PRs (yarn types)

Files:

  • app/src/navigation/documents.ts
  • app/src/utils/styleUtils.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/tests/utils/ethers.test.ts
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/utils/retry.ts
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/navigation/devTools.ts
  • app/src/components/WebViewFooter.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/src/config/remoteConfig.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/hooks/useFeedbackModal.ts
  • app/src/services/cloud-backup/ios.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/verification/QRCodeTroubleScreen.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/tests/utils/analytics.test.ts
  • app/src/components/ErrorBoundary.tsx
  • app/src/utils/crypto/cryptoLoader.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/providers/remoteConfigProvider.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/config/remoteConfig.web.ts
  • app/src/utils/crypto/mnemonic.ts
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.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/navigation/documents.ts
  • app/src/utils/styleUtils.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/utils/retry.ts
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/navigation/devTools.ts
  • app/src/components/WebViewFooter.tsx
  • app/src/config/remoteConfig.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/hooks/useFeedbackModal.ts
  • app/src/services/cloud-backup/ios.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/verification/QRCodeTroubleScreen.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/src/components/ErrorBoundary.tsx
  • app/src/utils/crypto/cryptoLoader.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/providers/remoteConfigProvider.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/config/remoteConfig.web.ts
  • app/src/utils/crypto/mnemonic.ts
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.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/utils/ethers.test.ts
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/tests/utils/analytics.test.ts
app/**/*.{ios,android,web}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Explain platform-specific code paths in the PR description (files with .ios, .android, or .web extensions)

Files:

  • app/src/config/remoteConfig.web.ts
🧠 Learnings (47)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/utils/**/*.{js,ts,tsx,jsx} : Shared utilities should be placed under `@/utils`.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/ios/**/*.{m,mm,swift} : Document complex native iOS module changes in the PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Update the app to consume the mobile-sdk-alpha package and replace local modules with SDK imports
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Use actual imports from selfxyz/mobile-sdk-alpha in tests
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/README.md : Document new/updated SDK modules and usage in packages/mobile-sdk-alpha/README.md
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.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/android/**/*.{kt,java} : Document complex native Android module changes in the PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Use strict TypeScript type checking across the codebase
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Avoid introducing circular dependencies
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/** : Place artifact and manifest management in packages/mobile-sdk-alpha/src/artifacts/
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Use actual imports from selfxyz/mobile-sdk-alpha in tests

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/tests/utils/ethers.test.ts
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/navigation/devTools.ts
  • app/src/components/WebViewFooter.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/src/config/remoteConfig.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/services/cloud-backup/ios.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/verification/QRCodeTroubleScreen.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/tests/utils/analytics.test.ts
  • app/src/components/ErrorBoundary.tsx
  • app/src/utils/crypto/cryptoLoader.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/providers/remoteConfigProvider.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/config/remoteConfig.web.ts
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 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/documents.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/tests/utils/ethers.test.ts
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/navigation/devTools.ts
  • app/src/components/WebViewFooter.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/src/config/remoteConfig.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/services/cloud-backup/ios.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/verification/QRCodeTroubleScreen.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/tests/utils/analytics.test.ts
  • app/src/components/ErrorBoundary.tsx
  • app/src/utils/crypto/cryptoLoader.ts
  • app/src/services/cloud-backup/index.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/providers/remoteConfigProvider.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/config/remoteConfig.web.ts
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/navigation/devTools.ts
  • app/src/components/WebViewFooter.tsx
  • app/src/config/remoteConfig.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/src/utils/crypto/cryptoLoader.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/providers/remoteConfigProvider.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/config/remoteConfig.web.ts
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Avoid introducing circular dependencies

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/navigation/devTools.ts
  • app/src/components/WebViewFooter.tsx
  • app/src/config/remoteConfig.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/providers/remoteConfigProvider.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/config/remoteConfig.web.ts
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/ios/**/*.{m,mm,swift} : Document complex native iOS module changes in the PR

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/services/cloud-backup/ios.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/android/**/*.{kt,java} : Document complex native Android module changes in the PR

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Use strict TypeScript type checking across the codebase

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/navigation/devTools.ts
  • app/src/config/remoteConfig.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Verify extractMRZInfo() using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/tests/utils/ethers.test.ts
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/verification/QRCodeTroubleScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
  • app/src/components/homeScreen/idCard.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/README.md : Document new/updated SDK modules and usage in packages/mobile-sdk-alpha/README.md

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Do NOT mock selfxyz/mobile-sdk-alpha in tests (avoid jest.mock('selfxyz/mobile-sdk-alpha') and replacing real functions with mocks)

Applied to files:

  • app/src/navigation/documents.ts
  • app/tests/utils/ethers.test.ts
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/navigation/devTools.ts
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/tests/utils/analytics.test.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/home/ProofHistoryDetailScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/**/*.{js,ts,tsx,jsx} : Use `react-navigation/native` with `createStaticNavigation` for type-safe navigation in React Native.

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/navigation/devTools.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/app/LoadingScreen.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/navigation/documents.ts
  • app/src/navigation/devTools.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.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/navigation/documents.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.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/navigation/documents.ts
  • app/src/screens/verification/ProveScreen.tsx
  • app/src/components/NavBar/IdDetailsNavBar.tsx
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/navigation/**/*.{js,ts,tsx,jsx} : Platform-specific initial routes: web uses 'Home', mobile uses 'Splash'.

Applied to files:

  • app/src/navigation/documents.ts
  • app/src/screens/documents/selection/IDPickerScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/navigation/devTools.ts
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/app/SplashScreen.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/proving/** : Place proof input generation in packages/mobile-sdk-alpha/src/proving/

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
  • app/src/utils/crypto/cryptoLoader.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Always use `@/` for src imports and `tests/` for test imports; prefer platform-specific imports with conditional rendering.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/account/settings/SettingsScreen.tsx
📚 Learning: 2025-08-26T12:48:14.120Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/screens/passport/PassportNFCScanScreen.web.tsx:8-9
Timestamp: 2025-08-26T12:48:14.120Z
Learning: SecondaryButton forwards the trackEvent prop to AbstractButton via prop spreading (...props). AbstractButton handles analytics tracking in its handlePress method using the legacy analytics() system rather than the new Self SDK approach, ensuring button analytics work consistently across the app.

Applied to files:

  • app/src/screens/verification/ProveScreen.tsx
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.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/ProveScreen.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/app/SplashScreen.tsx
  • app/src/screens/app/LoadingScreen.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/ProveScreen.tsx
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/screens/app/SplashScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Never use real user PII in tests; use only synthetic, anonymized, or approved test vectors

Applied to files:

  • app/tests/utils/ethers.test.ts
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/tests/utils/analytics.test.ts
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/onboarding/AccountVerifiedSuccessScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Test isPassportDataValid() with realistic synthetic passport data (never real user data)

Applied to files:

  • app/tests/utils/ethers.test.ts
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/components/homeScreen/idCard.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Ensure parseNFCResponse() works with representative, synthetic NFC data

Applied to files:

  • app/tests/utils/ethers.test.ts
  • app/src/screens/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Module mapping `@/` → `src/`, `tests/` → `tests/src/` must be maintained across the project.

Applied to files:

  • app/tests/utils/ethers.test.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/documents/scanning/DocumentNFCTroubleScreen.tsx
  • app/src/screens/documents/selection/DocumentOnboardingScreen.tsx
  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/src/screens/verification/QRCodeTroubleScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/screens/app/SplashScreen.tsx
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/**/*.{ios,android,web}.{ts,tsx,js,jsx} : Explain platform-specific code paths in the PR description (files with .ios, .android, or .web extensions)

Applied to files:

  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/screens/shared/WebViewScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/screens/**/*.{js,ts,tsx,jsx} : Lazy load screens using `React.lazy()`, organize screens by feature modules.

Applied to files:

  • app/src/screens/documents/management/ManageDocumentsScreen.tsx
  • app/src/navigation/devTools.ts
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Write integration tests that exercise the real validation logic (not mocks)

Applied to files:

  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/src/screens/dev/CreateMockScreenDeepLink.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks

Applied to files:

  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/navigation/devTools.ts
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/tests/utils/analytics.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/tests/setup.ts : Provide Vitest setup file at packages/mobile-sdk-alpha/tests/setup.ts to suppress console noise

Applied to files:

  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/src/navigation/devTools.ts
  • app/tests/utils/analytics.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and 'tests/' to 'tests/src/'

Applied to files:

  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to tests/**/*.test.{js,ts,tsx,jsx} : Use `renderHook` for testing custom React hooks.

Applied to files:

  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Use Jest in the app with a React Native preset configured in app/jest.config.cjs

Applied to files:

  • app/tests/src/providers/remoteConfigProvider.test.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to jest.setup.js : Comprehensive mocks for all native modules must be set up in `jest.setup.js`.

Applied to files:

  • app/tests/src/providers/remoteConfigProvider.test.tsx
  • app/tests/src/hooks/useAppUpdates.test.tsx
  • app/tests/src/components/ErrorBoundary.test.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Update the app to consume the mobile-sdk-alpha package and replace local modules with SDK imports

Applied to files:

  • app/src/navigation/devTools.ts
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/layouts/SimpleScrolledTitleLayout.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/screens/app/SplashScreen.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/package.json : Enable tree shaking for the SDK (e.g., ensure 'sideEffects' is correctly set in package.json and exports are ESM-friendly)

Applied to files:

  • app/src/navigation/devTools.ts
  • app/src/screens/app/SplashScreen.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/demo/** : Provide an in-SDK lightweight React Native demo under packages/mobile-sdk-alpha/demo/

Applied to files:

  • app/src/navigation/devTools.ts
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
📚 Learning: 2025-07-16T02:20:44.173Z
Learnt from: transphorm
Repo: selfxyz/self PR: 636
File: app/src/components/native/QRCodeScanner.tsx:135-142
Timestamp: 2025-07-16T02:20:44.173Z
Learning: In app/src/components/native/QRCodeScanner.tsx, the Android camera dimension multipliers (screenWidth * 3 and screenHeight * 2) are intentionally set to these values and should not be changed. These multipliers are correct and any visual issues with black areas in the camera preview are caused by other factors, not the dimension calculations.

Applied to files:

  • app/src/screens/verification/QRCodeTroubleScreen.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to tests/**/*.test.{js,ts,tsx,jsx} : Test error boundaries and recovery mechanisms.

Applied to files:

  • app/tests/src/components/ErrorBoundary.test.tsx
  • app/src/components/ErrorBoundary.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to tests/**/*.test.{js,ts,tsx,jsx} : Mock console.error to avoid test output clutter.

Applied to files:

  • app/tests/src/components/ErrorBoundary.test.tsx
📚 Learning: 2025-07-28T19:18:48.270Z
Learnt from: transphorm
Repo: selfxyz/self PR: 795
File: app/src/screens/prove/ProveScreen.tsx:5-5
Timestamp: 2025-07-28T19:18:48.270Z
Learning: The import path 'selfxyz/common/utils/scope' is valid when the common package has a "./utils/*" export mapping in package.json, even if ESLint shows resolution errors before the package is built. The package.json exports field properly maps "./utils/*" to the compiled files in dist/.

Applied to files:

  • app/src/utils/crypto/cryptoLoader.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Always validate certificates for passport data.

Applied to files:

  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to contracts/contracts/IdentityVerificationHubImplV2.sol : Identity Verification Hub should manage multi-step verification for passports and EU ID cards, handle document attestation with zero-knowledge proofs, and implement verification paths: E-PASSPORT and EU_ID_CARD.

Applied to files:

  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
📚 Learning: 2025-08-26T12:48:14.120Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 951
File: app/src/screens/passport/PassportNFCScanScreen.web.tsx:8-9
Timestamp: 2025-08-26T12:48:14.120Z
Learning: SecondaryButton in the app forwards the trackEvent prop to AbstractButton, which handles analytics integration. SecondaryButton does not need separate trackEvent prop handling as it delegates to AbstractButton.

Applied to files:

  • app/src/screens/account/recovery/DocumentDataNotFoundScreen.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Lazy load screens/components, optimize bundle size, prevent memory leaks in native modules, and ensure resource cleanup.

Applied to files:

  • app/src/screens/dev/DevLoadingScreen.tsx
  • app/src/screens/app/LoadingScreen.tsx
📚 Learning: 2025-08-26T14:42:45.297Z
Learnt from: aaronmgdr
Repo: selfxyz/self PR: 936
File: app/src/utils/proving/validateDocument.ts:53-54
Timestamp: 2025-08-26T14:42:45.297Z
Learning: In the Self app, native modules (including Keychain) are initialized early in the app startup sequence, before functions like checkAndUpdateRegistrationStates() are called, so additional native module readiness guards in document-related functions are not needed.

Applied to files:

  • app/src/screens/app/SplashScreen.tsx
🧬 Code graph analysis (2)
app/src/utils/retry.ts (1)
app/src/services/logging/index.ts (1)
  • AppLogger (73-73)
app/tests/src/components/ErrorBoundary.test.tsx (2)
app/metro.config.cjs (1)
  • require (5-5)
app/scripts/alias-imports.cjs (1)
  • require (6-6)
⏰ 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). (7)
  • GitHub Check: build-deps
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
  • GitHub Check: e2e-ios
  • GitHub Check: android-build-test
  • GitHub Check: ios-e2e
  • GitHub Check: android-e2e

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 (3)
app/tests/src/services/analytics.test.ts (1)

15-233: Tests should verify that analytics events are actually tracked.

The test suite only checks that functions don't throw exceptions, but never verifies that the mocked Segment client methods are called with the correct event names and properties. This means the tests could pass even if the analytics module stopped sending events entirely.

Add assertions to verify mock calls. For example:

+import { createSegmentClient } from '@/config/segment';
+
+const mockTrack = jest.fn();
+const mockScreen = jest.fn();
+
-jest.mock('@/config/segment', () => ({
-  createSegmentClient: jest.fn(() => ({
-    track: jest.fn(),
-    screen: jest.fn(),
-  })),
-}));
+jest.mock('@/config/segment');
+
+(createSegmentClient as jest.Mock).mockReturnValue({
+  track: mockTrack,
+  screen: mockScreen,
+});

 describe('analytics', () => {
   const { trackEvent, trackScreenView } = analytics();

   beforeEach(() => {
     jest.clearAllMocks();
   });

   describe('trackEvent', () => {
     it('should handle basic event tracking without properties', () => {
-      expect(() => trackEvent('test_event')).not.toThrow();
+      trackEvent('test_event');
+      expect(mockTrack).toHaveBeenCalledWith('test_event', {});
     });

     it('should handle event tracking with valid properties', () => {
       const properties = {
         reason: 'test_reason',
         duration_seconds: 1.5,
       };

-      expect(() => trackEvent('test_event', properties)).not.toThrow();
+      trackEvent('test_event', properties);
+      expect(mockTrack).toHaveBeenCalledWith('test_event', expect.objectContaining(properties));
     });

Apply similar patterns to trackScreenView tests to verify mockScreen is called correctly.

app/src/screens/account/settings/SettingsScreen.tsx (2)

88-88: Fix typo in user-facing text.

The text reads "Send feeback" but should be "Send feedback" (missing 'd'). This is displayed in the settings menu on web platforms.

Apply this diff:

-        [Feedback, 'Send feeback', 'email_feedback'],
+        [Feedback, 'Send feedback', 'email_feedback'],

183-185: Add safety check for optional locale properties.

The countryCode property from getLocales() may be undefined for some locales, which would produce strings like "en-undefined" in the feedback email. Consider using the languageTag property instead, which is guaranteed to be present and properly formatted, or add a null check.

Apply this diff to use the built-in languageTag:

               'locales',
-                getLocales()
-                  .map(locale => `${locale.languageCode}-${locale.countryCode}`)
-                  .join(','),
+                getLocales()
+                  .map(locale => locale.languageTag)
+                  .join(','),

Or alternatively, add a safety check:

               'locales',
                 getLocales()
-                  .map(locale => `${locale.languageCode}-${locale.countryCode}`)
+                  .map(locale => 
+                    locale.countryCode 
+                      ? `${locale.languageCode}-${locale.countryCode}`
+                      : locale.languageCode
+                  )
                   .join(','),
🧹 Nitpick comments (4)
app/tests/src/proving/provingUtils.test.ts (1)

9-83: Consider expanding test coverage with edge cases.

The existing tests cover happy paths well, but could benefit from additional test cases for robustness:

  • encryptAES256GCM: Test edge cases like empty strings, very long plaintexts, or invalid key lengths
  • getPayload: Test error conditions such as invalid types, missing required parameters, or null/undefined values
  • getWSDbRelayerUrl: Consider more precise assertions (e.g., exact URL structure) and test invalid endpoint types

These improvements would increase confidence in the utility functions' resilience.

app/tests/src/services/notifications/notificationService.test.ts (2)

25-25: Consider typing the service variable for better type safety.

Using any bypasses type checking. You could import the type from the service module to maintain type safety while still using dynamic requires:

+import type * as NotificationService from '@/services/notifications/notificationService';
+
 describe('notificationService', () => {
-  let service: any; // Using any here since we're dynamically requiring the module in tests
+  let service: typeof NotificationService;

134-148: Consider adding error handling tests for registerDeviceToken.

The test suite for registerDeviceToken only covers the success path. Consider adding tests for error scenarios to match the coverage level of other functions in this file:

  • Network failure (fetch rejection)
  • Non-OK HTTP response
  • Invalid response format

This would improve consistency with the error handling tests present in getFCMToken and requestNotificationPermission.

app/src/components/LoadingUI.tsx (1)

22-22: Minor: SVG filename and color prop might be redundant.

The imported SVG is named plus_slate600.svg and the component passes color={slate600} on line 63. If the color is baked into the SVG file, the prop may have no effect. If the SVG does support color overriding, consider renaming the file to something more generic (e.g., plus.svg) for clarity.

Also applies to: 63-63

📜 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 c598c44 and e123454.

⛔ Files ignored due to path filters (39)
  • app/src/assets/images/512w.png is excluded by !**/*.png
  • app/src/assets/images/blue_check.svg is excluded by !**/*.svg
  • app/src/assets/images/card-dev.svg is excluded by !**/*.svg
  • app/src/assets/images/card-style-1.svg is excluded by !**/*.svg
  • app/src/assets/images/card-style-2.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/activity.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/bug_icon.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/checkmark.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/checkmark_gray.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/close-warning.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/github.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/id_card_placeholder.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/id_icon.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/keyboard.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/logo_cloud_backup.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/modal_close.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/note.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/passport_camera_bulb.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/passport_camera_scan.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/paste.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/plus_slate600.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/qr_code.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/qr_scan.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/restore_account.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/settings.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/settings_cloud_backup.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/settings_data.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/settings_feedback.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/settings_lock.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/share.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/star.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/telegram.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/warning.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/webpage.svg is excluded by !**/*.svg
  • app/src/assets/images/icons/x.svg is excluded by !**/*.svg
  • app/src/assets/images/logo_gray.svg is excluded by !**/*.svg
  • app/src/assets/images/logo_inversed.svg is excluded by !**/*.svg
  • app/src/assets/images/nfc.png is excluded by !**/*.png
  • app/src/assets/images/warning.svg is excluded by !**/*.svg
📒 Files selected for processing (38)
  • app/src/components/Disclosures.tsx (1 hunks)
  • app/src/components/FeedbackModalScreen.tsx (1 hunks)
  • app/src/components/LoadingUI.tsx (2 hunks)
  • app/src/components/NavBar/HomeNavBar.tsx (1 hunks)
  • app/src/components/homeScreen/idCard.tsx (1 hunks)
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx (1 hunks)
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx (1 hunks)
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx (1 hunks)
  • app/src/screens/account/settings/CloudBackupScreen.tsx (1 hunks)
  • app/src/screens/account/settings/SettingsScreen.tsx (3 hunks)
  • app/src/screens/app/LaunchScreen.tsx (1 hunks)
  • app/src/screens/app/ModalScreen.tsx (1 hunks)
  • app/src/screens/dev/CreateMockScreen.tsx (2 hunks)
  • app/src/screens/dev/DevSettingsScreen.tsx (2 hunks)
  • app/src/screens/documents/aadhaar/AadhaarUploadErrorScreen.tsx (1 hunks)
  • app/src/screens/documents/aadhaar/AadhaarUploadScreen.tsx (1 hunks)
  • app/src/screens/documents/aadhaar/AadhaarUploadedSuccessScreen.tsx (1 hunks)
  • app/src/screens/documents/scanning/DocumentCameraScreen.tsx (2 hunks)
  • app/src/screens/documents/scanning/DocumentCameraTroubleScreen.tsx (1 hunks)
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx (2 hunks)
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx (1 hunks)
  • app/src/screens/verification/QRCodeViewFinderScreen.tsx (1 hunks)
  • app/tests/build/android/build.gradle.test.ts (1 hunks)
  • app/tests/build/android/manifest.test.ts (1 hunks)
  • app/tests/build/ios/infoPlist.test.ts (1 hunks)
  • app/tests/build/ios/pbxproj.test.ts (1 hunks)
  • app/tests/src/config/remoteConfig.test.ts (1 hunks)
  • app/tests/src/integrations/nfc/nfcScanner.test.ts (1 hunks)
  • app/tests/src/integrations/nfc/passportReader.test.ts (1 hunks)
  • app/tests/src/navigation/deeplinks.test.ts (2 hunks)
  • app/tests/src/providers/passportDataProvider.test.tsx (1 hunks)
  • app/tests/src/proving/loadingScreenStateText.test.ts (10 hunks)
  • app/tests/src/proving/provingUtils.test.ts (1 hunks)
  • app/tests/src/proving/validateDocument.test.ts (1 hunks)
  • app/tests/src/services/analytics.test.ts (1 hunks)
  • app/tests/src/services/cloud-backup.test.ts (2 hunks)
  • app/tests/src/services/notifications/notificationService.test.ts (2 hunks)
  • app/tests/src/utils/crypto/ethers.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (15)
  • app/src/screens/account/recovery/RecoverWithPhraseScreen.tsx
  • app/src/components/Disclosures.tsx
  • app/src/screens/documents/aadhaar/AadhaarUploadedSuccessScreen.tsx
  • app/src/screens/app/LaunchScreen.tsx
  • app/src/screens/documents/aadhaar/AadhaarUploadScreen.tsx
  • app/src/components/NavBar/HomeNavBar.tsx
  • app/src/screens/documents/scanning/DocumentCameraTroubleScreen.tsx
  • app/src/screens/dev/DevSettingsScreen.tsx
  • app/src/components/FeedbackModalScreen.tsx
  • app/src/screens/documents/aadhaar/AadhaarUploadErrorScreen.tsx
  • app/src/screens/documents/scanning/DocumentCameraScreen.tsx
  • app/src/screens/verification/QRCodeViewFinderScreen.tsx
  • app/src/components/homeScreen/idCard.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.tsx
  • app/src/screens/dev/CreateMockScreen.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,ts,tsx,jsx,sol,nr}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{js,ts,tsx,jsx,sol,nr}: 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/integrations/nfc/nfcScanner.test.ts
  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx
  • app/tests/src/services/analytics.test.ts
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/build/android/build.gradle.test.ts
  • app/tests/src/utils/crypto/ethers.test.ts
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/src/proving/provingUtils.test.ts
  • app/tests/build/ios/infoPlist.test.ts
  • app/tests/src/config/remoteConfig.test.ts
  • app/src/components/LoadingUI.tsx
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Type checking must pass before PRs (yarn types)

Files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx
  • app/tests/src/services/analytics.test.ts
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/build/android/build.gradle.test.ts
  • app/tests/src/utils/crypto/ethers.test.ts
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/src/proving/provingUtils.test.ts
  • app/tests/build/ios/infoPlist.test.ts
  • app/tests/src/config/remoteConfig.test.ts
  • app/src/components/LoadingUI.tsx
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.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/integrations/nfc/nfcScanner.test.ts
  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/tests/src/services/analytics.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/build/android/build.gradle.test.ts
  • app/tests/src/utils/crypto/ethers.test.ts
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/src/proving/provingUtils.test.ts
  • app/tests/build/ios/infoPlist.test.ts
  • app/tests/src/config/remoteConfig.test.ts
app/src/**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:

  • Component architecture and reusability
  • State management patterns
  • Performance optimizations
  • TypeScript type safety
  • React hooks usage and dependencies
  • Navigation patterns

Files:

  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/src/screens/app/ModalScreen.tsx
  • app/src/components/LoadingUI.tsx
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
app/**/*.{ios,android,web}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Explain platform-specific code paths in the PR description (files with .ios, .android, or .web extensions)

Files:

  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
🧠 Learnings (44)
📓 Common learnings
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/utils/**/*.{js,ts,tsx,jsx} : Shared utilities should be placed under `@/utils`.
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/ios/**/*.{m,mm,swift} : Document complex native iOS module changes in the PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/crypto/** : Place crypto adapters and utilities in packages/mobile-sdk-alpha/src/crypto/
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/artifacts/** : Place artifact and manifest management in packages/mobile-sdk-alpha/src/artifacts/
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/android/**/*.{kt,java} : Document complex native Android module changes in the PR
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Update the app to consume the mobile-sdk-alpha package and replace local modules with SDK imports
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Use actual imports from selfxyz/mobile-sdk-alpha in tests
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/**/*.{ios,android,web}.{ts,tsx,js,jsx} : Explain platform-specific code paths in the PR description (files with .ios, .android, or .web extensions)
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Ensure parseNFCResponse() works with representative, synthetic NFC data

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Use actual imports from selfxyz/mobile-sdk-alpha in tests

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx
  • app/tests/src/services/analytics.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/build/android/build.gradle.test.ts
  • app/tests/src/utils/crypto/ethers.test.ts
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/src/proving/provingUtils.test.ts
  • app/tests/build/ios/infoPlist.test.ts
  • app/tests/src/config/remoteConfig.test.ts
  • app/src/components/LoadingUI.tsx
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Verify extractMRZInfo() using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Test isPassportDataValid() with realistic synthetic passport data (never real user data)

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Write integration tests that exercise the real validation logic (not mocks)

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/src/services/analytics.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.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/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx
  • app/tests/src/services/analytics.test.ts
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/build/android/build.gradle.test.ts
  • app/tests/src/utils/crypto/ethers.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/build/ios/infoPlist.test.ts
  • app/tests/src/config/remoteConfig.test.ts
  • app/src/components/LoadingUI.tsx
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Do NOT mock selfxyz/mobile-sdk-alpha in tests (avoid jest.mock('selfxyz/mobile-sdk-alpha') and replacing real functions with mocks)

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/tests/src/services/analytics.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/src/utils/crypto/ethers.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/src/config/remoteConfig.test.ts
  • app/src/components/LoadingUI.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/{**/*.test.{ts,tsx},**/__tests__/**/*.{ts,tsx}} : Never use real user PII in tests; use only synthetic, anonymized, or approved test vectors

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/tests/src/services/analytics.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/src/utils/crypto/ethers.test.ts
  • app/tests/src/proving/loadingScreenStateText.test.ts
  • app/tests/src/integrations/nfc/passportReader.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/src/config/remoteConfig.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/src/screens/account/recovery/AccountRecoveryScreen.tsx
  • app/src/screens/app/ModalScreen.tsx
  • app/src/components/LoadingUI.tsx
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.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/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Always check `Platform.OS` before running any platform-specific code; use different implementations and tests as required.

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Always use `@/` for src imports and `tests/` for test imports; prefer platform-specific imports with conditional rendering.

Applied to files:

  • app/tests/src/integrations/nfc/nfcScanner.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/src/screens/account/settings/SettingsScreen.tsx
  • app/tests/build/android/build.gradle.test.ts
  • app/tests/build/ios/infoPlist.test.ts
  • app/tests/src/config/remoteConfig.test.ts
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/ios/**/*.{m,mm,swift} : Document complex native iOS module changes in the PR

Applied to files:

  • app/tests/build/ios/pbxproj.test.ts
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/src/screens/app/ModalScreen.tsx
  • app/tests/build/ios/infoPlist.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/tests/setup.ts : Provide Vitest setup file at packages/mobile-sdk-alpha/tests/setup.ts to suppress console noise

Applied to files:

  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/tests/build/ios/infoPlist.test.ts
  • app/tests/src/config/remoteConfig.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Test, build, and deploy scripts (`yarn test`, `yarn ios`, `yarn test:e2e:ios`, Fastlane, etc.) must be used for automation.

Applied to files:

  • app/tests/build/ios/pbxproj.test.ts
📚 Learning: 2025-08-02T23:53:45.928Z
Learnt from: transphorm
Repo: selfxyz/self PR: 823
File: app/ios/Self.xcodeproj/project.pbxproj:320-332
Timestamp: 2025-08-02T23:53:45.928Z
Learning: When reviewing autogenerated scripts in Xcode project files (like React Native Firebase's embedded shell scripts), avoid suggesting edits since these are regenerated during pod install and cannot be manually modified by users.

Applied to files:

  • app/tests/build/ios/pbxproj.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Module mapping `@/` → `src/`, `tests/` → `tests/src/` must be maintained across the project.

Applied to files:

  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/tests/build/android/build.gradle.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/src/config/remoteConfig.test.ts
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/**/*.{ios,android,web}.{ts,tsx,js,jsx} : Explain platform-specific code paths in the PR description (files with .ios, .android, or .web extensions)

Applied to files:

  • app/tests/build/ios/pbxproj.test.ts
  • app/tests/build/android/manifest.test.ts
  • app/tests/build/android/build.gradle.test.ts
  • app/tests/build/ios/infoPlist.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/navigation/**/*.{js,ts,tsx,jsx} : Platform-specific initial routes: web uses 'Home', mobile uses 'Splash'.

Applied to files:

  • app/tests/src/navigation/deeplinks.test.ts
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Avoid introducing circular dependencies

Applied to files:

  • app/tests/src/navigation/deeplinks.test.ts
  • app/src/screens/app/ModalScreen.tsx
  • app/tests/src/config/remoteConfig.test.ts
  • app/src/components/LoadingUI.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks

Applied to files:

  • app/tests/src/navigation/deeplinks.test.ts
  • app/tests/src/services/analytics.test.ts
  • app/tests/src/proving/validateDocument.test.ts
  • app/tests/src/services/notifications/notificationService.test.ts
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/src/integrations/nfc/passportReader.test.ts
  • app/tests/src/services/cloud-backup.test.ts
📚 Learning: 2025-09-22T11:10:57.879Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Applies to app/android/**/*.{kt,java} : Document complex native Android module changes in the PR

Applied to files:

  • app/tests/build/android/manifest.test.ts
  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/src/screens/app/ModalScreen.tsx
  • app/tests/build/android/build.gradle.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to tests/src/**/* : Test files must mirror the source structure under `tests/src/`.

Applied to files:

  • app/tests/build/android/manifest.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/**/*.{js,ts,tsx,jsx} : Use `react-navigation/native` with `createStaticNavigation` for type-safe navigation in React Native.

Applied to files:

  • app/src/screens/account/settings/SettingsScreen.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/account/settings/SettingsScreen.tsx
  • app/src/components/LoadingUI.tsx
📚 Learning: 2025-07-16T02:20:44.173Z
Learnt from: transphorm
Repo: selfxyz/self PR: 636
File: app/src/components/native/QRCodeScanner.tsx:135-142
Timestamp: 2025-07-16T02:20:44.173Z
Learning: In app/src/components/native/QRCodeScanner.tsx, the Android camera dimension multipliers (screenWidth * 3 and screenHeight * 2) are intentionally set to these values and should not be changed. These multipliers are correct and any visual issues with black areas in the camera preview are caused by other factors, not the dimension calculations.

Applied to files:

  • app/src/screens/documents/scanning/DocumentNFCScanScreen.web.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/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/tests/src/providers/passportDataProvider.test.tsx
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.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/documents/scanning/DocumentNFCScanScreen.web.tsx
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and 'tests/' to 'tests/src/'

Applied to files:

  • app/tests/src/services/notifications/notificationService.test.ts
  • app/tests/src/services/cloud-backup.test.ts
  • app/tests/src/config/remoteConfig.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to jest.setup.js : Comprehensive mocks for all native modules must be set up in `jest.setup.js`.

Applied to files:

  • app/tests/src/services/notifications/notificationService.test.ts
  • app/tests/src/services/cloud-backup.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Use Jest in the app with a React Native preset configured in app/jest.config.cjs

Applied to files:

  • app/tests/src/services/notifications/notificationService.test.ts
  • app/tests/src/config/remoteConfig.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Update the app to consume the mobile-sdk-alpha package and replace local modules with SDK imports

Applied to files:

  • app/src/screens/app/ModalScreen.tsx
  • app/src/components/LoadingUI.tsx
📚 Learning: 2025-08-29T15:31:15.924Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: packages/mobile-sdk-alpha/AGENTS.md:0-0
Timestamp: 2025-08-29T15:31:15.924Z
Learning: Applies to packages/mobile-sdk-alpha/**/*.{ts,tsx} : Use strict TypeScript type checking across the codebase

Applied to files:

  • app/src/screens/app/ModalScreen.tsx
  • app/src/components/LoadingUI.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to src/screens/**/*.{js,ts,tsx,jsx} : Lazy load screens using `React.lazy()`, organize screens by feature modules.

Applied to files:

  • app/src/screens/app/ModalScreen.tsx
  • app/src/components/LoadingUI.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/tests/src/providers/passportDataProvider.test.tsx
  • app/tests/src/integrations/nfc/passportReader.test.ts
📚 Learning: 2025-07-29T01:08:28.530Z
Learnt from: transphorm
Repo: selfxyz/self PR: 795
File: app/android/app/build.gradle:157-158
Timestamp: 2025-07-29T01:08:28.530Z
Learning: For this React Native project, the team prefers build flexibility over fail-fast behavior for release builds in app/android/app/build.gradle. They intentionally allow fallback to debug signing for local development runs, relying on Google Play Console validation to catch any improperly signed releases during upload.

Applied to files:

  • app/tests/build/android/build.gradle.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to contracts/contracts/IdentityVerificationHubImplV2.sol : Identity Verification Hub should manage multi-step verification for passports and EU ID cards, handle document attestation with zero-knowledge proofs, and implement verification paths: E-PASSPORT and EU_ID_CARD.

Applied to files:

  • app/tests/src/integrations/nfc/passportReader.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to tests/**/*.test.{js,ts,tsx,jsx} : Test error boundaries and recovery mechanisms.

Applied to files:

  • app/tests/src/integrations/nfc/passportReader.test.ts
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Applies to tests/**/*.test.{js,ts,tsx,jsx} : Use `renderHook` for testing custom React hooks.

Applied to files:

  • app/tests/src/services/cloud-backup.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/src/proving/** : Place proof input generation in packages/mobile-sdk-alpha/src/proving/

Applied to files:

  • app/tests/src/proving/provingUtils.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/vitest.config.ts : Use Vitest in the SDK with a Node environment configured in packages/mobile-sdk-alpha/vitest.config.ts

Applied to files:

  • app/tests/src/config/remoteConfig.test.ts
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to packages/mobile-sdk-alpha/package.json : Enable tree shaking for the SDK (e.g., ensure 'sideEffects' is correctly set in package.json and exports are ESM-friendly)

Applied to files:

  • app/src/components/LoadingUI.tsx
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
Repo: selfxyz/self PR: 0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Lazy load screens/components, optimize bundle size, prevent memory leaks in native modules, and ensure resource cleanup.

Applied to files:

  • app/src/components/LoadingUI.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: build-deps
  • GitHub Check: e2e-ios
  • GitHub Check: ios-e2e
  • GitHub Check: android-e2e
  • GitHub Check: analyze-ios
  • GitHub Check: analyze-android
🔇 Additional comments (31)
app/src/screens/app/ModalScreen.tsx (1)

16-20: Import path refactoring looks clean.

The reorganization of imports aligns well with the PR objectives:

  • Color constants centralized to the SDK package
  • Assets relocated to the proper @/assets directory
  • Haptics moved to the dedicated @/integrations module

Since all build and test commands passed, the path aliases are correctly configured.

app/tests/src/utils/crypto/ethers.test.ts (1)

8-8: Clean refactor aligning with the new crypto namespace.

The import path update correctly reflects the reorganization of crypto utilities. The test suite validates the polyfills using proper test vectors and synthetic data.

app/tests/src/navigation/deeplinks.test.ts (2)

37-37: LGTM! Import path correctly updated.

The import path change from @/utils/deeplinks to @/navigation/deeplinks aligns with the PR's module reorganization objectives.


350-375: LGTM! Thorough edge-case testing with correct import path.

The import path update is correct, and this test case demonstrates excellent defensive programming by testing the handling of non-string parameter values from query-string parsing.

app/tests/src/proving/provingUtils.test.ts (1)

7-7: LGTM! Import path updated correctly.

The refactored import path from @/utils/proving to @/proving aligns with the PR's objective to reorganize utilities into dedicated modules.

app/tests/build/ios/infoPlist.test.ts (1)

13-13: Path adjustment looks correct.

The update from two to three directory levels up aligns with the test file's location and correctly points to the iOS Info.plist file. Since tests have passed, this confirms the path is valid.

app/tests/build/ios/pbxproj.test.ts (1)

13-16: Path adjustment validated by passing tests.

The relative path update correctly reflects the restructured directory layout. Since the test suite passed, the path resolution is confirmed correct.

app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx (3)

23-28: LGTM! Color constants migration looks good.

The import path has been successfully migrated to the centralized SDK constants. All imported colors (black, slate500, slate600, white) are used appropriately throughout the component.


30-31: LGTM! Asset import paths updated correctly.

The migration from @/images/icons/ to @/assets/images/icons/ aligns with the PR's asset reorganization objectives.


40-40: LGTM! Cloud backup service extraction is clean.

The migration from @/utils/cloudBackup to @/services/cloud-backup properly extracts cloud backup functionality into the services layer. The imported exports (STORAGE_NAME, useBackupMnemonic) remain functionally identical.

app/src/screens/account/recovery/AccountRecoveryScreen.tsx (2)

15-19: LGTM! Color constants migration is consistent.

The import path migration to @selfxyz/mobile-sdk-alpha/constants/colors is correct and consistent with the broader refactoring pattern across the codebase.


21-21: LGTM! Asset import path updated correctly.

The migration to @/assets/images/icons/restore_account.svg aligns with the asset reorganization strategy.

app/tests/src/config/remoteConfig.test.ts (1)

16-16: LGTM! Import path correctly updated.

The migration from @/RemoteConfig to @/config/remoteConfig aligns with the PR's module reorganization. Test coverage and logic remain intact.

app/tests/src/proving/validateDocument.test.ts (2)

13-13: LGTM! Import path correctly updated.

The migration from @/utils/proving/validateDocument to @/proving/validateDocument aligns with the proving pipeline restructuring. Test logic and coverage remain unchanged.


17-17: LGTM! Mock path correctly updated.

The migration from @/utils/analytics to @/services/analytics aligns with moving analytics into the services directory. Mock implementation remains appropriate.

app/tests/src/services/analytics.test.ts (1)

5-5: Import paths correctly updated for module reorganization.

The analytics and Segment mock import paths have been properly updated to reflect the new module structure (@/services/analytics and @/config/segment).

Also applies to: 8-8

app/tests/src/providers/passportDataProvider.test.tsx (1)

17-17: LGTM! Clean test setup refactor.

Import path updated to reference centralized test setup location. No test logic changes, coverage remains comprehensive.

app/tests/src/integrations/nfc/passportReader.test.ts (1)

10-10: LGTM! NFC integration path updated.

Import moved to dedicated integrations namespace as part of project restructuring. Contract tests remain unchanged and continue to verify critical native module interface requirements.

app/tests/src/integrations/nfc/nfcScanner.test.ts (1)

7-8: LGTM! NFC scanner imports aligned with new structure.

Both imports updated to reference the integrations namespace. Test coverage for platform-specific NFC scanning logic, error handling, and edge cases remains comprehensive and unchanged.

app/tests/src/services/notifications/notificationService.test.ts (1)

7-7: Path migration looks correct.

The updates to reference @/services/notifications/notificationService instead of the previous @/utils path are consistent with the PR's module reorganization objectives.

Also applies to: 33-33

app/src/components/LoadingUI.tsx (2)

10-19: LGTM - SDK import consolidation looks good.

The consolidated imports from @selfxyz/mobile-sdk-alpha align with the PR's architectural goals of centralizing utilities and constants. All imported entities are used correctly throughout the component.


23-23: LGTM - Semantic improvement.

Moving extraYPadding from @/utils/constants to @/utils/styleUtils is a good organizational change that better reflects its purpose as a style-related utility.

app/tests/build/android/manifest.test.ts (1)

15-15: LGTM - Path updated correctly for restructured test directory.

The path adjustment from ../../android/... to ../../../android/app/src/main/AndroidManifest.xml is consistent with the broader test directory reorganization in this PR.

app/tests/build/android/build.gradle.test.ts (1)

13-14: LGTM - Gradle paths updated correctly.

The path adjustments to ../../../android/app/build.gradle and ../../../android/build.gradle are consistent with the test directory restructuring and align with the parallel changes in manifest.test.ts.

app/src/screens/account/settings/SettingsScreen.tsx (1)

9-9: Import path refactoring looks correct.

All import path changes align with the PR's reorganization objectives: colors centralized to the mobile SDK, icons moved to assets, haptics to integrations, and style utils properly referenced. The mechanical refactoring maintains existing functionality.

Also applies to: 18-24, 26-35, 44-44, 46-46

app/tests/src/services/cloud-backup.test.ts (1)

12-13: Clean refactoring with comprehensive test coverage maintained.

The import path updates from @/utils/cloudBackup to @/services/cloud-backup are consistent and correct. The test suite provides excellent coverage of both iOS (iCloud) and Android (Google Drive) implementations, including comprehensive error handling for edge cases (empty/null mnemonics, permission errors, user cancellation, malformed JSON, invalid BIP39 phrases, and missing properties).

Also applies to: 40-41

app/src/screens/documents/scanning/DocumentNFCScanScreen.web.tsx (3)

20-24: LGTM! Color imports properly centralized.

The refactoring to import colors from the mobile-sdk-alpha package aligns with the PR's objective to centralize constants and follows the established SDK structure.


26-26: Asset path refactoring looks correct.

The updated path is consistent with the project reorganization moving assets to the dedicated @/assets directory.


69-74: ****

The analytics event naming is correct and consistent. PassportEvents.CANCEL_PASSPORT_NFC is the appropriate constant here because:

  • PassportEvents is deliberately scoped for passport-specific operations: NFC scanning, camera scanning, parsing, etc.
  • DocumentEvents is scoped for document lifecycle operations: selection, deletion, validation, metadata loading
  • CANCEL_PASSPORT_NFC is explicitly defined in PassportEvents and used consistently across all NFC-related screens (DocumentNFCScanScreen.tsx, DocumentNFCScanScreen.web.tsx)
  • DocumentEvents contains no NFC-specific or equivalent cancel events

This architectural separation is intentional and working as designed.

Likely an incorrect or invalid review comment.

app/src/screens/account/settings/CloudBackupScreen.tsx (2)

41-177: Import refactoring looks good - component logic unchanged.

The component logic remains intact with only import paths updated. The security-sensitive operations (biometrics, mnemonic handling) and state management patterns are unchanged, which is appropriate for a pure refactoring PR.


20-20: All import paths are correctly configured and resolve with expected exports.

Verification confirms:

  • @selfxyz/mobile-sdk-alpha/constants/colors exports black and white via explicit subpath export in package.json
  • @/assets/images/icons/logo_cloud_backup.svg exists and resolves correctly
  • @/integrations/haptics exports buttonTap and confirmTap
  • @/services/cloud-backup exports STORAGE_NAME and useBackupMnemonic hook

All symbols match their usage throughout the component, type signatures are compatible, and the TypeScript build passing confirms no resolution issues.

@transphorm
Copy link
Member Author

@coderabbitai summary

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 8, 2025

✅ Actions performed

Summary regeneration triggered.

@transphorm transphorm changed the title Refactor app utils into lib, services, and integrations Reorganize mobile app and test folders Nov 8, 2025
@transphorm transphorm changed the title Reorganize mobile app and test folders Reorganize mobile app /src and /tests folders Nov 8, 2025
@transphorm transphorm marked this pull request as draft November 9, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants