Skip to content

Conversation

@seshanthS
Copy link
Collaborator

@seshanthS seshanthS commented Nov 11, 2025

Note

Patches @turnkey/core to safely handle keychain cleanup and adds Turnkey backup/recovery support with UI, state, and dependency updates.

  • Turnkey patch and tooling:
    • Patch @turnkey/[email protected] to filter non-Turnkey keys before deletion in dist/__clients__/core.(js|mjs).
    • Enhance scripts/run-patch-package.cjs to apply patches in the app workspace as well.
  • Features/UI:
    • Enable Turnkey backup and recovery options in AccountRecoveryChoiceScreen.tsx and CloudBackupScreen.tsx (buttons, flows, continue logic).
    • Update Points.tsx to award backup points when either cloudBackupEnabled or turnkeyBackupEnabled is set.
    • Adjust onboarding copy and actions in SaveRecoveryPhraseScreen.tsx to include Turnkey backups.
  • State management:
    • Replace backedUpWithTurnKey with turnkeyBackupEnabled in useSettingStore and all usages.
    • Update useTurnkeyUtils to set/consume turnkeyBackupEnabled and refine backup/restore behaviors.
  • Dependencies:
    • Add @turnkey/[email protected]; bump @turnkey/react-native-wallet-kit to 1.1.5 (transitive Turnkey package updates).
  • Tests:
    • Improve nfcScanner.test.ts by refactoring Platform mock to avoid test pollution and resetting per test.

Written by Cursor Bugbot for commit 958c0de. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • New Features

    • Enabled Turnkey-based account recovery and backup functionality
    • Updated UI messaging to reflect Turnkey backup options alongside cloud backups in settings and onboarding screens
  • Dependencies

    • Updated Turnkey packages to support enhanced recovery features

remicolin and others added 30 commits October 27, 2025 15:28
- Introduced ReferralScreen for sharing referral links via messages, WhatsApp, and clipboard.
- Updated navigation to include ReferralScreen in the home stack.
- Added new icons for sharing and messaging.
- Enhanced points utility functions to check user identity document registration and points disclosure status.
- Minor adjustments to existing components for better integration with the new referral feature.
- Added `@react-native-masked-view/masked-view` and `react-native-linear-gradient` to dependencies for improved UI components.
- Refactored `PointHistoryList` to accept `ListHeaderComponent` and `onRefreshRef` props for better integration with parent components.
- Enhanced `Points` component to manage notification and backup point events, including user feedback through modals.
- Updated navigation to use `PointsNavBar` for a more cohesive user experience.
- Introduced new utility functions for managing incoming points and point event records.
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

📜 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 2f2045a and 0e418de.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • app/package.json (1 hunks)
  • app/tests/utils/proving/provingUtils.test.ts (1 hunks)
  • patches/@turnkey+core+1.7.0.patch (1 hunks)
  • scripts/run-patch-package.cjs (1 hunks)
🧰 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/utils/proving/provingUtils.test.ts
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Type checking must pass before PRs (yarn types)

Files:

  • app/tests/utils/proving/provingUtils.test.ts
**/*.{test,spec}.{ts,js,tsx,jsx}

⚙️ CodeRabbit configuration file

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

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

Files:

  • app/tests/utils/proving/provingUtils.test.ts
app/package.json

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

Expose a 'test:build' script in the app's package.json that builds deps, types, performs bundle analysis, and runs tests

Files:

  • app/package.json
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use Yarn only for package management (yarn install/add/remove); do not use npm or pnpm in scripts

Files:

  • app/package.json
🧠 Learnings (3)
📚 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/proving/provingUtils.test.ts
📚 Learning: 2025-09-10T14:47:40.945Z
Learnt from: shazarre
Repo: selfxyz/self PR: 1041
File: app/src/providers/passportDataProvider.tsx:297-301
Timestamp: 2025-09-10T14:47:40.945Z
Learning: In app/src/providers/passportDataProvider.tsx: The deleteDocumentDirectlyFromKeychain function is a low-level utility used by the DocumentsAdapter and should not include error handling since callers like deleteDocument() already implement appropriate try/catch with logging for Keychain operations.

Applied to files:

  • patches/@turnkey+core+1.7.0.patch
📚 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/package.json
⏰ 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: build-deps
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios

Comment on lines +117 to +130
// Also patch app/node_modules if it exists
const appPath = path.join(repositoryRootPath, 'app');
const appNodeModules = path.join(appPath, 'node_modules');
if (fs.existsSync(appNodeModules)) {
const appPatchRun = spawnSync('patch-package', ['--patch-dir', '../patches'], {
cwd: appPath,
shell: true,
stdio: isCI ? 'pipe' : 'inherit',
timeout: 30000
});
if (appPatchRun.status === 0 && !isCI) {
console.log('✓ Patches applied to app workspace');
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fail fast when the app workspace patch step fails.

We ignore non-zero exit codes from the app-level patch-package run, so the script exits 0 even when the Turnkey patch never lands. In CI this swallows stdout/stderr, and locally we keep running after a failed patch—meaning the keychain-delete regression quietly comes back. Please surface failures the same way as the top-level run.

   if (fs.existsSync(appNodeModules)) {
     const appPatchRun = spawnSync('patch-package', ['--patch-dir', '../patches'], {
       cwd: appPath,
       shell: true,
       stdio: isCI ? 'pipe' : 'inherit',
       timeout: 30000
     });
-    if (appPatchRun.status === 0 && !isCI) {
-      console.log('✓ Patches applied to app workspace');
-    }
+    if (appPatchRun.status !== 0) {
+      if (isCI) {
+        console.log('patch-package: failed to apply app workspace patches (CI mode)');
+        console.log('stdout:', appPatchRun.stdout?.toString());
+        console.log('stderr:', appPatchRun.stderr?.toString());
+        console.log('Continuing build despite app patch failures...');
+      } else {
+        console.error('patch-package failed for app workspace with exit code:', appPatchRun.status);
+        process.exit(appPatchRun.status || 1);
+      }
+    } else if (!isCI) {
+      console.log('✓ Patches applied to app workspace');
+    }
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Also patch app/node_modules if it exists
const appPath = path.join(repositoryRootPath, 'app');
const appNodeModules = path.join(appPath, 'node_modules');
if (fs.existsSync(appNodeModules)) {
const appPatchRun = spawnSync('patch-package', ['--patch-dir', '../patches'], {
cwd: appPath,
shell: true,
stdio: isCI ? 'pipe' : 'inherit',
timeout: 30000
});
if (appPatchRun.status === 0 && !isCI) {
console.log('✓ Patches applied to app workspace');
}
}
// Also patch app/node_modules if it exists
const appPath = path.join(repositoryRootPath, 'app');
const appNodeModules = path.join(appPath, 'node_modules');
if (fs.existsSync(appNodeModules)) {
const appPatchRun = spawnSync('patch-package', ['--patch-dir', '../patches'], {
cwd: appPath,
shell: true,
stdio: isCI ? 'pipe' : 'inherit',
timeout: 30000
});
if (appPatchRun.status !== 0) {
if (isCI) {
console.log('patch-package: failed to apply app workspace patches (CI mode)');
console.log('stdout:', appPatchRun.stdout?.toString());
console.log('stderr:', appPatchRun.stderr?.toString());
console.log('Continuing build despite app patch failures...');
} else {
console.error('patch-package failed for app workspace with exit code:', appPatchRun.status);
process.exit(appPatchRun.status || 1);
}
} else if (!isCI) {
console.log('✓ Patches applied to app workspace');
}
}
🤖 Prompt for AI Agents
In scripts/run-patch-package.cjs around lines 117 to 130, the app-level
patch-package invocation ignores non-zero exit codes so failures are swallowed;
change the logic to mirror the top-level run by checking appPatchRun.status and
on non-zero exit print the captured stdout/stderr (when isCI) or allow
inheriting output (when not CI), log a clear error message and call
process.exit(appPatchRun.status) to fail fast; keep the same spawn options
(shell, timeout, stdio conditional on isCI) and only print the success message
when status is 0 and not CI.

@transphorm
Copy link
Member

verified that Turnkey works with android. was not able to verify e2e with iOS due to a deeplink OAuth issue. confident iOS will work with a test build 🤞

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 1568a30 and ae48a49.

📒 Files selected for processing (2)
  • app/tests/src/components/ErrorBoundary.test.tsx (1 hunks)
  • patches/@turnkey+core+1.7.0.patch (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 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/tests/src/components/ErrorBoundary.test.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Type checking must pass before PRs (yarn types)

Files:

  • app/tests/src/components/ErrorBoundary.test.tsx
**/*.{test,spec}.{ts,js,tsx,jsx}

⚙️ CodeRabbit configuration file

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

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

Files:

  • app/tests/src/components/ErrorBoundary.test.tsx
🧠 Learnings (6)
📚 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
📚 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-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/components/ErrorBoundary.test.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/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: 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/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: Applies to app/jest.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks

Applied to files:

  • app/tests/src/components/ErrorBoundary.test.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). (7)
  • GitHub Check: type-check
  • GitHub Check: test-common
  • GitHub Check: android-build-test
  • GitHub Check: build-deps
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-ios
  • GitHub Check: analyze-android

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 ae48a49 and f22584c.

📒 Files selected for processing (2)
  • app/jest.config.cjs (1 hunks)
  • app/src/screens/account/settings/CloudBackupScreen.tsx (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/screens/account/settings/CloudBackupScreen.tsx
🧰 Additional context used
📓 Path-based instructions (1)
app/jest.config.cjs

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

app/jest.config.cjs: Use Jest in the app with a React Native preset configured in app/jest.config.cjs
Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and '@tests/' to 'tests/src/'

Files:

  • app/jest.config.cjs
🧠 Learnings (5)
📚 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/jest.config.cjs
📚 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/jest.config.cjs
📚 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/jest.config.cjs
📚 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/jest.config.cjs
📚 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/jest.config.cjs
⏰ 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: build-deps
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios

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

♻️ Duplicate comments (2)
app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx (1)

199-204: Critical: Biometrics warning condition inverted.

The condition displays "Your device doesn't support biometrics" when biometricsAvailable is true. This is backward—it should be !biometricsAvailable to warn users when biometrics are unavailable.

Apply this fix:

-          {biometricsAvailable && (
+          {!biometricsAvailable && (
             <>
               Your device doesn't support biometrics or is disabled for apps
               and is required for cloud storage.
             </>
           )}
app/src/stores/settingStore.ts (1)

27-28: Critical: Missing migration for renamed persisted state key

Renaming backedUpWithTurnKey to turnkeyBackupEnabled breaks existing users' backup status. Users who previously backed up with Turnkey have backedUpWithTurnKey: true in AsyncStorage, but the app now reads turnkeyBackupEnabled, defaulting to false. This causes the app to incorrectly show they haven't backed up, potentially allowing duplicate backups and incorrect point awards.

Add migration logic in the onRehydrateStorage callback or use a version/migration system:

     {
       name: 'setting-storage',
       storage: createJSONStorage(() => AsyncStorage),
-      onRehydrateStorage: () => undefined,
+      onRehydrateStorage: () => (state) => {
+        // Migrate backedUpWithTurnKey to turnkeyBackupEnabled
+        if (state && 'backedUpWithTurnKey' in state) {
+          state.turnkeyBackupEnabled = (state as any).backedUpWithTurnKey;
+          delete (state as any).backedUpWithTurnKey;
+        }
+      },
       partialize: state => {
🧹 Nitpick comments (3)
app/tests/utils/nfcScanner.test.ts (2)

10-18: Clean Platform stub approach that resolves memory issues.

The lightweight mock successfully avoids loading the full react-native module. For consistency with the pattern used in packages/mobile-sdk-demo/tests/mocks/react-native.ts, consider adding a select method to the Platform stub, even though it's not currently used in these tests.

Optional enhancement:

 const Platform = {
   OS: 'ios', // Default to iOS
   Version: 14,
+  select<T>(mapping: Record<string, T> & { default?: T }): T {
+    if (Object.prototype.hasOwnProperty.call(mapping, Platform.OS)) {
+      return mapping[Platform.OS] as T;
+    }
+    if (Object.prototype.hasOwnProperty.call(mapping, 'default')) {
+      return mapping.default as T;
+    }
+    return Object.values(mapping)[0] as T;
+  },
 };

50-74: Direct assignment pattern works well with the mutable stub.

The save-override-restore pattern is clean and appropriate. For slightly more robust cleanup across all tests that override Platform.OS, consider using afterEach to restore the original value, though the current approach is acceptable for these test scenarios.

app/tests/utils/notificationService.test.ts (1)

19-40: Use const for immutable mock objects.

The Platform and PermissionsAndroid objects are never reassigned, yet they're declared with let. Declare them as const to follow best practices and satisfy linting rules.

Apply this diff:

-let PermissionsAndroid: any;
-let Platform: any;
+const PermissionsAndroid: any = {
+  request: jest.fn(),
+  PERMISSIONS: {
+    POST_NOTIFICATIONS: 'post',
+  },
+  RESULTS: {
+    GRANTED: 'granted',
+    DENIED: 'denied',
+    NEVER_ASK_AGAIN: 'never_ask_again',
+  },
+};
 
 global.fetch = jest.fn();
 
 // Mock Platform and PermissionsAndroid without requiring react-native to avoid memory issues
-Platform = {
+const Platform = {
   OS: 'ios',
   Version: 14,
 };
-
-PermissionsAndroid = {
-  request: jest.fn(),
-  PERMISSIONS: {
-    POST_NOTIFICATIONS: 'post',
-  },
-  RESULTS: {
-    GRANTED: 'granted',
-    DENIED: 'denied',
-    NEVER_ASK_AGAIN: 'never_ask_again',
-  },
-};
📜 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 f22584c and 741aeb1.

📒 Files selected for processing (12)
  • app/jest.setup.js (7 hunks)
  • app/src/components/NavBar/Points.tsx (3 hunks)
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx (4 hunks)
  • app/src/screens/account/settings/CloudBackupScreen.tsx (9 hunks)
  • app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx (2 hunks)
  • app/src/stores/settingStore.ts (2 hunks)
  • app/src/utils/turnkey.ts (5 hunks)
  • app/tests/__mocks__/mobile-sdk-components.js (2 hunks)
  • app/tests/src/screens/GratificationScreen.test.tsx (1 hunks)
  • app/tests/src/screens/WebViewScreen.test.tsx (1 hunks)
  • app/tests/utils/nfcScanner.test.ts (5 hunks)
  • app/tests/utils/notificationService.test.ts (1 hunks)
🧰 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/__mocks__/mobile-sdk-components.js
  • app/src/components/NavBar/Points.tsx
  • app/tests/utils/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.test.ts
  • app/src/stores/settingStore.ts
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
  • app/src/utils/turnkey.ts
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (app/AGENTS.md)

Type checking must pass before PRs (yarn types)

Files:

  • app/src/components/NavBar/Points.tsx
  • app/tests/utils/nfcScanner.test.ts
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.test.ts
  • app/src/stores/settingStore.ts
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
  • app/src/utils/turnkey.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/components/NavBar/Points.tsx
  • app/src/stores/settingStore.ts
  • app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx
  • app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx
  • app/src/screens/account/settings/CloudBackupScreen.tsx
  • app/src/utils/turnkey.ts
**/*.{test,spec}.{ts,js,tsx,jsx}

⚙️ CodeRabbit configuration file

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

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

Files:

  • app/tests/utils/nfcScanner.test.ts
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.test.ts
app/jest.setup.js

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

Provide comprehensive Jest setup in app/jest.setup.js with required mocks

Files:

  • app/jest.setup.js
🧠 Learnings (29)
📚 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/__mocks__/mobile-sdk-components.js
  • app/tests/utils/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.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}} : 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/__mocks__/mobile-sdk-components.js
  • app/tests/utils/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.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}} : Never use real user PII in tests; use only synthetic, anonymized, or approved test vectors

Applied to files:

  • app/tests/__mocks__/mobile-sdk-components.js
  • app/tests/utils/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.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/__mocks__/mobile-sdk-components.js
  • app/jest.setup.js
📚 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/__mocks__/mobile-sdk-components.js
📚 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/__mocks__/mobile-sdk-components.js
  • app/tests/utils/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.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}} : Ensure parseNFCResponse() works with representative, synthetic NFC data

Applied to files:

  • app/tests/__mocks__/mobile-sdk-components.js
  • app/tests/utils/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.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/demo/** : Provide an in-SDK lightweight React Native demo under packages/mobile-sdk-alpha/demo/

Applied to files:

  • app/tests/__mocks__/mobile-sdk-components.js
  • app/jest.setup.js
  • app/tests/src/screens/WebViewScreen.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 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/tests/__mocks__/mobile-sdk-components.js
📚 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/tests/__mocks__/mobile-sdk-components.js
📚 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/utils/nfcScanner.test.ts
  • app/tests/utils/notificationService.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/utils/nfcScanner.test.ts
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.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.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks

Applied to files:

  • app/tests/utils/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/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: Applies to src/**/*.{js,ts,tsx,jsx} : Always handle platform differentiation with `Platform.OS` checks before platform-specific logic.

Applied to files:

  • app/tests/utils/nfcScanner.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/utils/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.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/nfcScanner.test.ts
  • app/jest.setup.js
  • app/tests/utils/notificationService.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}} : Verify extractMRZInfo() using published sample MRZ strings (e.g., ICAO examples)

Applied to files:

  • app/tests/utils/nfcScanner.test.ts
  • app/jest.setup.js
📚 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/utils/nfcScanner.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/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.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/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.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 : Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and 'tests/' to 'tests/src/'

Applied to files:

  • app/jest.setup.js
📚 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/jest.setup.js
  • app/tests/src/screens/WebViewScreen.test.tsx
  • app/tests/src/screens/GratificationScreen.test.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/jest.setup.js
📚 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/jest.setup.js
📚 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/jest.setup.js
  • app/tests/src/screens/GratificationScreen.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} : Mock console.error to avoid test output clutter.

Applied to files:

  • app/jest.setup.js
  • app/tests/src/screens/GratificationScreen.test.tsx
  • app/tests/utils/notificationService.test.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/jest.setup.js
  • app/tests/src/screens/WebViewScreen.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} : Test error boundaries and recovery mechanisms.

Applied to files:

  • app/tests/src/screens/GratificationScreen.test.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/account/settings/CloudBackupScreen.tsx
🧬 Code graph analysis (9)
app/src/components/NavBar/Points.tsx (1)
app/src/stores/settingStore.ts (1)
  • useSettingStore (50-135)
app/tests/utils/nfcScanner.test.ts (1)
packages/mobile-sdk-demo/tests/mocks/react-native.ts (1)
  • Platform (14-25)
app/jest.setup.js (3)
app/android/react-native-passport-reader/index.android.js (1)
  • NativeModules (5-5)
packages/mobile-sdk-alpha/src/components/index.ts (3)
  • Button (14-14)
  • XStack (47-47)
  • Text (39-39)
app/src/components/WebViewFooter.tsx (1)
  • WebViewFooter (25-86)
app/tests/src/screens/WebViewScreen.test.tsx (1)
app/jest.setup.js (1)
  • MockWebView (1004-1006)
app/tests/src/screens/GratificationScreen.test.tsx (1)
app/jest.setup.js (1)
  • Text (1047-1048)
app/tests/utils/notificationService.test.ts (1)
packages/mobile-sdk-demo/tests/mocks/react-native.ts (2)
  • Platform (14-25)
  • PermissionsAndroid (8-12)
app/src/screens/account/recovery/AccountRecoveryChoiceScreen.tsx (2)
app/src/stores/settingStore.ts (1)
  • useSettingStore (50-135)
packages/mobile-sdk-alpha/src/constants/analytics.ts (1)
  • BackupEvents (61-77)
app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx (2)
app/src/stores/settingStore.ts (1)
  • useSettingStore (50-135)
app/src/utils/cloudBackup/index.ts (1)
  • STORAGE_NAME (25-25)
app/src/utils/turnkey.ts (1)
app/src/stores/settingStore.ts (1)
  • useSettingStore (50-135)
🪛 GitHub Check: workspace-lint
app/tests/utils/notificationService.test.ts

[warning] 30-30:
'PermissionsAndroid' is never reassigned. Use 'const' instead


[warning] 25-25:
'Platform' is never reassigned. Use 'const' instead

⏰ 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: e2e-ios
  • GitHub Check: android-build-test
  • GitHub Check: build-deps
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios
🔇 Additional comments (14)
app/tests/utils/nfcScanner.test.ts (1)

83-97: Error handling test correctly manages Platform.OS override.

The restoration pattern works properly even when testing error cases, as expect().toThrow() catches the thrown error and allows the restoration to execute.

app/tests/src/screens/GratificationScreen.test.tsx (1)

19-31: LGTM! Clean test mock refactoring.

The Tamagui mock correctly uses string-tag element creation to avoid React Native dependencies while preserving functional equivalence.

app/jest.setup.js (3)

310-317: LGTM! Clean SafeAreaContext mock without RN dependency.

The mock correctly uses string-tag element creation for SafeAreaProvider and SafeAreaView, avoiding React Native imports while maintaining functional behavior.


754-767: LGTM! Smart NativeModules mock strategy.

Creating a minimal NativeModules mock without requiring react-native and assigning it to global.NativeModules is a clean solution for test isolation.


1003-1013: LGTM! Consistent mock pattern across all components.

All component mocks (WebView, ExpandableBottomLayout, mobile-sdk-alpha components, Tamagui icons, WebViewFooter) consistently use string-tag element creation to avoid React Native dependencies. This maintains test functionality while improving memory characteristics.

Also applies to: 1018-1029, 1035-1056, 1061-1078, 1083-1086

app/tests/__mocks__/mobile-sdk-components.js (1)

23-44: LGTM! Button mocks updated consistently.

Both PrimaryButton and SecondaryButton correctly use string-tag element creation to avoid React Native dependencies while preserving test functionality.

app/tests/src/screens/WebViewScreen.test.tsx (1)

25-28: LGTM! WebView mock updated consistently.

The mock correctly uses string-tag element creation while preserving testID and props forwarding.

app/src/components/NavBar/Points.tsx (2)

97-98: LGTM! Consistent backup flag naming.

The rename from backedUpWithTurnKey to turnkeyBackupEnabled aligns with cloudBackupEnabled naming convention and maintains backward-compatible logic.

Also applies to: 106-106


268-272: LGTM! Backup state check updated correctly.

The backup method detection now uses the renamed turnkeyBackupEnabled flag, maintaining consistent logic with the flag rename.

app/src/screens/onboarding/SaveRecoveryPhraseScreen.tsx (1)

26-26: LGTM! Turnkey backup integration complete.

The screen correctly incorporates turnkeyBackupEnabled alongside cloudBackupEnabled, updates UI text to reflect both backup options, and adjusts continue/skip logic appropriately.

Also applies to: 63-67, 70-72

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

55-57: LGTM! Turnkey backup flag integration correct.

The rename from setBackedUpWithTurnKey to setTurnkeyBackupEnabled is consistent, and the restoration flow correctly sets the flag on success.

Also applies to: 155-163


208-221: LGTM! Turnkey restore button activated.

The Turnkey restoration flow is now properly wired with appropriate disabled states and loading feedback.

app/src/utils/turnkey.ts (1)

22-27: LGTM - Consistent rename applied throughout

All references to backedUpWithTurnKey have been correctly updated to turnkeyBackupEnabled, including hook selectors, conditional checks, setter calls, and dependency arrays. The logic remains unchanged.

Note: This file is affected by the store migration issue flagged in settingStore.ts, but the changes here are correctly implemented.

Also applies to: 63-64, 98-99, 112-112, 140-141

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

286-288: LGTM - BottomButton now correctly handles both backup methods

The BottomButton component now receives turnkeyBackupEnabled as a prop and correctly computes hasBackup from both cloudBackupEnabled and turnkeyBackupEnabled (line 324). This fixes the previously flagged issue where users who backed up with Turnkey couldn't proceed when nextScreen was set.

Note: While the button logic is now correct, users are still affected by the store migration issue flagged in settingStore.ts.

Also applies to: 305-369

@transphorm transphorm merged commit ad726a7 into dev Nov 12, 2025
16 of 21 checks passed
@transphorm transphorm deleted the hotfix/patch-turnkey-keychain branch November 12, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants