-
Notifications
You must be signed in to change notification settings - Fork 198
SEL-269: Update ESLint rules & lock prettier config #781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SEL-269: Update ESLint rules & lock prettier config #781
Conversation
WalkthroughThis update overhauls the ESLint configuration to improve TypeScript and React Native support, updates and adds related dependencies, refines import statements in multiple components and utilities, simplifies a deployment script function signature, adjusts a mock function's parameter, and introduces a TypeScript path alias for environment configuration. It also includes socket.io import alias fixes, environment variable handling improvements, and consistent style prop naming across many UI components. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant ESLint
participant TypeScript
participant ReactNativeApp
Developer->>ESLint: Lint code (with new config)
ESLint->>TypeScript: Parse and analyze TS files
ESLint->>ReactNativeApp: Apply React/React Native rules
ESLint->>Developer: Report issues (import sorting, rules, etc.)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
app/src/utils/proving/cose.ts (1)
24-64: Strong cryptographic implementation with minor security enhancements needed.The COSE_Sign1 verification implementation follows cryptographic best practices and correctly implements the COSE specification. The use of SHA-384 with elliptic curve verification is appropriate for AWS Nitro Enclaves attestation.
Security considerations:
Input validation: Consider adding more comprehensive validation for the verifier key parameters to prevent potential attacks through malformed inputs.
Buffer bounds checking: Add explicit length validation for signature components to prevent potential buffer overflow issues.
verify: async ( data: Buffer, verifier: { key: { x: string; y: string; curve: string } }, _options: { defaultType: number }, ) => { + // Validate inputs + if (!Buffer.isBuffer(data) || data.length === 0) { + throw new Error('Invalid COSE data provided'); + } + if (!verifier?.key?.x || !verifier?.key?.y || !verifier?.key?.curve) { + throw new Error('Invalid verifier key parameters'); + } + const decoded = decode(new Uint8Array(data)); if (!Array.isArray(decoded) || decoded.length !== 4) { throw new Error('Invalid COSE_Sign1 format'); } const [protectedHeaderBytes, _unprotectedHeader, payload, signature] = decoded; + // Validate signature buffer + if (!signature || signature.length === 0) { + throw new Error('Invalid signature data'); + } + const sigBuffer = Buffer.from(signature); if (sigBuffer.length % 2 !== 0) { throw new Error('Invalid signature length'); } + + // Ensure minimum signature length + if (sigBuffer.length < 64) { // Minimum for P-256, adjust based on curve + throw new Error('Signature too short'); + }
🧹 Nitpick comments (5)
app/src/screens/misc/LoadingScreen.tsx (1)
145-146: Consider extracting the terminal state check into a helper function.The terminal state checking pattern is repeated twice with the same type assertion. Consider extracting this into a helper function for better maintainability:
+const isTerminalState = (state: ProvingStateType): boolean => { + return terminalStates.includes(state); +};Then use it as:
-if (terminalStates.includes(currentState as ProvingStateType)) { +if (isTerminalState(currentState as ProvingStateType)) {-const shouldLoopAnimation = !terminalStates.includes( - currentState as ProvingStateType, -); +const shouldLoopAnimation = !isTerminalState(currentState as ProvingStateType);Also applies to: 160-162
app/src/utils/proving/cose.ts (2)
59-61: Consider generic error messages for security-critical verification failures.The specific error message "AWS root certificate signature verification failed" could potentially leak implementation details to attackers. For cryptographic verification failures, consider using more generic error messages while maintaining internal logging for debugging.
const valid = key.verify(hash, { r: rHex, s: sHex }); if (!valid) { - throw new Error('AWS root certificate signature verification failed'); + throw new Error('Signature verification failed'); }Alternatively, you could log the specific failure reason internally while throwing a generic error:
const valid = key.verify(hash, { r: rHex, s: sHex }); if (!valid) { + console.debug('AWS root certificate signature verification failed'); // Internal logging + throw new Error('Signature verification failed'); }
24-28: Consider creating interfaces for better type reusability.The inline type definitions are clear, but creating dedicated interfaces could improve type reusability and maintainability across the codebase.
+interface COSEVerifierKey { + x: string; + y: string; + curve: string; +} + +interface COSEVerifier { + key: COSEVerifierKey; +} + +interface COSEVerifyOptions { + defaultType: number; +} + verify: async ( data: Buffer, - verifier: { key: { x: string; y: string; curve: string } }, - _options: { defaultType: number }, + verifier: COSEVerifier, + _options: COSEVerifyOptions, ) => {app/src/components/Mnemonic.tsx (1)
101-101: Consider maintaining theme consistency.The change from
py="$2"topaddingVertical={16}works functionally but loses the benefit of the design system's spacing tokens. Theme tokens provide consistency and make global spacing adjustments easier.Consider reverting to the theme token if 16px corresponds to
$2:- paddingVertical={16} + py="$2"Alternatively, if 16px is intentionally different from the theme, document why this specific value is needed.
app/src/screens/settings/ManageDocumentsScreen.tsx (1)
37-55: Good refactoring to useCallback, but consider optimizing dependencies.Converting
loadPassportDataInfotouseCallbackimproves stability and prevents unnecessary re-renders. However, including state setters (setDocumentCatalog,setAllDocuments) in the dependency array is unnecessary since React guarantees these functions are stable across renders.Consider this optimization:
const loadPassportDataInfo = useCallback(async () => { setLoading(true); const catalog = await loadDocumentCatalog(); const docs = await getAllDocuments(); setDocumentCatalog(catalog); setAllDocuments(docs); trackEvent(DocumentEvents.DOCUMENTS_FETCHED, { count: catalog.documents.length, }); if (catalog.documents.length === 0) { trackEvent(DocumentEvents.NO_DOCUMENTS_FOUND); } setLoading(false); }, [ loadDocumentCatalog, getAllDocuments, - setDocumentCatalog, - setAllDocuments, ]);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (41)
app/index.js(1 hunks)app/src/components/ErrorBoundary.tsx(2 hunks)app/src/components/Mnemonic.tsx(2 hunks)app/src/components/NavBar/BaseNavBar.tsx(2 hunks)app/src/components/native/PassportCamera.web.tsx(2 hunks)app/src/hooks/useConnectionModal.ts(1 hunks)app/src/hooks/useMnemonic.ts(1 hunks)app/src/layouts/SimpleScrolledTitleLayout.tsx(3 hunks)app/src/mocks/react-native-gesture-handler.ts(2 hunks)app/src/mocks/react-native-safe-area-context.js(3 hunks)app/src/navigation/index.tsx(2 hunks)app/src/providers/authProvider.tsx(2 hunks)app/src/screens/dev/DevFeatureFlagsScreen.tsx(1 hunks)app/src/screens/dev/DevSettingsScreen.tsx(3 hunks)app/src/screens/dev/MockDataScreen.tsx(5 hunks)app/src/screens/dev/MockDataScreenDeepLink.tsx(2 hunks)app/src/screens/home/HomeScreen.tsx(2 hunks)app/src/screens/home/ProofHistoryDetailScreen.tsx(1 hunks)app/src/screens/home/ProofHistoryScreen.tsx(1 hunks)app/src/screens/misc/LoadingScreen.tsx(2 hunks)app/src/screens/misc/SplashScreen.tsx(3 hunks)app/src/screens/passport/PassportCameraTroubleScreen.tsx(2 hunks)app/src/screens/passport/PassportNFCScanScreen.tsx(2 hunks)app/src/screens/passport/PassportNFCTroubleScreen.tsx(2 hunks)app/src/screens/prove/ConfirmBelongingScreen.tsx(1 hunks)app/src/screens/prove/ProofRequestStatusScreen.tsx(1 hunks)app/src/screens/prove/ProveScreen.tsx(3 hunks)app/src/screens/prove/QRCodeTroubleScreen.tsx(2 hunks)app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx(1 hunks)app/src/screens/recovery/PassportDataNotFoundScreen.tsx(2 hunks)app/src/screens/recovery/RecoverWithPhraseScreen.tsx(1 hunks)app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx(1 hunks)app/src/screens/settings/ManageDocumentsScreen.tsx(3 hunks)app/src/screens/settings/SettingsScreen.tsx(2 hunks)app/src/screens/settings/ShowRecoveryPhraseScreen.tsx(1 hunks)app/src/types/svg.d.ts(1 hunks)app/src/utils/deeplinks.ts(2 hunks)app/src/utils/proving/attest.ts(3 hunks)app/src/utils/proving/cose.ts(1 hunks)app/tests/__setup__/svgMock.js(1 hunks)app/tsconfig.json(1 hunks)
✅ Files skipped from review due to trivial changes (15)
- app/src/components/ErrorBoundary.tsx
- app/src/screens/recovery/PassportDataNotFoundScreen.tsx
- app/src/screens/passport/PassportCameraTroubleScreen.tsx
- app/index.js
- app/src/types/svg.d.ts
- app/src/screens/dev/DevFeatureFlagsScreen.tsx
- app/src/screens/passport/PassportNFCTroubleScreen.tsx
- app/src/navigation/index.tsx
- app/src/utils/proving/attest.ts
- app/src/mocks/react-native-gesture-handler.ts
- app/src/screens/prove/QRCodeTroubleScreen.tsx
- app/src/components/native/PassportCamera.web.tsx
- app/tests/setup/svgMock.js
- app/src/mocks/react-native-safe-area-context.js
- app/src/utils/deeplinks.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- app/src/components/NavBar/BaseNavBar.tsx
- app/src/screens/prove/ProveScreen.tsx
- app/tsconfig.json
- app/src/screens/settings/SettingsScreen.tsx
- app/src/screens/misc/SplashScreen.tsx
- app/src/screens/dev/MockDataScreen.tsx
🧰 Additional context used
📓 Path-based instructions (1)
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/recovery/SaveRecoveryPhraseScreen.tsxapp/src/screens/prove/ConfirmBelongingScreen.tsxapp/src/screens/recovery/AccountRecoveryChoiceScreen.tsxapp/src/screens/settings/ShowRecoveryPhraseScreen.tsxapp/src/screens/recovery/RecoverWithPhraseScreen.tsxapp/src/screens/home/ProofHistoryScreen.tsxapp/src/screens/home/ProofHistoryDetailScreen.tsxapp/src/screens/home/HomeScreen.tsxapp/src/hooks/useConnectionModal.tsapp/src/screens/dev/DevSettingsScreen.tsxapp/src/screens/prove/ProofRequestStatusScreen.tsxapp/src/screens/settings/ManageDocumentsScreen.tsxapp/src/layouts/SimpleScrolledTitleLayout.tsxapp/src/screens/passport/PassportNFCScanScreen.tsxapp/src/screens/misc/LoadingScreen.tsxapp/src/hooks/useMnemonic.tsapp/src/utils/proving/cose.tsapp/src/components/Mnemonic.tsxapp/src/providers/authProvider.tsxapp/src/screens/dev/MockDataScreenDeepLink.tsx
🧠 Learnings (1)
app/src/screens/passport/PassportNFCScanScreen.tsx (1)
Learnt from: transphorm
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.
🧬 Code Graph Analysis (4)
app/src/screens/prove/ProofRequestStatusScreen.tsx (2)
app/src/stores/database.ts (1)
updateProofStatus(143-156)app/src/stores/database.web.ts (1)
updateProofStatus(218-253)
app/src/screens/settings/ManageDocumentsScreen.tsx (1)
app/src/providers/passportDataProvider.tsx (2)
loadDocumentCatalog(104-118)getAllDocuments(235-251)
app/src/layouts/SimpleScrolledTitleLayout.tsx (1)
app/src/components/buttons/SecondaryButton.tsx (1)
SecondaryButton(8-23)
app/src/screens/misc/LoadingScreen.tsx (1)
app/src/utils/proving/provingMachine.ts (1)
ProvingStateType(134-156)
🪛 Biome (2.1.2)
app/src/screens/dev/MockDataScreenDeepLink.tsx
[error] 68-68: This variable is used before its declaration.
The variable is declared here:
(lint/correctness/noInvalidUseBeforeDeclaration)
⏰ 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). (1)
- GitHub Check: build
🔇 Additional comments (31)
app/src/hooks/useConnectionModal.ts (1)
59-59: LGTM! Dependency array correctly updated.The addition of
hideNetworkModalandshowModalto the useEffect dependency array is the right fix. These values are used within the effect logic (lines 48-49 and 52), so they should be included as dependencies to ensure the effect re-runs when these values change. This improves the hook's reactivity and follows React hooks best practices.app/src/screens/misc/LoadingScreen.tsx (2)
29-37: Good performance optimization by moving terminalStates to module scope.Moving this array outside the component prevents unnecessary recreation on each render, which is a solid performance improvement. The states correctly represent terminal conditions from the ProvingStateType union, and the descriptive comment makes the intent clear.
102-103: Verify the intentional omission of passportData from dependencies.The ESLint disable appears intentional since you only want to reinitialize when the screen becomes focused, not when passportData changes. However, ensure this won't cause stale closure issues - the effect accesses
passportDatain the condition but doesn't depend on it.Consider if this logic is correct: should the initialization effect re-run if
passportDatabecomes null after being set?app/src/utils/proving/cose.ts (2)
8-21: Excellent documentation and TypeScript usage.The comprehensive JSDoc documentation clearly explains the function's purpose, parameters, and usage context. The TypeScript typing is appropriate and the reference to AWS Nitro Enclaves documentation provides valuable context for future maintainers.
22-22: Verified COSE Export Change Is SafeSearch results confirm there are no named imports of the
cosemodule—every reference (e.g. inapp/src/utils/proving/attest.ts) uses the default import syntax. The refactor from a named to a default-only export will not break existing code.No further changes required.
app/src/screens/recovery/RecoverWithPhraseScreen.tsx (2)
85-85: LGTM! Dependency array correctly updated.The addition of
navigationandtrackEventto the dependency array ensures proper memoization of therestoreAccountcallback. This prevents stale closures and ensures the callback updates when these dependencies change.
50-55: Good input validation and early return pattern.The mnemonic validation using
ethers.Mnemonic.isValidMnemonic()provides proper cryptographic validation before attempting restoration. The trimming and early return on invalid input prevents unnecessary processing.app/src/screens/home/ProofHistoryScreen.tsx (2)
301-301: Excellent dependency array fix!Adding
navigationto the dependency array ensures therenderItemcallback properly tracks the navigation object used in theonPresshandler. This prevents potential issues with stale navigation references.
392-396: Well-optimized SectionList configuration.The performance optimizations are well-implemented:
initialNumToRender={10}andmaxToRenderPerBatch={10}for controlled renderingremoveClippedSubviews={true}for memory efficiencywindowSize={10}for optimal viewport managementThese settings will provide smooth scrolling even with large proof history datasets.
app/src/components/Mnemonic.tsx (2)
66-66: Dependency array properly updated.The expanded dependency array now correctly includes
onRevealWordsandsetHasViewedRecoveryPhrase, ensuring the callback responds to changes in all referenced variables. This prevents stale closure issues.
55-66: Good security practices for mnemonic handling.The component properly:
- Uses state to control mnemonic visibility
- Implements reveal-then-copy workflow
- Provides visual feedback for copy operations
- Uses redacted placeholder content
This prevents accidental exposure of sensitive mnemonic data.
app/src/screens/home/HomeScreen.tsx (2)
8-8: Good modernization of React hook imports.The explicit import of
useCallbackand direct usage (instead ofReact.useCallback) follows modern React best practices and improves code clarity. This pattern is more tree-shakable and aligns with current community standards.Also applies to: 56-56
74-74: Appropriate navigation prevention.Using
usePreventRemove(true, () => {})on the home screen prevents accidental back navigation, which is correct for a main application screen. This ensures users don't accidentally navigate away from the primary interface.app/src/screens/dev/DevSettingsScreen.tsx (3)
173-191: Appropriate security warnings for destructive operations.The
handleClearSecretsPressfunction properly:
- Shows a clear warning about data loss
- Explains the consequences of the action
- Requires explicit confirmation
- Uses destructive button styling
This follows security best practices for dangerous operations in development tools.
269-320: Well-implemented private key security pattern.The private key display implementation correctly:
- Starts with redacted view by default
- Requires explicit user action to reveal
- Uses monospace font for better readability
- Implements proper text selection for copying
This prevents accidental exposure while maintaining developer utility.
9-9: Memoization safe:itemsis staticOur inspection confirms that
itemsis declared once as a constant array at line 54 inapp/src/screens/dev/DevSettingsScreen.tsxwith no reassignments or mutations elsewhere. Using an empty dependency array foruseMemois therefore correct and won’t introduce stale data. No changes required.app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx (1)
90-97: Excellent dependency array fix for account recovery callback.The expanded dependency array now correctly includes all referenced variables (
navigation,toggleCloudBackupEnabled), preventing potential stale closure bugs in this security-critical account recovery flow. This ensures the callback always has access to the latest values.app/src/screens/dev/MockDataScreenDeepLink.tsx (1)
4-8: Good import consolidation for better readability.Consolidating related imports from
@selfxyz/commoninto a single grouped statement improves code organization and readability.app/src/layouts/SimpleScrolledTitleLayout.tsx (3)
3-3: Good explicit import pattern for better tree-shaking.Explicitly importing
PropsWithChildreninstead of accessing it viaReact.PropsWithChildrenimproves tree-shaking and code clarity.
14-21: Consistent interface update following import changes.The interface correctly uses the explicitly imported
PropsWithChildrentype, maintaining consistency with the import changes.
47-47: Acceptable styling property change.The change from shorthand
mb="$2"to explicitmarginBottom={16}is functionally equivalent and acceptable, though it moves away from the tamagui styling system's shorthand notation.app/src/screens/prove/ProofRequestStatusScreen.tsx (1)
92-100: Comprehensive dependency array fix for proof status effect.The expanded dependency array now correctly includes all referenced variables (
appName,sessionId,errorCode,reason,updateProofStatus), ensuring the effect properly reacts to changes in the proof verification flow. This prevents stale closure bugs in this security-critical component that handles proof status updates and analytics tracking.app/src/screens/home/ProofHistoryDetailScreen.tsx (1)
92-92: Correct memoization dependency fix for disclosure strings.Adding
data.appNameto the dependency array is essential since the memoizeddisclosurescomputation incorporatesappNameinto multiple disclosure strings (lines 59, 65, 68, 71, 74, 77, 80, 83). Without this dependency, the disclosure strings could display stale app names when the data changes.app/src/screens/passport/PassportNFCScanScreen.tsx (2)
262-272: LGTM! Improved hook dependency management.The expanded dependency array for
onVerifyPresscorrectly includes all referenced values (route.params,navigation,openErrorModal) and ensures the callback updates when any of these dependencies change. This prevents stale closures and aligns with ESLint's exhaustive-deps rule.
282-282: Correct dependency array simplification.Since the
_cancelScanIfRunningfunction body is commented out (lines 280-281), an empty dependency array is appropriate. This prevents unnecessary re-renders while maintaining the callback reference stability.app/src/screens/settings/ManageDocumentsScreen.tsx (1)
57-59: Correct useEffect dependency update.The useEffect now properly depends on the memoized
loadPassportDataInfocallback, ensuring it re-runs only when the callback's dependencies change. This is a significant improvement over the previous empty dependency array.app/src/screens/settings/ShowRecoveryPhraseScreen.tsx (1)
19-19: Correct dependency array update.Adding
loadMnemonicto the dependency array ensures the callback recreates when theloadMnemonicfunction reference changes. This prevents stale closures and aligns with the exhaustive-deps ESLint rule.app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx (1)
30-30: Appropriate dependency array enhancement.Including
loadMnemonicin the dependency array ensures the callback remains fresh when the mnemonic loading function changes. This maintains correct reactivity and prevents potential stale closure issues.app/src/hooks/useMnemonic.ts (1)
19-19: Essential dependency fix for hook stability.Adding
getOrCreateMnemonicto the dependency array is crucial since the callback directly calls this function. This foundational improvement ensures that all components using this hook (like the recovery screens) receive fresh mnemonic loading logic when the auth provider updates.app/src/providers/authProvider.tsx (2)
223-223: LGTM: Correct dependency array update foruseCallbackThe addition of
authenticationTimeoutinMsto the dependency array is correct since this value is used within the callback (line 221). This ensures the callback is recreated when the timeout value changes, preventing stale closures.
249-255: LGTM: Proper dependency array update foruseMemoThe addition of
getOrCreateMnemonicandrestoreAccountFromMnemonicto the dependency array is correct since these functions are included in the memoized state object. This ensures the context value updates appropriately when these callbacks change, following React hooks best practices.The dependency array now properly includes all values from the component scope that are used within the memoized computation.
* Expand view style props * Expand remaining style props * update types * fix pipeline * fix test env check
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
app/src/screens/misc/ModalScreen.tsx (1)
100-105: Prefer design-system spacing tokens over raw numbersHard-coding
8bypasses the theme’s spacing scale and risks visual drift if the global scale changes. Tamagui (and our design system) exposes$space.*tokens that remain semantically meaningful and automatically adjust across breakpoints.- marginHorizontal={8} + // `$2` = 8px on current scale + marginHorizontal="$2"Aligns with the ongoing effort in this PR to make style props explicit and consistent.
app/src/types/png.d.ts (1)
1-4: Standard PNG module declaration with room for improvementThe module declaration follows standard patterns for asset imports. While using
anyis common for image assets, consider using a more specific type for better type safety.Consider using a more specific type for better type safety:
declare module '*.png' { - const content: any; + const content: string; export default content; }This assumes PNG imports resolve to URL strings (common in most bundler configurations).
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (68)
app/.eslintrc.cjs(2 hunks)app/env.ts(1 hunks)app/index.js(1 hunks)app/package.json(1 hunks)app/scripts/mobile-deploy-confirm.cjs(2 hunks)app/src/components/ErrorBoundary.tsx(2 hunks)app/src/components/Mnemonic.tsx(2 hunks)app/src/components/NavBar/BaseNavBar.tsx(2 hunks)app/src/components/native/PassportCamera.web.tsx(2 hunks)app/src/components/native/RCTFragment.tsx(1 hunks)app/src/hooks/useAesopRedesign.ts(1 hunks)app/src/hooks/useConnectionModal.ts(1 hunks)app/src/hooks/useMnemonic.ts(1 hunks)app/src/layouts/ExpandableBottomLayout.tsx(1 hunks)app/src/layouts/SimpleScrolledTitleLayout.tsx(3 hunks)app/src/mocks/react-native-gesture-handler.ts(2 hunks)app/src/mocks/react-native-safe-area-context.js(3 hunks)app/src/navigation/index.tsx(2 hunks)app/src/providers/authProvider.tsx(2 hunks)app/src/providers/passportDataProvider.tsx(2 hunks)app/src/screens/dev/DevFeatureFlagsScreen.tsx(7 hunks)app/src/screens/dev/DevSettingsScreen.tsx(9 hunks)app/src/screens/dev/MockDataScreen.tsx(18 hunks)app/src/screens/dev/MockDataScreenDeepLink.tsx(6 hunks)app/src/screens/home/DisclaimerScreen.tsx(1 hunks)app/src/screens/home/HomeScreen.tsx(3 hunks)app/src/screens/home/ProofHistoryDetailScreen.tsx(1 hunks)app/src/screens/home/ProofHistoryScreen.tsx(2 hunks)app/src/screens/misc/LaunchScreen.tsx(1 hunks)app/src/screens/misc/LoadingScreen.tsx(3 hunks)app/src/screens/misc/ModalScreen.tsx(1 hunks)app/src/screens/misc/SplashScreen.tsx(3 hunks)app/src/screens/passport/PassportCameraScreen.tsx(1 hunks)app/src/screens/passport/PassportCameraTroubleScreen.tsx(2 hunks)app/src/screens/passport/PassportNFCScanScreen.tsx(4 hunks)app/src/screens/passport/PassportNFCScanScreen.web.tsx(1 hunks)app/src/screens/passport/PassportNFCTroubleScreen.tsx(2 hunks)app/src/screens/prove/ConfirmBelongingScreen.tsx(2 hunks)app/src/screens/prove/ProofRequestStatusScreen.tsx(1 hunks)app/src/screens/prove/ProveScreen.tsx(4 hunks)app/src/screens/prove/QRCodeTroubleScreen.tsx(2 hunks)app/src/screens/prove/ViewFinderScreen.tsx(1 hunks)app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx(5 hunks)app/src/screens/recovery/AccountRecoveryScreen.tsx(1 hunks)app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx(1 hunks)app/src/screens/recovery/PassportDataNotFoundScreen.tsx(3 hunks)app/src/screens/recovery/RecoverWithPhraseScreen.tsx(2 hunks)app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx(1 hunks)app/src/screens/settings/CloudBackupScreen.tsx(2 hunks)app/src/screens/settings/ManageDocumentsScreen.tsx(10 hunks)app/src/screens/settings/PassportDataInfoScreen.tsx(2 hunks)app/src/screens/settings/SettingsScreen.tsx(6 hunks)app/src/screens/settings/ShowRecoveryPhraseScreen.tsx(1 hunks)app/src/stores/proofHistoryStore.ts(1 hunks)app/src/stores/selfAppStore.tsx(2 hunks)app/src/types/png.d.ts(1 hunks)app/src/types/svg.d.ts(1 hunks)app/src/utils/cloudBackup/google.ts(1 hunks)app/src/utils/deeplinks.ts(2 hunks)app/src/utils/nfcScanner.ts(1 hunks)app/src/utils/proving/attest.ts(3 hunks)app/src/utils/proving/cose.ts(1 hunks)app/src/utils/proving/provingInputs.ts(2 hunks)app/src/utils/proving/provingMachine.ts(2 hunks)app/tests/__setup__/@env.js(1 hunks)app/tests/__setup__/notificationServiceMock.js(1 hunks)app/tests/__setup__/svgMock.js(1 hunks)app/tsconfig.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
app/src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit Configuration File
app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:
- Component architecture and reusability
- State management patterns
- Performance optimizations
- TypeScript type safety
- React hooks usage and dependencies
- Navigation patterns
Files:
app/src/screens/prove/QRCodeTroubleScreen.tsxapp/src/navigation/index.tsxapp/src/components/native/RCTFragment.tsxapp/src/screens/passport/PassportCameraTroubleScreen.tsxapp/src/screens/misc/ModalScreen.tsxapp/src/screens/passport/PassportCameraScreen.tsxapp/src/screens/recovery/SaveRecoveryPhraseScreen.tsxapp/src/components/native/PassportCamera.web.tsxapp/src/screens/recovery/AccountVerifiedSuccessScreen.tsxapp/src/screens/recovery/PassportDataNotFoundScreen.tsxapp/src/screens/settings/ShowRecoveryPhraseScreen.tsxapp/src/screens/home/HomeScreen.tsxapp/src/screens/misc/LaunchScreen.tsxapp/src/providers/passportDataProvider.tsxapp/src/screens/home/ProofHistoryScreen.tsxapp/src/types/png.d.tsapp/src/hooks/useAesopRedesign.tsapp/src/components/NavBar/BaseNavBar.tsxapp/src/utils/deeplinks.tsapp/src/screens/recovery/RecoverWithPhraseScreen.tsxapp/src/screens/recovery/AccountRecoveryScreen.tsxapp/src/layouts/ExpandableBottomLayout.tsxapp/src/stores/proofHistoryStore.tsapp/src/mocks/react-native-gesture-handler.tsapp/src/utils/proving/provingMachine.tsapp/src/screens/prove/ProofRequestStatusScreen.tsxapp/src/screens/passport/PassportNFCScanScreen.web.tsxapp/src/utils/proving/attest.tsapp/src/screens/passport/PassportNFCScanScreen.tsxapp/src/components/Mnemonic.tsxapp/src/layouts/SimpleScrolledTitleLayout.tsxapp/src/utils/proving/cose.tsapp/src/screens/recovery/AccountRecoveryChoiceScreen.tsxapp/src/mocks/react-native-safe-area-context.jsapp/src/screens/home/ProofHistoryDetailScreen.tsxapp/src/components/ErrorBoundary.tsxapp/src/screens/dev/DevFeatureFlagsScreen.tsxapp/src/screens/home/DisclaimerScreen.tsxapp/src/stores/selfAppStore.tsxapp/src/screens/prove/ConfirmBelongingScreen.tsxapp/src/screens/settings/CloudBackupScreen.tsxapp/src/screens/misc/SplashScreen.tsxapp/src/screens/passport/PassportNFCTroubleScreen.tsxapp/src/hooks/useMnemonic.tsapp/src/screens/dev/MockDataScreenDeepLink.tsxapp/src/utils/nfcScanner.tsapp/src/screens/prove/ViewFinderScreen.tsxapp/src/screens/dev/DevSettingsScreen.tsxapp/src/utils/proving/provingInputs.tsapp/src/utils/cloudBackup/google.tsapp/src/providers/authProvider.tsxapp/src/types/svg.d.tsapp/src/screens/prove/ProveScreen.tsxapp/src/screens/settings/PassportDataInfoScreen.tsxapp/src/hooks/useConnectionModal.tsapp/src/screens/dev/MockDataScreen.tsxapp/src/screens/settings/SettingsScreen.tsxapp/src/screens/settings/ManageDocumentsScreen.tsxapp/src/screens/misc/LoadingScreen.tsx
🧠 Learnings (14)
app/src/screens/prove/QRCodeTroubleScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/passport/PassportCameraTroubleScreen.tsx (2)
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
Learnt from: transphorm
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.
app/src/screens/misc/ModalScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/passport/PassportCameraScreen.tsx (2)
Learnt from: transphorm
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.
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
app/src/components/native/PassportCamera.web.tsx (2)
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
Learnt from: transphorm
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.
app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/recovery/AccountRecoveryScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/passport/PassportNFCScanScreen.web.tsx (1)
Learnt from: transphorm
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.
app/src/screens/passport/PassportNFCScanScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/settings/CloudBackupScreen.tsx (1)
Learnt from: transphorm
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.
app/src/utils/nfcScanner.ts (1)
Learnt from: transphorm
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.
app/src/screens/prove/ViewFinderScreen.tsx (1)
Learnt from: transphorm
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.
app/src/utils/cloudBackup/google.ts (1)
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
app/src/screens/settings/PassportDataInfoScreen.tsx (1)
Learnt from: transphorm
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.
🧬 Code Graph Analysis (25)
app/src/screens/misc/ModalScreen.tsx (1)
app/src/utils/colors.ts (1)
white(7-7)
app/src/screens/passport/PassportCameraScreen.tsx (1)
app/src/components/typography/Title.tsx (1)
Title(8-27)
app/src/screens/recovery/PassportDataNotFoundScreen.tsx (1)
app/src/utils/colors.ts (1)
slate200(10-10)
app/src/screens/home/HomeScreen.tsx (3)
app/src/utils/colors.ts (2)
black(6-6)amber500(5-5)app/src/utils/constants.ts (1)
extraYPadding(3-3)app/src/components/typography/Caption.tsx (1)
Caption(8-21)
app/src/screens/misc/LaunchScreen.tsx (1)
app/src/utils/colors.ts (1)
black(6-6)
app/src/screens/home/ProofHistoryScreen.tsx (2)
app/src/utils/colors.ts (1)
slate50(8-8)app/src/utils/constants.ts (1)
extraYPadding(3-3)
app/src/hooks/useAesopRedesign.ts (2)
app/env.ts (1)
IS_TEST_BUILD(7-7)app/tests/__setup__/@env.js (2)
IS_TEST_BUILD(3-3)IS_TEST_BUILD(3-3)
app/src/screens/recovery/AccountRecoveryScreen.tsx (3)
app/src/utils/colors.ts (2)
slate600(14-14)white(7-7)app/src/layouts/ExpandableBottomLayout.tsx (1)
ExpandableBottomLayout(158-163)app/src/components/typography/Title.tsx (1)
Title(8-27)
app/src/screens/prove/ProofRequestStatusScreen.tsx (2)
app/src/stores/database.ts (1)
updateProofStatus(143-156)app/src/stores/database.web.ts (1)
updateProofStatus(218-253)
app/src/utils/proving/attest.ts (1)
app/src/utils/proving/provingUtils.ts (1)
ec(13-13)
app/src/layouts/SimpleScrolledTitleLayout.tsx (1)
app/src/components/buttons/SecondaryButton.tsx (1)
SecondaryButton(8-23)
app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx (2)
app/src/utils/colors.ts (2)
slate600(14-14)white(7-7)app/src/layouts/ExpandableBottomLayout.tsx (1)
ExpandableBottomLayout(158-163)
app/src/screens/prove/ConfirmBelongingScreen.tsx (3)
app/src/utils/proving/provingMachine.ts (1)
useProvingStore(198-1012)app/src/utils/haptic/index.ts (1)
notificationSuccess(16-16)app/src/consts/analytics.ts (1)
ProofEvents(55-111)
app/env.ts (1)
app/tests/__setup__/@env.js (2)
GOOGLE_SIGNIN_ANDROID_CLIENT_ID(4-4)GOOGLE_SIGNIN_ANDROID_CLIENT_ID(4-4)
app/src/utils/nfcScanner.ts (2)
app/env.ts (1)
ENABLE_DEBUG_LOGS(14-14)app/tests/__setup__/@env.js (2)
ENABLE_DEBUG_LOGS(8-8)ENABLE_DEBUG_LOGS(8-8)
app/src/screens/prove/ViewFinderScreen.tsx (1)
app/src/components/typography/Title.tsx (1)
Title(8-27)
app/src/screens/dev/DevSettingsScreen.tsx (1)
app/src/utils/colors.ts (1)
textBlack(39-39)
app/src/utils/cloudBackup/google.ts (2)
app/env.ts (1)
GOOGLE_SIGNIN_ANDROID_CLIENT_ID(8-9)app/tests/__setup__/@env.js (2)
GOOGLE_SIGNIN_ANDROID_CLIENT_ID(4-4)GOOGLE_SIGNIN_ANDROID_CLIENT_ID(4-4)
app/src/screens/prove/ProveScreen.tsx (2)
app/src/components/typography/BodyText.ts (1)
BodyText(7-9)app/src/utils/colors.ts (1)
slate300(11-11)
app/src/screens/settings/PassportDataInfoScreen.tsx (2)
app/src/utils/constants.ts (1)
extraYPadding(3-3)app/src/utils/colors.ts (1)
white(7-7)
app/src/screens/dev/MockDataScreen.tsx (8)
common/src/utils/passports/genMockIdDoc.ts (1)
genMockIdDoc(47-77)app/src/utils/colors.ts (4)
white(7-7)borderColor(38-38)textBlack(39-39)separatorColor(40-40)app/src/utils/constants.ts (1)
extraYPadding(3-3)app/src/mocks/react-native-gesture-handler.ts (1)
GestureDetector(43-48)app/src/components/typography/Title.tsx (1)
Title(8-27)app/src/components/typography/BodyText.ts (1)
BodyText(7-9)app/src/utils/haptic/index.ts (2)
buttonTap(19-19)selectionChange(18-18)app/src/consts/analytics.ts (1)
MockDataEvents(138-150)
app/src/screens/settings/SettingsScreen.tsx (2)
app/src/utils/colors.ts (1)
black(6-6)app/src/utils/constants.ts (1)
extraYPadding(3-3)
app/src/screens/settings/ManageDocumentsScreen.tsx (3)
app/src/providers/passportDataProvider.tsx (2)
loadDocumentCatalog(104-118)getAllDocuments(235-251)app/src/utils/colors.ts (3)
textBlack(39-39)borderColor(38-38)white(7-7)app/src/utils/constants.ts (1)
extraYPadding(3-3)
app/tests/__setup__/@env.js (1)
app/env.ts (9)
GOOGLE_SIGNIN_ANDROID_CLIENT_ID(8-9)GOOGLE_SIGNIN_WEB_CLIENT_ID(10-11)SENTRY_DSN(12-12)SEGMENT_KEY(13-13)ENABLE_DEBUG_LOGS(14-14)DEFAULT_PNUMBER(15-15)DEFAULT_DOB(16-16)DEFAULT_DOE(17-17)MIXPANEL_NFC_PROJECT_TOKEN(18-18)
app/src/screens/misc/LoadingScreen.tsx (2)
app/src/utils/proving/provingMachine.ts (1)
ProvingStateType(134-156)app/src/utils/colors.ts (1)
black(6-6)
🔇 Additional comments (129)
app/src/screens/misc/LaunchScreen.tsx (1)
38-45: ExplicitbackgroundColorprop improves readability and avoids shorthand ambiguity—nice touch.
This aligns with the new ESLint style rules and keeps the styling intent crystal-clear. No functional impact observed.app/src/layouts/SimpleScrolledTitleLayout.tsx (3)
3-3: Good TypeScript modernization!Explicitly importing
PropsWithChildrendirectly is cleaner than accessing it via the React namespace. This improves code readability and follows modern React TypeScript patterns.
14-14: Consistent with import modernization.The interface correctly uses the directly imported
PropsWithChildrentype, maintaining the same type safety while being consistent with the updated import statement.
47-47: Confirm Tamagui spacing token mappingI didn’t find a local definition for the
$2token in the repo, so it’s likely coming from Tamagui’s default theme. Please double-check that$2indeed resolves to16px. If it doesn’t, hard-coding16here could drift from your design system.• Affected locations:
–app/src/layouts/SimpleScrolledTitleLayout.tsx(SecondaryButtonmarginBottom={16})
–app/src/screens/misc/LaunchScreen.tsx(marginBottom: 16)
–app/src/components/native/PassportCamera.web.tsx(marginBottom: '16px')Recommendations:
- If
$2equals 16px in your theme, feel free to keep it explicit—but be aware future token changes won’t propagate.- Otherwise, revert to token usage (
marginBottom="$2") or define a custom token for 16px spacing to preserve design consistency.app/src/screens/passport/PassportNFCScanScreen.web.tsx (1)
35-37: LGTM! Style prop standardization improves readability.The change from shorthand props (
h,w) to full CSS property names (height,width) enhances code clarity and aligns with the updated ESLint configuration. This standardization makes the codebase more maintainable.app/src/components/native/RCTFragment.tsx (1)
4-9: LGTM! Import consolidation enhances code organization.Consolidating the React Native imports into a single grouped statement improves readability and aligns with the updated ESLint import sorting rules. The functionality remains unchanged while the code structure is cleaner.
app/src/stores/proofHistoryStore.ts (1)
170-170: LGTM! Enforcing immutability with const declaration.Changing from
lettoconstfortotalCountis appropriate since the variable is never reassigned. This enforces immutability and prevents accidental modifications, improving code safety and aligning with TypeScript best practices.app/src/screens/prove/QRCodeTroubleScreen.tsx (2)
3-3: LGTM! Explicit hook import follows modern React patterns.Explicitly importing
useEffectand using it directly instead ofReact.useEffectimproves code consistency and follows modern React development patterns. This standardization enhances maintainability across the codebase.
48-50: LGTM! Consistent hook usage after explicit import.The direct
useEffectcall aligns with the explicit import pattern and maintains the same functionality for analytics flushing on error screen mount. The dependency array is correctly empty for one-time execution.app/src/screens/passport/PassportCameraTroubleScreen.tsx (2)
3-3: LGTM! Consistent hook import pattern across trouble screens.The explicit
useEffectimport maintains consistency with other trouble screen components and follows modern React development practices. This standardization improves codebase maintainability.
51-53: LGTM! Proper analytics flushing on error screen mount.The direct
useEffectusage with empty dependency array correctly flushes analytics once when the trouble screen mounts. This pattern is consistent with other error screens in the application.app/src/components/ErrorBoundary.tsx (1)
3-3: LGTM: Clean import modernizationThe update from
React.Componentto named imports aligns with modern React patterns and improves code clarity. The functionality remains unchanged while making dependencies more explicit.Also applies to: 18-18
app/src/screens/home/ProofHistoryDetailScreen.tsx (1)
92-92: Excellent dependency array fixAdding
data.appNameto the dependency array is crucial since the disclosure strings are templated with the app name. This prevents stale closures and ensures the UI updates correctly when the app name changes.app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx (1)
35-40: Good standardization of style propsReplacing shorthand Tamagui props with full CSS property names improves code readability and maintainability. This makes the styling more explicit and easier to understand for developers familiar with standard CSS.
app/src/screens/home/DisclaimerScreen.tsx (1)
38-38: Consistent style prop standardizationConverting shorthand props (
f,jc,pb) to full CSS property names (flex,justifyContent,paddingBottom) maintains consistency with the codebase-wide standardization effort and improves code clarity.app/src/screens/passport/PassportNFCTroubleScreen.tsx (1)
3-3: Clean React hook import modernizationUpdating from
React.useEffectto directuseEffectimport follows modern React patterns and improves code clarity. The change maintains identical functionality while making hook dependencies more explicit.Also applies to: 50-50
app/src/components/native/PassportCamera.web.tsx (2)
3-3: LGTM: Import modernization aligns with React best practices.The explicit import of
useEffectfollows modern React patterns and improves code readability. This change is consistent with the broader ESLint configuration updates across the codebase.
30-30: Clean conversion from React.useEffect to direct useEffect usage.The direct usage of
useEffectis more concise and aligns with contemporary React development patterns. The hook's functionality and dependencies remain unchanged.app/src/screens/recovery/PassportDataNotFoundScreen.tsx (3)
3-3: Good modernization of React import pattern.Explicit import of
useEffectimproves code clarity and follows current React best practices.
19-19: Clean conversion to direct useEffect usage.The direct
useEffectcall is more readable and consistent with modern React development patterns.
29-33: Improved prop readability with explicit marginTop.Converting from the shorthand
mt={8}to explicitmarginTop={8}with multi-line formatting enhances code readability and maintainability. This change aligns with the project-wide effort to standardize prop naming conventions.app/src/layouts/ExpandableBottomLayout.tsx (1)
107-107: No remainingpbusages found – removal of shorthand fallback is safeI ran a project-wide search for any
pb=attributes (including on ExpandableBottomLayout and BottomSection) in all.ts/.tsxfiles underapp/srcand found zero occurrences. You can safely standardize onpaddingBottomwithout breaking existing components.app/src/mocks/react-native-safe-area-context.js (2)
3-3: Excellent modernization of React imports in mock file.Converting to named imports (
createContext,createElement,Fragment) from default React import improves consistency with the broader codebase changes and follows modern React patterns.
7-7: Clean conversion to direct React API usage.The direct usage of
createElement,Fragment, andcreateContexteliminates the need to access these through the React object, making the code more concise and consistent with the project's updated import style.Also applies to: 19-19, 37-37, 39-44
app/src/utils/proving/cose.ts (1)
22-22: No namedcoseimports detected – removal of named export is safeI performed a repo-wide search under
app/srcand found only a default import ofcosein
app/src/utils/proving/attest.ts:14No instances of
import { cose }were found. Removing the named export fromcose.tswon’t break any existing internal usage.app/src/screens/home/HomeScreen.tsx (3)
8-8: Good practice: Explicit hook imports improve code clarityThe change from importing React as a namespace to explicitly importing
useCallbackalongside React improves code readability and makes dependencies more transparent.
56-69: Proper useCallback implementation for useFocusEffect optimizationWrapping the async function in
useCallbackwith correct dependencies ([getAllDocuments, navigation]) is essential for preventing unnecessary re-renders and ensuring the effect updates when dependencies change.
78-80: Style prop standardization enhances code consistencyThe changes from shorthand props (
bg,jc,ai) to full CSS property names (backgroundColor,justifyContent,alignItems) improve code readability and align with explicit styling conventions across the codebase. This standardization reduces ambiguity and makes the code more accessible to developers unfamiliar with Tamagui's shorthand syntax.Also applies to: 85-85, 92-92
app/src/screens/prove/ProofRequestStatusScreen.tsx (1)
92-100: Essential fix: Complete dependency array prevents stale closuresThe expanded dependency array now correctly includes all variables used within the effect (
appName,sessionId,errorCode,reason,updateProofStatus). This prevents stale closure bugs where the effect might use outdated values and ensures proper re-execution when any of these dependencies change. This is particularly important for the analytics tracking and database updates performed in this effect.app/src/screens/recovery/RecoverWithPhraseScreen.tsx (2)
85-85: Correct dependency array ensures callback freshnessAdding
navigationandtrackEventto the dependency array is essential since both are used within therestoreAccountcallback. This prevents stale closures and ensures the callback always has access to the current navigation instance and tracking function, which is critical for the account recovery flow.
88-93: Style prop standardization maintains consistencyThe conversion from
pbtopaddingBottomaligns with the codebase-wide effort to use explicit CSS property names. The reformatted YStack props also improve readability by placing each prop on its own line.Also applies to: 122-122
app/scripts/mobile-deploy-confirm.cjs (1)
282-282: Good refactoring: Removed unused parameter improves function clarityThe removal of the unused
versionsparameter fromdisplayDeploymentHeaderis a clean refactoring that simplifies the function signature. Since the parameter wasn't used within the function implementation, this change reduces complexity without affecting functionality. The corresponding call site was correctly updated to match the new signature.Also applies to: 353-353
app/src/screens/settings/PassportDataInfoScreen.tsx (1)
51-51: Style standardization improves code readabilityThe conversion of shorthand style props (
py,f,jc,px) to their full CSS property equivalents (paddingVertical,flex,justifyContent,paddingHorizontal) enhances code clarity and maintains consistency with the broader codebase refactoring effort. These explicit property names make the styling intentions more transparent and accessible to all developers.Also applies to: 91-91, 93-93, 97-97
app/src/screens/passport/PassportNFCScanScreen.tsx (3)
262-272: Dependency array improvements look good!The addition of
route.params,navigation, andopenErrorModalto the dependency array correctly captures all values used within theonVerifyPresscallback. This ensures the callback stays fresh when these dependencies change.
282-282: Appropriate dependency array simplification.Since the function body is commented out and only contains empty logic, the empty dependency array is correct.
330-331: Consistent style prop naming improves readability.The change from shorthand style props (
h,w,mt,mb) to full property names (height,width,marginTop,marginBottom) enhances code clarity and consistency across the codebase.Also applies to: 360-371, 377-377
app/src/providers/authProvider.tsx (2)
223-223: Correct dependency array for loginWithBiometrics.Adding
authenticationTimeoutinMsto the dependency array is necessary since it's used within the callback on line 221. This ensures the callback updates when the timeout value changes.
249-255: Proper memoization dependencies for context state.Including
getOrCreateMnemonicandrestoreAccountFromMnemonicin theuseMemodependency array ensures the context state updates correctly when these callback functions change. This prevents stale closures in the context value.app/src/providers/passportDataProvider.tsx (2)
41-48: Clean import consolidation from @selfxyz/common.Grouping related imports together improves code organization and readability. The added imports (
brutforceSignatureAlgorithmDsc,parseCertificateSimple,PassportData) are properly integrated with existing imports.
59-59: Streamlined authProvider imports.Combining
unsafe_getPrivateKeyanduseAuthinto a single import statement follows best practices for import organization.app/src/screens/misc/SplashScreen.tsx (3)
6-6: Improved React hook imports and usage.Direct import and usage of
useStateis cleaner and more explicit than accessing it through the React namespace. This aligns with modern React patterns.Also applies to: 27-28
15-15: Good import consolidation.Grouping
storePassportDatawith other passport data provider imports improves code organization.
110-110: Correct useEffect dependencies.Adding
checkBiometricsAvailableandsetBiometricsAvailableto the dependency array ensures the effect re-runs when these functions change, maintaining proper hook behavior.app/src/hooks/useConnectionModal.ts (1)
59-59: Improved useEffect dependency array.The updated dependencies correctly include all state and functions used within the effect (
dismissModal,hasNoConnection,hideNetworkModal,showModal,visible). Removing the directnavigationRef.isReady()call from dependencies is appropriate since it's called within the effect rather than being a dependency.app/src/screens/prove/ConfirmBelongingScreen.tsx (2)
35-37: Excellent refactoring to individual store selectors.The change from using the entire
provingStoreobject to individual selectors (init,setFcmToken,setUserConfirmed) is a significant improvement. This prevents unnecessary re-renders when unrelated store state changes and follows Zustand best practices.
42-43: Proper useEffect dependency management.The dependency array now correctly includes
[init]instead of the entire store object. This ensures the effect only re-runs if theinitfunction reference changes, which should be stable with Zustand's selector pattern.app/src/screens/dev/DevSettingsScreen.tsx (4)
9-9: Good practice: Direct import of React hooks.Importing
useMemodirectly from React improves code clarity and follows modern React patterns.
116-129: Correct useMemo optimization for static data.The
useMemowith an empty dependency array is appropriate here since theitemsarray is static and defined outside the component. This optimization prevents unnecessary re-creation of the Select.Item components on every render.
214-221: Style prop standardization improves readability.The changes from shorthand style props (e.g.,
p,bg,w,mt,mb,ai) to full property names (padding,backgroundColor,width,marginTop,marginBottom,alignItems) enhance code clarity and maintainability.Also applies to: 223-231, 242-254, 256-264, 278-306, 329-356
97-97: Please verifyAdapt’swhenprop type and remove theas anycast if possibleThe literal
{'sm' as any}implies thatAdaptProps['when']may not accept the string"sm"directly. Locate the type definition in yourtamaguipackage (e.g.node_modules/tamagui/dist/types/src/adapt/index.d.ts) and confirm whether"sm"is included in the allowed union. If it is, you can simplify the JSX as follows:• app/src/screens/dev/DevSettingsScreen.tsx: line 97
- <Adapt when={'sm' as any} platform="touch"> + <Adapt when="sm" platform="touch">app/src/screens/settings/ManageDocumentsScreen.tsx (4)
5-5: Good addition of useCallback import.Direct import of
useCallbackfollows modern React patterns and improves code organization.
37-55: Proper memoization with comprehensive dependencies.Converting
loadPassportDataInfoto auseCallbackwith explicit dependencies is excellent for performance. The dependency array correctly includes all functions used within the callback (loadDocumentCatalog,getAllDocuments,setDocumentCatalog,setAllDocuments).
57-59: Correct useEffect dependency management.The
useEffectnow properly depends on the memoizedloadPassportDataInfocallback, ensuring it re-runs when dependencies change while preventing unnecessary executions.
142-158: Consistent style prop standardization.The updates from shorthand props (
ai,jc,p,py,mb,f,bg,w) to full property names (alignItems,justifyContent,padding,paddingVertical,marginBottom,flex,backgroundColor,width) align with the codebase-wide consistency improvements.Also applies to: 163-177, 181-257, 281-314
app/index.js (1)
7-7: Correct placement of gesture handler import.Moving the
react-native-gesture-handlerimport to the app entry point is the recommended approach for proper initialization. This ensures the gesture handler is set up before any navigation or gesture-dependent components are loaded.app/src/screens/settings/ShowRecoveryPhraseScreen.tsx (1)
19-19: Proper useCallback dependency management.Adding
loadMnemonicto the dependency array ensures the callback is correctly memoized and re-created when theloadMnemonicfunction reference changes. This aligns with the broader effort to maintain accurate hook dependencies across recovery phrase components.app/src/components/NavBar/BaseNavBar.tsx (2)
42-42: Good immutability practice with const declaration.Changing from
lettoconstimproves code clarity and prevents accidental reassignment.
72-72: Essential dependency array fix for useMemo correctness.The expanded dependency array
[color, component, onPress]is crucial - the previous[component]array was missingcolorandonPressdependencies, which could lead to stale closures and UI bugs when these props change.app/src/screens/passport/PassportCameraScreen.tsx (1)
135-135: Improved style prop clarity with explicit property names.The change from shorthand style props (
pb,pt) to explicit property names (paddingBottom,paddingTop) enhances code readability and maintainability, especially for developers less familiar with the shorthand syntax.Also applies to: 138-138
app/src/navigation/index.tsx (2)
9-9: Improved import efficiency with named imports.Using named imports
{ useEffect }instead of accessing through the React namespace enables better tree-shaking and is the preferred React pattern.
76-76: Cleaner hook usage with direct useEffect import.Direct
useEffectusage is more concise thanReact.useEffectand follows React best practices.app/src/stores/selfAppStore.tsx (1)
5-5: Enhanced code clarity with descriptive import naming.Renaming the Socket.IO client import from
iotosocketIoimproves readability and makes the code more self-documenting, especially valuable in files with multiple imports.Also applies to: 35-35
app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx (1)
30-30: Critical useCallback dependency array fix for mnemonic security.Adding
[loadMnemonic]to the dependency array is essential - the previous empty array could lead to stale closures where the callback uses an outdatedloadMnemonicreference. This is particularly important for security-sensitive recovery phrase operations.app/src/screens/prove/ViewFinderScreen.tsx (2)
141-141: Style prop expansion improves readabilityGood change from shorthand
pbto explicitpaddingBottom- this enhances code clarity and maintains consistency with the broader codebase refactoring effort.
144-144: Consistent style prop namingThe change from
pttopaddingTopaligns well with the standardization effort across the codebase. This makes the styling more explicit and easier to understand.app/src/screens/settings/CloudBackupScreen.tsx (2)
113-113: Style standardization continuesExcellent consistency with the codebase-wide effort to replace shorthand style props with explicit names. The change from
pbtopaddingBottomimproves readability.
137-137: Explicit padding property namingThe change from
pttopaddingTopmaintains the standardization pattern seen across other components. This makes the styling intentions more explicit.app/env.ts (1)
8-9: Approve: Runtime validation and test mocks confirmed for GOOGLE_SIGNIN_ANDROID_CLIENT_ID
- Runtime check in
app/src/utils/cloudBackup/google.tsthrows an error if the Android client ID is missing in non-test environments.- Test setup in
app/tests/__setup__/@env.jsprovides a mockGOOGLE_SIGNIN_ANDROID_CLIENT_ID.- Sample env file (
app/env.sample) includes the new variable placeholder.All patterns align with existing exports and security best practices—no further changes needed.
app/src/mocks/react-native-gesture-handler.ts (3)
7-7: Explicit import improves clarityGood change to explicitly import
createElementalongside React. This makes the dependencies more explicit and follows modern React import patterns.
14-14: Consistent use of explicit importUsing the directly imported
createElementfunction is cleaner and more explicit than accessing it through the React namespace.
47-47: Maintains consistency across mock componentsThe same pattern applied to
GestureDetectormaintains consistency throughout the mock implementation.app/src/screens/recovery/AccountRecoveryScreen.tsx (3)
29-34: Style prop standardization looks good.The conversion from shorthand
p="$5"to explicitpadding="$5"improves code readability and aligns with the broader ESLint configuration updates in this PR.
39-39: Consistent style prop naming applied.The change from
pb="$2.5"topaddingBottom="$2.5"maintains the same styling behavior while improving code clarity.
46-46: Final style prop conversion completed properly.The transformation from
pt="$6"topaddingTop="$6"completes the standardization pattern consistently applied throughout this component.app/src/utils/deeplinks.ts (2)
3-3: Improved import specificity enhances tree shaking.The change from default import to named import (
parseUrl) is a good practice that enables better bundle optimization and aligns with the updated ESLint configuration.
28-28: Usage correctly updated to match new import.The function call has been properly updated to use the directly imported
parseUrlfunction, maintaining identical functionality while improving code clarity.app/src/components/Mnemonic.tsx (2)
66-66: Critical dependency array fix improves React hooks correctness.Adding
onRevealWordsandsetHasViewedRecoveryPhraseto the dependency array is essential to prevent stale closure bugs. This ensures the callback updates correctly when these dependencies change.
101-101: Verify use of spacing tokens vs. hardcoded paddingOur grep search shows that nearly every component (e.g. ProofHistoryScreen, SettingsScreen, ProofHistoryDetailScreen, Disclosures, Tips, Mnemonic) uses hardcoded paddingVertical values (2, 12, 16, 20, 22, 28) and we found no instances of a theme-based
py="$n"token in app/src.Please confirm whether the design system offers spacing tokens for vertical padding. If it does, consider swapping
paddingVertical={16}(and the other numeric paddingVerticals) for the corresponding token (e.g.py="$2"). Otherwise, keeping the hardcoded value here is consistent with the rest of the codebase.• Files using hardcoded paddingVertical:
- app/src/screens/home/ProofHistoryScreen.tsx (
paddingVertical={2})- app/src/screens/settings/SettingsScreen.tsx (
paddingVertical={20})- app/src/screens/home/ProofHistoryDetailScreen.tsx (
paddingVertical={4, 12, 16})- app/src/components/Disclosures.tsx (
paddingVertical={22})- app/src/components/Mnemonic.tsx (
paddingVertical={28}, later16)- app/src/components/Tips.tsx (
paddingVertical={10})app/src/types/svg.d.ts (1)
1-6: Excellent TypeScript support for SVG imports.This declaration file provides proper type safety for SVG assets in React Native, ensuring imported SVG components have correct
SvgPropstyping. This eliminates TypeScript errors and improves developer experience when working with SVG assets.app/src/utils/proving/attest.ts (3)
8-8: Import optimization maintains cryptographic security.The change to named import (
ec as ellipticEc) improves bundle optimization and code clarity while preserving identical cryptographic functionality for TEE attestation verification.
292-292: Elliptic curve instantiation correctly updated.The usage has been properly updated to use the renamed import, maintaining the same p384 elliptic curve operations for public key extraction from PEM certificates.
340-340: Certificate signature verification maintains consistency.The elliptic curve instantiation in the signature verification function correctly uses the updated import, preserving the cryptographic integrity of certificate chain validation.
app/tests/__setup__/svgMock.js (1)
3-5: Modern React import pattern implemented correctly.The change from default React import to named
createElementimport aligns with React 17+ best practices and reduces bundle size. The component implementation is correctly updated to use the direct import.app/src/hooks/useMnemonic.ts (1)
19-19: Correct dependency array fix for useCallback.Adding
getOrCreateMnemonicto the dependency array ensures the callback updates when the function reference changes, preventing stale closure bugs. This follows React hooks best practices and aligns with ESLint rules for exhaustive dependencies.app/tests/__setup__/notificationServiceMock.js (1)
6-8: Good cleanup of unused parameter.Removing the unused
stateparameter simplifies the mock implementation while maintaining the same functionality. This cleanup aligns with modern linting practices and improves code maintainability.app/src/hooks/useAesopRedesign.ts (1)
6-6: Clarify IS_TEST_BUILD conversion without JSON.parseThe current hook uses
JSON.parse(String(IS_TEST_BUILD ?? 'false'))to coerce both boolean and string inputs into a boolean. While it “works,” replacing it withBoolean()or returningIS_TEST_BUILDdirectly would break the test stub (sinceBoolean('false')yieldstrueand a non‐empty string is truthy). Instead, pick one of these cleaner approaches:• Update the test stub to export a boolean, then simplify the hook:
File:app/tests/__setup__/@env.js- export const IS_TEST_BUILD = 'false'; + export const IS_TEST_BUILD = false;File:
app/src/hooks/useAesopRedesign.ts- return JSON.parse(String(IS_TEST_BUILD ?? 'false')); + return IS_TEST_BUILD;• Or, handle both types explicitly in the hook without JSON.parse:
File:app/src/hooks/useAesopRedesign.tsexport function shouldShowAesopRedesign() { return typeof IS_TEST_BUILD === 'string' ? IS_TEST_BUILD === 'true' : IS_TEST_BUILD; }Either change makes the conversion intention clear, avoids misuse of
JSON.parse, and keeps tests green.Likely an incorrect or invalid review comment.
app/src/utils/cloudBackup/google.ts (3)
3-3: LGTM: Clean import using the new path alias.The import statement correctly uses the
@envpath alias, which aligns with the TypeScript configuration changes in this PR.
11-19: Excellent runtime validation implementation.The dual test environment detection (
NODE_ENV === 'test'andJEST_WORKER_ID) provides robust coverage, and the descriptive error message makes debugging straightforward. This prevents potential runtime failures in production when the environment variable is missing.
24-24: Good fallback strategy for test environments.The fallback to
'mock-client-id'ensures tests can execute without requiring actual Google Sign-In credentials, while the runtime check above ensures production environments have proper configuration.app/src/screens/home/ProofHistoryScreen.tsx (2)
301-301: Correct dependency array fix prevents stale closures.Adding
navigationto the dependency array ensures therenderItemcallback is properly updated when the navigation object changes, preventing potential stale closure issues sincenavigation.navigate()is used within the callback.
373-377: Good stylistic improvement for clarity.Replacing shorthand props (
bg,pb) with full property names (backgroundColor,paddingBottom) improves code readability and aligns with the consistent styling approach being adopted across the codebase.app/src/utils/proving/provingMachine.ts (2)
12-12: Good naming improvement for clarity.Renaming the Socket.IO import from
iotosocketIomakes the code more self-documenting and aligns with the consistent naming approach being adopted across the codebase.
408-408: Improved variable declaration and consistency.The changes correctly update the function call to match the renamed import, and using
constinstead ofletis more appropriate since the socket variable isn't reassigned after instantiation.app/src/screens/misc/LoadingScreen.tsx (3)
29-37: Good performance optimization.Moving the
terminalStatesarray to module level prevents unnecessary recreation on every render since the array contents are static. This is a solid performance improvement.
102-103: Verify the ESLint disable is justified.The ESLint disable for
react-hooks/exhaustive-depsshould be used cautiously. Ensure that excludingpassportDatafrom the dependency array won't cause issues if it changes while the component is focused.Consider if the effect should re-run when
passportDatachanges, or if there's a specific reason to exclude it from dependencies.
166-168: Consistent stylistic improvement.Replacing shorthand props (
bg,jc) with full property names (backgroundColor,justifyContent) improves code readability and maintains consistency with the styling approach being standardized across the codebase.app/src/screens/prove/ProveScreen.tsx (4)
4-4: Clean import consolidation.Consolidating the two imports from
@selfxyz/commoninto a single line improves code organization while maintaining readability.
75-75: Correct dependency array fix.Adding
addProofHistoryto the dependency array ensures the effect properly updates when the function reference changes, following React hooks best practices and preventing stale closures.
97-97: Proper dependency tracking for store usage.Adding
provingStoreto the dependency array ensures the effect correctly responds to store changes sinceprovingStore.init()is called within the effect.
204-204: Consistent style prop standardization.Replacing shorthand
mbwithmarginBottomimproves code clarity and aligns with the consistent styling approach being adopted throughout the codebase.Also applies to: 211-211
app/src/screens/settings/SettingsScreen.tsx (4)
4-4: Good consolidation of icon imports.The consolidation of
BugandFileTextimports from@tamagui/lucide-iconsimproves maintainability and reduces import clutter.
118-119: Excellent style prop standardization.Converting shorthand props (
py,px) to their full equivalents (paddingVertical,paddingHorizontal) significantly improves code readability and consistency. This makes the codebase more accessible to developers unfamiliar with the shorthand syntax.
135-135: Proper useCallback dependency array update.Adding
hrefto the dependency array ensures the callback is properly memoized and will update when the href changes. This prevents potential stale closure issues.
219-233: Consistent style prop improvements throughout the component.The systematic replacement of shorthand style props (
bg,jc,ai) with their full equivalents (backgroundColor,justifyContent,alignItems) creates a more maintainable and readable codebase. This consistency will help new team members understand the styling patterns more quickly.Also applies to: 246-261
app/src/screens/dev/DevFeatureFlagsScreen.tsx (2)
197-197: Appropriate ESLint disable for cleanup-only effect.The ESLint disable comment for
react-hooks/exhaustive-depsis correctly applied here. This cleanup effect should only run on unmount to clear debounce timers, and includingdebounceTimersin the dependency array would cause the effect to run unnecessarily on every timer change.
225-229: Consistent style prop standardization across the component.The conversion of shorthand style props to their full equivalents (
backgroundColor,paddingHorizontal,paddingVertical) maintains consistency with the broader codebase changes. This improves readability and makes the styling more explicit.Also applies to: 252-255, 271-276
app/package.json (3)
156-157: Good addition of TypeScript ESLint support.Adding
@typescript-eslint/eslint-pluginand@typescript-eslint/parserat version^7.18.0provides enhanced TypeScript linting capabilities. This will help catch TypeScript-specific issues and improve code quality.
161-163: Enhanced import management capabilities.The addition of
eslint-import-resolver-typescriptandeslint-plugin-importwill provide better import path resolution and linting for TypeScript files. This supports the enhanced ESLint configuration mentioned in the PR objectives.
160-160: Approve pinning to [email protected]Locking to 10.1.8 is the recommended mitigation after the July 2025 supply-chain compromise (CVE-2025-54313) that affected only versions 8.10.1, 9.1.1, 10.1.6, and 10.1.7. Version 10.1.8 is the first clean release in the 10.x series and contains no known vulnerabilities, so this pin both prevents accidental upgrades into the malicious range and maintains the latest safe fixes.
app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx (2)
90-97: Comprehensive useCallback dependency array fix.The updated dependency array now correctly includes all dependencies used within the callback:
navigation(used for navigation.navigate calls)toggleCloudBackupEnabled(used conditionally)cloudBackupEnabled(used in conditional logic)This ensures the callback will update properly when any of these values change, preventing stale closure bugs.
107-112: Consistent style prop standardization.The systematic replacement of shorthand style props (
p,pb,pt,ai,pl) with their full equivalents (padding,paddingBottom,paddingTop,alignItems,paddingLeft) maintains consistency with the broader codebase improvements and enhances readability.Also applies to: 117-117, 130-130, 139-139, 151-151
app/tsconfig.json (2)
7-9: Clean environment variable import alias.The
@envpath alias pointing to./env.tsprovides a clean, consistent way to import environment variables throughout the application. This improves maintainability and makes environment variable usage more explicit.
11-45: Comprehensive TypeScript compilation optimization.The addition of explicit
includeandexcludeconfigurations optimizes TypeScript compilation by:
- Focusing compilation on source files (
src/**/*)- Excluding build artifacts, configuration files, and platform-specific directories
- Preventing unnecessary type checking of third-party and generated files
This will improve compilation performance and reduce potential type conflicts.
app/src/screens/dev/MockDataScreenDeepLink.tsx (3)
4-8: LGTM: Clean import consolidationThe import consolidation from
@selfxyz/commonimproves readability and maintainability by grouping related imports together.
46-85: Excellent resolution of the temporal dead zone issueThe
handleGeneratefunction is now properly declared before theuseEffectthat depends on it, and the dependency array correctly includeshandleGenerate. This resolves the previously reported temporal dead zone violation.
89-202: Approve style prop standardizationThe conversion from shorthand Tamagui props (e.g.,
f,bg,pt) to their full equivalents (e.g.,flex,backgroundColor,paddingTop) significantly improves code readability and maintainability. This change aligns with the broader pattern applied across the codebase.app/src/utils/proving/provingInputs.ts (2)
5-21: Well-organized import consolidationThe expanded imports from
@selfxyz/commonare properly organized and include the necessary utility functions and constants for the proving logic. This consolidation improves maintainability.
80-81: Good streamlining of SMT instantiationThe immediate declaration and instantiation of
nameAndDobSMTandnameAndYobSMTreduces code complexity while maintaining the same functionality. This is a clean refactoring.app/src/screens/dev/MockDataScreen.tsx (5)
4-10: Clean import consolidationThe consolidated imports from
@selfxyz/commonimprove code organization and maintainability.
52-124: Excellent code organization improvementsMoving the signature algorithm mapping and helper function to module scope significantly improves code readability and organization. Since this is a development screen, the module-scope constant won't impact performance in production.
156-156: Good immutability enforcementChanging from
lettoconstfor thevaluevariable enforces immutability where appropriate, improving code safety.
241-249: Proper dependency array organizationThe reordered dependency array maintains alphabetical ordering which improves readability and reduces the likelihood of missing dependencies during code reviews.
261-595: Comprehensive style prop standardizationThe systematic replacement of shorthand Tamagui props with full CSS property names throughout the component greatly improves code readability and maintainability. This change aligns perfectly with the broader codebase improvements.
app/tests/__setup__/@env.js (1)
4-12: Well-structured test environment setupThe mock environment constants are appropriately configured for testing:
- Mock Google Sign-In client IDs prevent real authentication in tests
- Mock Sentry DSN and Segment key avoid sending test data to production services
ENABLE_DEBUG_LOGSas string'false'matches the pattern from the main environment configuration- Undefined values for personal data fields are appropriate for test isolation
This setup ensures tests run in a controlled environment without external dependencies.
app/.eslintrc.cjs (5)
3-8: Proper TypeScript parser configurationThe
@typescript-eslint/parserwith ECMAScript 2021 and JSX support is correctly configured for a React Native TypeScript project.
9-19: Comprehensive and well-ordered extends configurationThe extends array provides excellent coverage with recommended configurations for:
- ESLint core rules
- TypeScript-specific linting
- React and React Hooks best practices
- Import/export validation with TypeScript support
- Jest testing rules
- Prettier integration
This configuration ensures high code quality across all aspects of the React Native TypeScript project.
32-41: Essential settings for TypeScript and ReactThe settings configuration is excellent:
- Automatic React version detection prevents version mismatch warnings
- TypeScript import resolver with
alwaysTryTypesensures proper module resolution- Ignoring
react-nativeimports prevents false positives from React Native's module structure
42-88: Well-balanced rule configurationThe rule configuration strikes an excellent balance between code quality and developer productivity:
Import Rules: Properly configured
simple-import-sortwith disabled conflicting rules
React Rules: Sensible overrides for React Native development
TypeScript Rules: Appropriate warnings foranytypes while allowing necessary flexibility
General Rules: Warnings instead of errors for common issues likeconsole.logThe rules support modern React Native development practices while maintaining code quality standards.
89-107: Necessary CommonJS override configurationThe override for
.cjsfiles is essential and properly configured:
- Correct Node.js environment settings
- Disabled header rule for configuration files
- Appropriate parser options for CommonJS modules
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🔭 Outside diff range comments (2)
app/src/screens/prove/ProveScreen.tsx (1)
85-98: Reduce dependency churn inuseEffect
provingStoreis the entire Zustand store state.
Every field update – even ones unrelated toinit– will retrigger this effect and callprovingStore.init('disclose'), which is probably not what you want.Extract only the stable callback you need:
-const provingStore = useProvingStore(); +const initProving = useProvingStore(s => s.init);Then:
-}, [selectedApp, isFocused, provingStore]); +}, [selectedApp, isFocused, initProving]);This keeps the effect deterministic and avoids unnecessary initialisations.
app/src/screens/recovery/RecoverWithPhraseScreen.tsx (1)
48-86: Potential race-condition onrestoringflag
setRestoring(false)is executed on each early return, but there’s nofinallyblock.
If an unexpected exception is thrown between the early returns, the flag might staytrue, freezing the UI.-const restoreAccount = useCallback(async () => { +const restoreAccount = useCallback(async () => { setRestoring(true); try { ... } finally { setRestoring(false); } }, [mnemonic, navigation, restoreAccountFromMnemonic, trackEvent]);
♻️ Duplicate comments (1)
app/src/screens/dev/MockDataScreenDeepLink.tsx (1)
46-60: Excellent fix for the temporal dead zone issue.The
handleGeneratefunction is now properly positioned above theuseEffectthat depends on it and correctly wrapped inuseCallback. This addresses the critical issue identified in previous reviews.
🧹 Nitpick comments (8)
app/src/components/native/RCTFragment.tsx (1)
46-46: Fix typo in error commentThere's a missing space in the comment.
- // Error creatingthe fragment + // Error creating the fragmentapp/src/types/png.d.ts (1)
1-4: LGTM: Standard PNG import declarationThis TypeScript declaration properly enables PNG imports without type errors. The
anytype is appropriate here given the variability in how bundlers handle image assets.Consider if a more specific type could be used in the future if the bundler consistently returns a specific format (e.g.,
stringfor URLs orImageSourcePropTypefor React Native):declare module '*.png' { - const content: any; + const content: string; // or ImageSourcePropType export default content; }app/src/utils/nfcScanner.ts (1)
25-25: Consider a simpler boolean conversion approach.While
JSON.parse(String(ENABLE_DEBUG_LOGS))works, it's unnecessarily complex. Based on the previous review feedback, a more direct approach would be clearer:const enableDebugLogs = ENABLE_DEBUG_LOGS === true || ENABLE_DEBUG_LOGS === 'true';This explicitly handles both boolean and string inputs without the string conversion and JSON parsing overhead, making the intent more obvious.
app/src/screens/settings/SettingsScreen.tsx (1)
118-120: Prefer tokenised spacing over magic numbersHard-coded pixel values (
20,10) break theming consistency and scale poorly across screen sizes. Tamagui already exposes spacing tokens ($4,$5, …). Consider:- paddingVertical={20} - paddingHorizontal={10} + paddingVertical="$5" + paddingHorizontal="$4"app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx (1)
139-152: Minor spacing nit
paddingLeft={12}mixes raw numbers with tokenised spacing elsewhere. If possible, swap to$3(or whichever token matches 12 px).app/src/screens/prove/ConfirmBelongingScreen.tsx (1)
35-44: Combine selectors to avoid triple re-subscribeCalling
useProvingStorethree times creates three independent subscriptions; each store update now triggers three re-renders. Grab all actions in one shot:- const init = useProvingStore(state => state.init); - const setFcmToken = useProvingStore(state => state.setFcmToken); - const setUserConfirmed = useProvingStore(state => state.setUserConfirmed); + const { init, setFcmToken, setUserConfirmed } = useProvingStore(state => ({ + init: state.init, + setFcmToken: state.setFcmToken, + setUserConfirmed: state.setUserConfirmed, + }));This keeps the component at a single subscription and avoids redundant renders.
app/src/screens/dev/DevSettingsScreen.tsx (1)
97-97: Type casting workaround noted.The
as anycast for thewhenprop suggests a TypeScript compatibility issue with Tamagui's Adapt component. While this resolves the immediate issue, consider checking if there's a more type-safe solution in future Tamagui updates.app/.eslintrc.cjs (1)
74-84: Consider stricter TypeScript rules for better code qualitySeveral TypeScript safety rules are disabled which could lead to code quality issues:
@typescript-eslint/ban-ts-comment: Disabling this allows@ts-ignorecomments that can hide real type issues@typescript-eslint/ban-types: This prevents use of problematic types likeObject,Function,{}no-empty: Empty blocks are often mistakes or incomplete code@typescript-eslint/no-explicit-any: Consider making this an error instead of warning for better type safetyConsider enabling these rules gradually:
- '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-explicit-any': 'error', - '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': 'allow-with-description' }], - 'no-empty': 'off', + 'no-empty': ['warn', { allowEmptyCatch: true }],
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (68)
app/.eslintrc.cjs(2 hunks)app/env.ts(1 hunks)app/index.js(1 hunks)app/package.json(1 hunks)app/scripts/mobile-deploy-confirm.cjs(2 hunks)app/src/components/ErrorBoundary.tsx(2 hunks)app/src/components/Mnemonic.tsx(2 hunks)app/src/components/NavBar/BaseNavBar.tsx(2 hunks)app/src/components/native/PassportCamera.web.tsx(2 hunks)app/src/components/native/RCTFragment.tsx(1 hunks)app/src/hooks/useAesopRedesign.ts(1 hunks)app/src/hooks/useConnectionModal.ts(1 hunks)app/src/hooks/useMnemonic.ts(1 hunks)app/src/layouts/ExpandableBottomLayout.tsx(1 hunks)app/src/layouts/SimpleScrolledTitleLayout.tsx(3 hunks)app/src/mocks/react-native-gesture-handler.ts(2 hunks)app/src/mocks/react-native-safe-area-context.js(3 hunks)app/src/navigation/index.tsx(2 hunks)app/src/providers/authProvider.tsx(2 hunks)app/src/providers/passportDataProvider.tsx(2 hunks)app/src/screens/dev/DevFeatureFlagsScreen.tsx(7 hunks)app/src/screens/dev/DevSettingsScreen.tsx(9 hunks)app/src/screens/dev/MockDataScreen.tsx(18 hunks)app/src/screens/dev/MockDataScreenDeepLink.tsx(6 hunks)app/src/screens/home/DisclaimerScreen.tsx(1 hunks)app/src/screens/home/HomeScreen.tsx(3 hunks)app/src/screens/home/ProofHistoryDetailScreen.tsx(1 hunks)app/src/screens/home/ProofHistoryScreen.tsx(2 hunks)app/src/screens/misc/LaunchScreen.tsx(1 hunks)app/src/screens/misc/LoadingScreen.tsx(3 hunks)app/src/screens/misc/ModalScreen.tsx(1 hunks)app/src/screens/misc/SplashScreen.tsx(3 hunks)app/src/screens/passport/PassportCameraScreen.tsx(1 hunks)app/src/screens/passport/PassportCameraTroubleScreen.tsx(2 hunks)app/src/screens/passport/PassportNFCScanScreen.tsx(4 hunks)app/src/screens/passport/PassportNFCScanScreen.web.tsx(1 hunks)app/src/screens/passport/PassportNFCTroubleScreen.tsx(2 hunks)app/src/screens/prove/ConfirmBelongingScreen.tsx(2 hunks)app/src/screens/prove/ProofRequestStatusScreen.tsx(1 hunks)app/src/screens/prove/ProveScreen.tsx(4 hunks)app/src/screens/prove/QRCodeTroubleScreen.tsx(2 hunks)app/src/screens/prove/ViewFinderScreen.tsx(1 hunks)app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx(5 hunks)app/src/screens/recovery/AccountRecoveryScreen.tsx(1 hunks)app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx(1 hunks)app/src/screens/recovery/PassportDataNotFoundScreen.tsx(3 hunks)app/src/screens/recovery/RecoverWithPhraseScreen.tsx(2 hunks)app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx(1 hunks)app/src/screens/settings/CloudBackupScreen.tsx(2 hunks)app/src/screens/settings/ManageDocumentsScreen.tsx(10 hunks)app/src/screens/settings/PassportDataInfoScreen.tsx(2 hunks)app/src/screens/settings/SettingsScreen.tsx(6 hunks)app/src/screens/settings/ShowRecoveryPhraseScreen.tsx(1 hunks)app/src/stores/proofHistoryStore.ts(1 hunks)app/src/stores/selfAppStore.tsx(2 hunks)app/src/types/png.d.ts(1 hunks)app/src/types/svg.d.ts(1 hunks)app/src/utils/cloudBackup/google.ts(1 hunks)app/src/utils/deeplinks.ts(2 hunks)app/src/utils/nfcScanner.ts(1 hunks)app/src/utils/proving/attest.ts(3 hunks)app/src/utils/proving/cose.ts(1 hunks)app/src/utils/proving/provingInputs.ts(2 hunks)app/src/utils/proving/provingMachine.ts(2 hunks)app/tests/__setup__/@env.js(1 hunks)app/tests/__setup__/notificationServiceMock.js(1 hunks)app/tests/__setup__/svgMock.js(1 hunks)app/tsconfig.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
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/misc/ModalScreen.tsxapp/src/mocks/react-native-gesture-handler.tsapp/src/screens/passport/PassportNFCScanScreen.web.tsxapp/src/screens/settings/ShowRecoveryPhraseScreen.tsxapp/src/navigation/index.tsxapp/src/screens/home/DisclaimerScreen.tsxapp/src/components/Mnemonic.tsxapp/src/screens/passport/PassportCameraTroubleScreen.tsxapp/src/components/native/PassportCamera.web.tsxapp/src/screens/misc/SplashScreen.tsxapp/src/stores/proofHistoryStore.tsapp/src/screens/passport/PassportCameraScreen.tsxapp/src/stores/selfAppStore.tsxapp/src/providers/passportDataProvider.tsxapp/src/screens/passport/PassportNFCTroubleScreen.tsxapp/src/screens/misc/LaunchScreen.tsxapp/src/components/NavBar/BaseNavBar.tsxapp/src/screens/home/ProofHistoryDetailScreen.tsxapp/src/screens/recovery/SaveRecoveryPhraseScreen.tsxapp/src/types/svg.d.tsapp/src/utils/deeplinks.tsapp/src/layouts/ExpandableBottomLayout.tsxapp/src/layouts/SimpleScrolledTitleLayout.tsxapp/src/mocks/react-native-safe-area-context.jsapp/src/screens/recovery/AccountVerifiedSuccessScreen.tsxapp/src/screens/settings/CloudBackupScreen.tsxapp/src/utils/proving/provingMachine.tsapp/src/screens/prove/QRCodeTroubleScreen.tsxapp/src/screens/home/HomeScreen.tsxapp/src/screens/recovery/PassportDataNotFoundScreen.tsxapp/src/screens/prove/ViewFinderScreen.tsxapp/src/screens/prove/ProofRequestStatusScreen.tsxapp/src/components/ErrorBoundary.tsxapp/src/hooks/useMnemonic.tsapp/src/screens/recovery/RecoverWithPhraseScreen.tsxapp/src/utils/nfcScanner.tsapp/src/screens/prove/ProveScreen.tsxapp/src/screens/settings/SettingsScreen.tsxapp/src/providers/authProvider.tsxapp/src/screens/misc/LoadingScreen.tsxapp/src/types/png.d.tsapp/src/screens/passport/PassportNFCScanScreen.tsxapp/src/components/native/RCTFragment.tsxapp/src/screens/settings/PassportDataInfoScreen.tsxapp/src/hooks/useAesopRedesign.tsapp/src/utils/proving/attest.tsapp/src/hooks/useConnectionModal.tsapp/src/screens/recovery/AccountRecoveryScreen.tsxapp/src/screens/recovery/AccountRecoveryChoiceScreen.tsxapp/src/screens/dev/MockDataScreenDeepLink.tsxapp/src/screens/dev/DevSettingsScreen.tsxapp/src/utils/cloudBackup/google.tsapp/src/screens/dev/DevFeatureFlagsScreen.tsxapp/src/utils/proving/cose.tsapp/src/screens/dev/MockDataScreen.tsxapp/src/screens/settings/ManageDocumentsScreen.tsxapp/src/screens/home/ProofHistoryScreen.tsxapp/src/screens/prove/ConfirmBelongingScreen.tsxapp/src/utils/proving/provingInputs.ts
🧠 Learnings (16)
📓 Common learnings
Learnt from: transphorm
PR: selfxyz/self#636
File: app/ios/Podfile:14-14
Timestamp: 2025-06-30T15:27:13.795Z
Learning: React Native 0.80 supports iOS 15.1 as the minimum deployment target, not iOS 16.0. This allows for broader device compatibility while still being compatible with the React Native 0.80 upgrade.
app/src/screens/misc/ModalScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/passport/PassportNFCScanScreen.web.tsx (1)
Learnt from: transphorm
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.
app/src/screens/passport/PassportCameraTroubleScreen.tsx (2)
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
Learnt from: transphorm
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.
app/src/components/native/PassportCamera.web.tsx (2)
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
Learnt from: transphorm
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.
app/src/screens/passport/PassportCameraScreen.tsx (2)
Learnt from: transphorm
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.
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
app/src/screens/misc/LaunchScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/settings/CloudBackupScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/prove/QRCodeTroubleScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/prove/ViewFinderScreen.tsx (1)
Learnt from: transphorm
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.
app/src/utils/nfcScanner.ts (1)
Learnt from: transphorm
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.
app/src/screens/passport/PassportNFCScanScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/settings/PassportDataInfoScreen.tsx (1)
Learnt from: transphorm
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.
app/src/screens/recovery/AccountRecoveryScreen.tsx (1)
Learnt from: transphorm
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.
app/src/utils/cloudBackup/google.ts (1)
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
🧬 Code Graph Analysis (25)
app/src/screens/misc/ModalScreen.tsx (1)
app/src/utils/colors.ts (1)
white(7-7)
app/env.ts (1)
app/tests/__setup__/@env.js (2)
GOOGLE_SIGNIN_ANDROID_CLIENT_ID(4-4)GOOGLE_SIGNIN_ANDROID_CLIENT_ID(4-4)
app/src/screens/passport/PassportCameraScreen.tsx (1)
app/src/components/typography/Title.tsx (1)
Title(8-27)
app/src/screens/misc/LaunchScreen.tsx (1)
app/src/utils/colors.ts (1)
black(6-6)
app/src/layouts/SimpleScrolledTitleLayout.tsx (1)
app/src/components/buttons/SecondaryButton.tsx (1)
SecondaryButton(8-23)
app/src/screens/home/HomeScreen.tsx (3)
app/src/utils/colors.ts (2)
black(6-6)amber500(5-5)app/src/utils/constants.ts (1)
extraYPadding(3-3)app/src/components/typography/Caption.tsx (1)
Caption(8-21)
app/src/screens/recovery/PassportDataNotFoundScreen.tsx (1)
app/src/utils/colors.ts (1)
slate200(10-10)
app/src/screens/prove/ViewFinderScreen.tsx (1)
app/src/components/typography/Title.tsx (1)
Title(8-27)
app/src/screens/prove/ProofRequestStatusScreen.tsx (2)
app/src/stores/database.ts (1)
updateProofStatus(143-156)app/src/stores/database.web.ts (1)
updateProofStatus(218-253)
app/src/utils/nfcScanner.ts (2)
app/env.ts (1)
ENABLE_DEBUG_LOGS(14-14)app/tests/__setup__/@env.js (2)
ENABLE_DEBUG_LOGS(8-8)ENABLE_DEBUG_LOGS(8-8)
app/src/screens/prove/ProveScreen.tsx (2)
app/src/components/typography/BodyText.ts (1)
BodyText(7-9)app/src/utils/colors.ts (1)
slate300(11-11)
app/src/screens/settings/SettingsScreen.tsx (2)
app/src/utils/colors.ts (1)
black(6-6)app/src/utils/constants.ts (1)
extraYPadding(3-3)
app/src/screens/misc/LoadingScreen.tsx (2)
app/src/utils/proving/provingMachine.ts (1)
ProvingStateType(134-156)app/src/utils/colors.ts (1)
black(6-6)
app/src/screens/settings/PassportDataInfoScreen.tsx (2)
app/src/utils/constants.ts (1)
extraYPadding(3-3)app/src/utils/colors.ts (1)
white(7-7)
app/src/hooks/useAesopRedesign.ts (2)
app/env.ts (1)
IS_TEST_BUILD(7-7)app/tests/__setup__/@env.js (2)
IS_TEST_BUILD(3-3)IS_TEST_BUILD(3-3)
app/src/utils/proving/attest.ts (1)
app/src/utils/proving/provingUtils.ts (1)
ec(13-13)
app/src/screens/recovery/AccountRecoveryScreen.tsx (3)
app/src/utils/colors.ts (2)
slate600(14-14)white(7-7)app/src/layouts/ExpandableBottomLayout.tsx (1)
ExpandableBottomLayout(158-163)app/src/components/typography/Title.tsx (1)
Title(8-27)
app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx (2)
app/src/utils/colors.ts (2)
slate600(14-14)white(7-7)app/src/layouts/ExpandableBottomLayout.tsx (1)
ExpandableBottomLayout(158-163)
app/src/screens/dev/DevSettingsScreen.tsx (1)
app/src/utils/colors.ts (1)
textBlack(39-39)
app/src/utils/cloudBackup/google.ts (2)
app/env.ts (1)
GOOGLE_SIGNIN_ANDROID_CLIENT_ID(8-9)app/tests/__setup__/@env.js (2)
GOOGLE_SIGNIN_ANDROID_CLIENT_ID(4-4)GOOGLE_SIGNIN_ANDROID_CLIENT_ID(4-4)
app/tests/__setup__/@env.js (1)
app/env.ts (9)
GOOGLE_SIGNIN_ANDROID_CLIENT_ID(8-9)GOOGLE_SIGNIN_WEB_CLIENT_ID(10-11)SENTRY_DSN(12-12)SEGMENT_KEY(13-13)ENABLE_DEBUG_LOGS(14-14)DEFAULT_PNUMBER(15-15)DEFAULT_DOB(16-16)DEFAULT_DOE(17-17)MIXPANEL_NFC_PROJECT_TOKEN(18-18)
app/src/screens/dev/MockDataScreen.tsx (8)
common/src/utils/passports/genMockIdDoc.ts (1)
genMockIdDoc(47-77)app/src/utils/colors.ts (4)
white(7-7)borderColor(38-38)textBlack(39-39)separatorColor(40-40)app/src/utils/constants.ts (1)
extraYPadding(3-3)app/src/mocks/react-native-gesture-handler.ts (1)
GestureDetector(43-48)app/src/components/typography/Title.tsx (1)
Title(8-27)app/src/components/typography/BodyText.ts (1)
BodyText(7-9)app/src/utils/haptic/index.ts (2)
buttonTap(19-19)selectionChange(18-18)app/src/consts/analytics.ts (1)
MockDataEvents(138-150)
app/src/screens/settings/ManageDocumentsScreen.tsx (3)
app/src/providers/passportDataProvider.tsx (2)
loadDocumentCatalog(104-118)getAllDocuments(235-251)app/src/utils/colors.ts (3)
textBlack(39-39)borderColor(38-38)white(7-7)app/src/utils/constants.ts (1)
extraYPadding(3-3)
app/src/screens/home/ProofHistoryScreen.tsx (2)
app/src/utils/colors.ts (1)
slate50(8-8)app/src/utils/constants.ts (1)
extraYPadding(3-3)
app/src/screens/prove/ConfirmBelongingScreen.tsx (3)
app/src/utils/proving/provingMachine.ts (1)
useProvingStore(198-1012)app/src/utils/haptic/index.ts (1)
notificationSuccess(16-16)app/src/consts/analytics.ts (1)
ProofEvents(55-111)
🔇 Additional comments (113)
app/src/components/native/RCTFragment.tsx (1)
4-9: LGTM: Import consolidation improves readabilityThe consolidation of React Native imports into a single grouped statement enhances code organization and aligns with the updated ESLint configuration.
app/src/components/ErrorBoundary.tsx (1)
3-3: LGTM: Modern React import pattern adoptedThe change from default React import to explicit named imports improves code clarity and aligns with modern React and TypeScript best practices.
Also applies to: 18-18
app/src/components/NavBar/BaseNavBar.tsx (2)
42-42: LGTM: Improved immutability with constChanging from
lettoconstis a good practice since the variable is never reassigned, making the code more predictable.
72-72: LGTM: Fixed incomplete dependency arrayExcellent fix! The previous dependency array was missing
colorandonPress, which could have caused stale closures and incorrect memoization behavior. The expanded array ensures the memoized component updates correctly when any of these props change.app/src/components/Mnemonic.tsx (2)
66-66: LGTM: Fixed incomplete dependency arrayGreat fix! The previous dependency array was missing
onRevealWordsandsetHasViewedRecoveryPhrase, which could have caused stale closures and incorrect callback behavior. The expanded array ensures proper reactivity.
101-101: Verify$2theme token equals 16pxI wasn’t able to find a local theme or spacing scale in the repo—please confirm that token
$2indeed corresponds to16pxso we don’t introduce unintended layout shifts.Next steps:
- Locate your theme definition (e.g.
theme.ts/theme.js,tailwind.config.jsor design-system package).- Check the
spaceorspacingscale and ensure that the entry at index 2 (the$2token) is set to16px.Relevant change:
- <Box py="$2" …/> + <Box paddingVertical={16} …/>app/src/layouts/ExpandableBottomLayout.tsx (1)
107-107: Change Approved: Nopbprop usage detectedRan targeted searches for any
<ExpandableBottomLayout pb=and<BottomSection pb=across all.ts/.tsxfiles—zero occurrences found. Removing the shorthand fallback is safe and keeps our explicit-style conventions consistent.app/src/mocks/react-native-safe-area-context.js (2)
3-3: Good modernization of React importsThe shift from default React import to explicit named imports (
createContext,createElement,Fragment) aligns with modern React patterns and ESLint best practices. This improves tree-shaking and makes dependencies more explicit.
7-7: Consistent application of named imports throughoutAll React API usages have been properly updated to use the directly imported functions instead of accessing them via the React namespace. The mock functionality remains identical while following modern conventions.
Also applies to: 19-19, 37-37, 39-44
app/src/utils/proving/cose.ts (1)
22-22: Export pattern simplification looks goodConverting from both named and default export to only default export (
export default cose;) simplifies the module's API and maintains consistency. The functionality remains accessible to consumers while following a cleaner export pattern.app/scripts/mobile-deploy-confirm.cjs (2)
282-286: Function signature correctly simplifiedRemoving the unused
versionsparameter fromdisplayDeploymentHeaderis a good cleanup. The function only usesplatforminternally, making this change more accurate and reducing parameter noise.
353-353: Function call properly updatedThe call to
displayDeploymentHeadercorrectly reflects the simplified signature by passing only the requiredplatformparameter. Theversionsdata is still appropriately used bydisplayPlatformVersionscalled on the next line.app/src/layouts/SimpleScrolledTitleLayout.tsx (3)
3-3: Import modernization aligns with best practicesExplicitly importing
PropsWithChildreninstead of accessing it viaReact.PropsWithChildrenimproves import clarity and follows modern React conventions.
14-14: Interface properly updated for direct PropsWithChildren usageThe interface correctly extends the directly imported
PropsWithChildrentype, maintaining the same functionality while following the updated import pattern.
47-47: Confirm correct spacing value
It looks like you replaced the design tokenmb="$2"(which is typically 8px) with an explicitmarginBottom={16}. Please double-check that this 16px value matches the intended spacing (i.e. that you didn’t accidentally double the gap).
• Verify what pixel value$2maps to in your spacing scale.
• If you need a 16px gap, consider using the corresponding token (e.g.$4) for consistency.app/src/hooks/useConnectionModal.ts (1)
59-59: Excellent fix for React hooks exhaustive dependenciesThe updated dependency array properly includes all state and functions used within the effect (
dismissModal,hasNoConnection,hideNetworkModal,showModal,visible) while correctly excludingnavigationRef.isReady()which is called conditionally inside the effect. This prevents unnecessary re-renders and follows React hooks best practices.app/src/screens/passport/PassportNFCScanScreen.web.tsx (1)
36-37: LGTM! Style prop standardization improves code clarity.The change from shorthand props (
h,w) to explicit props (height,width) enhances readability and aligns with the ESLint configuration updates. This standardization makes the codebase more consistent and easier to understand for developers.app/index.js (1)
7-7: Excellent placement of gesture handler import.Moving the
react-native-gesture-handlerimport to the app entry point is the correct approach. This ensures proper initialization of native gesture handling before any components are rendered, which is a requirement for the library to function correctly.app/src/screens/misc/LaunchScreen.tsx (1)
39-39: Style prop standardization maintains consistency.The change from
bg={black}tobackgroundColor={black}follows the established pattern in this PR of using explicit style property names. This improves code consistency and readability while maintaining identical functionality.app/src/screens/misc/ModalScreen.tsx (1)
100-105: Consistent style prop naming enhances maintainability.The standardization of
mx={8}tomarginHorizontal={8}continues the pattern of using explicit style property names throughout the codebase. This change improves code readability and consistency without affecting functionality.app/src/screens/settings/ShowRecoveryPhraseScreen.tsx (1)
17-19: Critical dependency array fix enhances callback reliability.Adding
loadMnemonicto theuseCallbackdependency array is essential for proper React hooks behavior. The previous empty dependency array could result in stale closures, which is particularly problematic in security-sensitive contexts like recovery phrase handling. This fix ensures the callback always references the currentloadMnemonicfunction.app/src/screens/home/DisclaimerScreen.tsx (1)
38-38: LGTM! Style prop standardization improves readability.The conversion from Tamagui shorthand props (
f,jc,pb) to explicit CSS-style properties (flex,justifyContent,paddingBottom) enhances code clarity and maintainability. This aligns with React Native best practices for self-documenting component props.app/src/stores/proofHistoryStore.ts (1)
170-170: LGTM! Improved immutability with const declaration.Converting
totalCountfromlettoconstcorrectly enforces immutability since the variable is never reassigned after initialization. This follows TypeScript best practices and prevents potential bugs from accidental mutations.app/src/screens/passport/PassportCameraTroubleScreen.tsx (2)
3-3: LGTM! Modernized React import pattern.Explicitly importing
useEffectalongside React follows modern React development patterns and improves code clarity. This standardization across the codebase enhances maintainability.
51-51: LGTM! Direct hook usage is cleaner.Using
useEffectdirectly instead ofReact.useEffectis more readable and consistent with the explicit import pattern. The analytics flush logic remains properly implemented.app/src/navigation/index.tsx (2)
9-9: LGTM! Consistent React import modernization.The explicit import of
useEffectaligns with the standardization effort across the codebase and follows modern React development patterns for better code clarity.
76-76: LGTM! Direct useEffect usage is cleaner.Using
useEffectdirectly instead of through the React namespace improves readability and maintains consistency with the explicit import pattern. The universal link setup logic remains properly implemented.app/src/screens/prove/QRCodeTroubleScreen.tsx (2)
3-3: LGTM! Final consistent React import modernization.The explicit
useEffectimport completes the standardization pattern across the codebase, following modern React development practices for improved clarity and bundling efficiency.
48-48: LGTM! Direct hook usage maintains consistency.Using
useEffectdirectly is cleaner and consistent with the modernized import pattern. The analytics flush functionality on component mount remains properly implemented.app/src/stores/selfAppStore.tsx (2)
5-5: LGTM: Import standardization aligns with ESLint updates.The renaming from
iotosocketIoimproves code clarity and consistency across the codebase.
35-43: No further sanitization needed for WS_DB_RELAYERWS_DB_RELAYER is a static, hard-coded constant imported from
common/src/constants/constants.tsand isn’t influenced by user input. Your WebSocket setup already enforces:
- wss protocol via
startsWith('https')→wsstransports: ['websocket']- fixed
path: '/'Locations verified:
•common/src/constants/constants.ts
•app/src/stores/selfAppStore.tsx
•app/src/stores/proofHistoryStore.tsEverything looks secure—no additional sanitization required.
app/src/mocks/react-native-gesture-handler.ts (1)
7-7: LGTM: Explicit import improves tree-shaking and aligns with ESLint rules.The explicit import of
createElementis a good practice that can improve bundle size through better tree-shaking and aligns with modern React/ESLint conventions.Also applies to: 14-14, 47-47
app/env.ts (1)
8-9: Approved: Google Sign-In Android Client ID ConfigurationThe
GOOGLE_SIGNIN_ANDROID_CLIENT_IDexport follows the existing pattern and is now referenced inapp/src/utils/cloudBackup/google.tswith proper runtime checks and error handling:
- Throws an error if the variable is missing in non-test environments
- Uses a mock fallback only in tests
- Sample and test files have been updated accordingly
• Ensure your staging and production deployments include this environment variable.
• Verify your CI/CD and secret management systems injectGOOGLE_SIGNIN_ANDROID_CLIENT_IDas needed.Great work keeping consistency and guarding against missing values!
app/src/screens/passport/PassportCameraScreen.tsx (1)
135-135: LGTM: Style prop standardization improves code clarity.Converting shorthand props (
pb,pt) to explicit forms (paddingBottom,paddingTop) enhances readability and aligns with the ESLint configuration updates. This standardization makes the codebase more maintainable.Also applies to: 138-138
app/src/screens/home/ProofHistoryDetailScreen.tsx (1)
92-92: Excellent fix: Dependency array now includes all referenced values.Adding
data.appNameto the dependency array is crucial since theuseMemocomputation referencesdata.appNamemultiple times (lines 59, 65, 68, etc.). This prevents stale closures and ensures the memoized value updates correctly when the app name changes.app/src/screens/prove/ViewFinderScreen.tsx (2)
141-141: LGTM: Style prop standardization improves consistency.The expansion from shorthand to explicit
paddingBottomaligns with the codebase-wide effort to standardize style property naming for better readability.
144-144: LGTM: Consistent style prop naming.The explicit
paddingTopproperty name enhances code clarity and maintains consistency with the standardization effort across the codebase.app/src/screens/recovery/SaveRecoveryPhraseScreen.tsx (1)
30-30: LGTM: Correct dependency array fixes potential stale closure issue.Adding
loadMnemonicto the dependency array is essential since the callback invokes this function. This prevents potential bugs from stale closures and satisfies React hooks ESLint rules.app/src/screens/passport/PassportNFCTroubleScreen.tsx (2)
3-3: LGTM: Modern React hook import pattern.Explicitly importing
useEffectinstead of accessing it via the React namespace follows modern React practices and improves code clarity.
50-50: LGTM: Consistent hook usage pattern.Using
useEffectdirectly matches the explicit import and maintains consistency with modern React patterns.app/src/screens/settings/CloudBackupScreen.tsx (2)
113-113: LGTM: Consistent style prop standardization.The explicit
paddingBottomproperty name enhances readability and aligns with the codebase-wide standardization effort.
137-137: LGTM: Style property standardization improves clarity.Using explicit
paddingTopinstead of shorthand maintains consistency with the modernization effort across the codebase.app/src/screens/recovery/AccountVerifiedSuccessScreen.tsx (1)
35-40: LGTM: Comprehensive style prop standardization enhances readability.Excellent work replacing all shorthand style props (
pt,px,pb,jc,ai,mb) with their explicit equivalents. This significantly improves code clarity and maintains consistency with the broader modernization effort across the codebase.app/src/components/native/PassportCamera.web.tsx (1)
3-3: LGTM: Consistent hook import patternThe explicit import of
useEffectand its direct usage aligns with modern React patterns and improves code consistency across the codebase.Also applies to: 30-30
app/src/screens/recovery/PassportDataNotFoundScreen.tsx (2)
3-3: LGTM: Modern React hook import patternThe explicit import and direct usage of
useEffectfollows current React best practices and improves code consistency.Also applies to: 19-19
29-33: LGTM: Improved style prop clarityThe change from shorthand
mt={8}to explicitmarginTop={8}with multi-line formatting enhances code readability and aligns with the codebase standardization effort.app/src/screens/recovery/AccountRecoveryScreen.tsx (1)
29-34: LGTM: Consistent style prop namingThe conversion from shorthand style props (
p,pb,pt) to explicit names (padding,paddingBottom,paddingTop) improves code clarity and aligns with the codebase standardization effort. The styling behavior remains unchanged.Also applies to: 39-39, 46-46
app/src/hooks/useMnemonic.ts (1)
19-19: LGTM! Proper dependency array management.Adding
getOrCreateMnemonicto the dependency array is correct since the callback uses this function internally. This follows React hooks best practices and prevents stale closures.app/src/types/svg.d.ts (1)
1-6: Excellent TypeScript enhancement for SVG support.This declaration properly types SVG imports as React functional components with
SvgProps, enabling type safety and better developer experience. The implementation follows standard patterns for React Native SVG handling.app/src/utils/proving/attest.ts (3)
8-8: Good refactoring to named imports.Changing from default import to named import with alias
{ ec as ellipticEc }improves code clarity and follows modern JavaScript best practices. The alias makes it explicit that we're using the elliptic curve functionality.
292-292: Consistent usage update.The usage correctly reflects the new import pattern. The functionality remains unchanged while improving code clarity.
340-340: Consistent usage update.The usage correctly reflects the new import pattern, maintaining consistency across both functions that use the elliptic curve functionality.
app/src/providers/passportDataProvider.tsx (2)
41-48: Excellent import consolidation.Consolidating the imports from
@selfxyz/commoninto a single statement improves readability and follows best practices. The new imports (brutforceSignatureAlgorithmDsc,parseCertificateSimple,PassportData) are properly utilized in the existing functions.
59-59: Good import consolidation.Combining the imports from
authProviderinto a single statement improves code organization and reduces clutter while maintaining all necessary functionality.app/src/screens/prove/ProofRequestStatusScreen.tsx (1)
92-100: Critical fix for useEffect dependencies.Excellent work expanding the dependency array to include all variables used within the effect (
appName,sessionId,errorCode,reason,updateProofStatus). This prevents stale closures and ensures the effect properly responds to changes in proof status, error states, and database operations.This is particularly important for
updateProofStatussince it performs async database operations that need to track the latest session state.app/tests/__setup__/svgMock.js (1)
3-5: LGTM! Clean refactoring to named imports.The change from default React import to named
createElementimport improves code clarity and aligns with modern React patterns. The functionality remains identical while making dependencies more explicit.app/src/utils/proving/provingMachine.ts (1)
12-12: LGTM! More descriptive import naming.The rename from
iotosocketIoimproves code readability and makes the Socket.IO dependency more explicit.app/src/utils/cloudBackup/google.ts (2)
11-19: Excellent environment variable validation!The runtime check for
GOOGLE_SIGNIN_ANDROID_CLIENT_IDwith proper test environment detection is a robust approach that prevents silent failures in production while maintaining test functionality. The dual check for bothNODE_ENV === 'test'andJEST_WORKER_IDensures comprehensive test environment detection.
24-24: Good fallback strategy for tests.The fallback to
'mock-client-id'when the environment variable is missing ensures tests can run without configuration while the runtime check above prevents production issues.app/src/screens/home/ProofHistoryScreen.tsx (2)
301-301: Good fix for hook dependencies!Adding
navigationto the dependency array is correct since therenderItemcallback usesnavigation.navigate(). This prevents potential stale closure issues and follows React Hook best practices.
373-377: Improved style prop consistency.The change from shorthand props (
bg,pb) to explicit names (backgroundColor,paddingBottom) enhances code readability and aligns with React Native conventions. This is part of a broader consistency improvement across the codebase.app/src/screens/misc/SplashScreen.tsx (4)
6-6: Clean import modernization.Adding
useStateto the named imports and removingReact.useStateusage improves code clarity and follows modern React patterns.
15-15: Good import organization.Grouping
storePassportDatawith other imports frompassportDataProviderimproves code organization and readability.
27-28: Consistent state management.The switch from
React.useStateto directuseStatecalls maintains consistency with the import changes and improves readability.
110-110: Critical dependency array fix!Adding
checkBiometricsAvailableandsetBiometricsAvailableto the dependency array is essential since the effect uses these functions. This prevents potential stale closure bugs and ensures the effect behaves correctly if these functions change.app/src/screens/home/HomeScreen.tsx (1)
8-8: LGTM! Excellent code standardization improvements.The changes demonstrate good React Native practices:
- Explicit
useCallbackimport reduces bundle size compared to namespace imports- Style prop normalization (
bg→backgroundColor,jc→justifyContent,ai→alignItems) improves code readability and consistency- Direct
useCallbackusage is more idiomatic thanReact.useCallbackThese changes maintain functionality while improving code quality and consistency across the codebase.
Also applies to: 56-56, 78-78, 80-80, 85-85, 92-92
app/tests/__setup__/notificationServiceMock.js (1)
6-8: Good cleanup of unused mock parameter.Removing the unused
stateparameter simplifies the mock function signature while maintaining the expected return behavior. This eliminates potential ESLint warnings and makes the mock's purpose clearer.app/src/screens/misc/LoadingScreen.tsx (3)
29-37: Excellent performance optimization by moving terminalStates to module level.Moving the
terminalStatesarray outside the component prevents unnecessary recreation on each render. The proper TypeScript typing withProvingStateType[]maintains type safety while improving performance.
102-103: Appropriate ESLint disable for intentional dependency exclusion.The ESLint disable is justified here since the effect is specifically designed to only respond to
isFocusedchanges, notpassportDatachanges. The comment clearly explains the intention.
166-166: Consistent style prop normalization.The changes from
bgtobackgroundColorandjctojustifyContentalign with the broader codebase standardization effort, improving readability and consistency.Also applies to: 168-168
app/src/hooks/useAesopRedesign.ts (1)
6-6: Robust environment variable handling with proper fallback.The implementation correctly handles type inconsistencies between runtime (boolean from
app/env.ts) and test environments (string from test setup). TheString()conversion ensures consistent input toJSON.parse, while the nullish coalescing operator (??) provides a sensible fallback for undefined values.This approach is more robust than a simple boolean check since it handles all possible input types gracefully.
app/src/screens/prove/ProveScreen.tsx (1)
204-212: 👍 Explicit style props look goodReplacing the shorthand
mbwithmarginBottomon bothImageandBodyTextimproves readability and aligns with the new lint rule set.app/src/screens/recovery/RecoverWithPhraseScreen.tsx (1)
85-94: UI prop renaming approvedMigrating from
pbtopaddingBottom(and other explicit props) is consistent with the new ESLint / Prettier rules. No functional impact detected.app/package.json (1)
156-164: Ensure editor tooling picks up the TypeScript resolverYou added
eslint-import-resolver-typescript, but it only becomes active whensettings["import/resolver"]is configured. Verify.eslintrc.cjsdeclares:settings: { 'import/resolver': { typescript: {} } }Without this, the plugin is installed but unused.
app/src/screens/passport/PassportNFCScanScreen.tsx (3)
262-272: Dependency array now complete – good catchAdding
route.params,navigation, andopenErrorModalremoves hidden stale-closure bugs inonVerifyPress.
330-332: Token-based dimensions may bypass accessibility checks
height="$8"/width="$8"rely on Tamagui tokens; ensure$8maps to a pixel value ≥ 44 px (Apple HIG minimum touch target).
If not, consider bumping to$10or explicitheight={48}/width={48}.
360-372: 👍 Style-prop expansion looks correctExplicit
marginTop/marginBottomprops improve clarity and satisfy the lint rule.app/src/providers/authProvider.tsx (2)
223-224: IncludingauthenticationTimeoutinMsin deps is necessaryThe callback will now refresh if the timeout changes – solid improvement.
239-255: Memo dependency list now exhaustiveAdding
getOrCreateMnemonicandrestoreAccountFromMnemonicprevents stale references inside the context value.app/src/screens/settings/PassportDataInfoScreen.tsx (1)
50-58: Explicit style props improve clarity – looks goodReplacing the former shorthand (
py,jc, etc.) withpaddingVertical,justifyContent, and friends removes ambiguity and matches the new ESLint preset. Implementation is correct and token-based values remain unchanged, so nothing further to do here.Also applies to: 90-98
app/src/screens/settings/SettingsScreen.tsx (3)
131-136: Good call addinghrefto the dependency arrayThe callback really depends on
href; this fixes a subtle stale-closure bug.
219-233: Style-prop renames are correct
backgroundColor,justifyContent,alignItems, andwidthnow align with RN props and lint rules. No functional impact.
259-261: Consistency win on button layoutUsing
justifyContent="center"/alignItems="center"is clearer than the earlier abbreviations—nice tidy-up.app/src/screens/recovery/AccountRecoveryChoiceScreen.tsx (2)
90-97: Dependency list now complete – avoids stale valuesAdding
cloudBackupEnabled,navigation, andtoggleCloudBackupEnabledensures the callback reflects the latest state and avoids surprises after enabling backup.
107-113: Border & padding tokens match palette – looks fineSwitching from shorthand to verbose style props keeps design tokens intact; no issues.
app/src/screens/dev/DevFeatureFlagsScreen.tsx (4)
197-199: Reasonable ESLint suppressionDocumenting why
exhaustive-depsis disabled makes intent explicit and keeps lint noise down.
218-229: Background tokens are correct – UI behaviour unchangedRenaming
bg/bctobackgroundColorkeeps semantics identical. Implementation is fine.
235-255: Input styling consistent with rest of formVerbose padding / background props mirror surrounding elements – looks good.
270-378: Bulk prop renames OK – but check bundle sizeHundreds of terse-prop removals slightly bloat JSX. This is the trade-off for rule compliance; nothing actionable, just awareness.
app/src/screens/prove/ConfirmBelongingScreen.tsx (1)
55-63: Action calls updated – matches new selectorsThe refactor correctly updates method usage; functional behaviour preserved.
app/src/screens/dev/MockDataScreenDeepLink.tsx (3)
4-8: LGTM: Clean import consolidation.Consolidating the imports from
@selfxyz/commoninto a single grouped import improves code organization and readability.
79-85: Proper dependency array management.Correctly includes
handleGeneratein the dependency array alongside the other deep link parameters, ensuring the effect runs when any dependency changes.
89-187: Good standardization of style props.The systematic replacement of shorthand style props (e.g.,
f→flex,bg→backgroundColor,ai→alignItems) with their full property names improves code readability and consistency. This aligns with the broader standardization effort across the codebase.app/tsconfig.json (2)
7-9: Good addition of environment path alias.The
@envpath alias provides a clean way to import environment variables throughout the application, improving code maintainability and avoiding complex relative imports.
11-45: Excellent TypeScript configuration refinement.The explicit
includearray focusing onsrc/**/*and comprehensiveexcludepatterns provide better control over compilation scope. This should improve build performance by clearly defining what TypeScript should process.app/src/screens/dev/DevSettingsScreen.tsx (3)
116-129: Verify the dependency array optimization.Changing the
useMemodependency array to[]means the memoization will only run once. While theitemsarray is currently a stable constant, this optimization could break ifitemsever becomes dynamic in the future.Consider being explicit about the reasoning:
- [], + [], // items is a stable constant, so no dependencies needed
9-9: Good React import modernization.Importing
useMemodirectly follows modern React practices and is cleaner than usingReact.useMemo.
214-357: Consistent style prop standardization.The replacement of shorthand style props with full property names (e.g.,
p→padding,bg→backgroundColor) maintains consistency with the broader codebase standardization effort and improves readability.app/src/screens/settings/ManageDocumentsScreen.tsx (3)
37-59: Excellent React performance optimization.Converting
loadPassportDataInfotouseCallbackwith proper dependencies is a good optimization. The dependency array correctly includes all used functions, though the state setters (setDocumentCatalog,setAllDocuments) are stable by React's guarantee and could be omitted, but including them is good for explicitness.
5-5: Good React hook import addition.Adding
useCallbackto the React imports enables cleaner hook usage following modern React practices.
142-313: Consistent style prop standardization.The systematic replacement of shorthand style props with full property names (e.g.,
ai→alignItems,jc→justifyContent) continues the codebase-wide consistency improvement effort and enhances code readability.app/src/screens/dev/MockDataScreen.tsx (6)
4-10: LGTM: Clean import consolidation.Consolidating imports from
@selfxyz/commoninto a single grouped import statement improves code organization and follows best practices.
52-124: Excellent code organization improvement.Moving
signatureAlgorithmToStrictSignatureAlgorithmandcastDateToYYMMDDForExpiryto module scope prevents unnecessary redefinition on each render and improves code organization. Theconstassertion also enhances type safety.
156-156: Good immutability improvement.Changing from
lettoconstfor thevaluevariable is appropriate since it's not reassigned after initialization.
241-249: Proper dependency array management.The
useCallbackdependency array correctly includesselectedAlgorithmandselectedCountry, ensuring the callback updates when these values change.
231-233: Correct function usage.The calls to
genMockIdDocandinitPassportDataParsingare properly using the imported functions with appropriate variable declarations.
261-595: Comprehensive style prop standardization.The extensive replacement of shorthand style props with full property names (e.g.,
f→flex,bg→backgroundColor,ai→alignItems) significantly improves code readability and maintains consistency with the broader codebase standardization effort. While extensive, these changes enhance maintainability without affecting functionality.app/tests/__setup__/@env.js (1)
4-7: Test environment mocks look goodThe mock values for Google Sign-In, Sentry, and Segment are appropriate for the test environment. The undefined values for personal data fields and Mixpanel token correctly match the production defaults.
Also applies to: 9-12
app/src/utils/proving/provingInputs.ts (2)
5-21: Import consolidation improves clarityGood consolidation of imports from
@selfxyz/common. This groups related imports together and makes the dependencies more explicit.
80-81: Cleaner SMT instantiation patternThe immediate instantiation of
nameAndDobSMTandnameAndYobSMTis more concise and follows better JavaScript/TypeScript patterns. This eliminates the unnecessary separation between declaration and initialization.app/.eslintrc.cjs (3)
3-8: TypeScript parser configuration looks solidThe parser configuration properly sets up TypeScript parsing with ECMAScript 2021 features and JSX support. This is the correct setup for a React Native TypeScript project.
32-47: Import configuration is well-structuredThe TypeScript import resolver and simple-import-sort setup provides good import management. Ignoring
react-nativein import resolution is appropriate since it's a built-in module in React Native projects.
18-18: Prettier integration configured correctlyThe Prettier plugin is properly integrated through the extends array and the prettier rule is configured to use the project's
.prettierrcfile. Note that the PR objectives mention pinningeslint-config-prettierto version 10.1.8 for security reasons - ensure this is reflected inpackage.json.Also applies to: 58-58
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
app/src/utils/deeplinks.ts (1)
66-87: Excellent implementation addressing the security concernsThis implementation successfully addresses the past review comment about input sanitization. The whitelisting approach ensures only expected parameters are processed, and the validation/sanitization is applied individually to each parameter.
🧹 Nitpick comments (2)
app/src/utils/deeplinks.ts (1)
114-121: Consider extracting the inline type definitionThe
MockDataDeepLinkRawParamstype is defined inline within the function. Consider moving it to a shared types file for better reusability and maintainability.app/tests/utils/deeplinks.test.ts (1)
243-252: Improve the duplicate key test assertionThe test for duplicate keys has an uncertain assertion that accepts either undefined or string. Consider testing the actual behavior more precisely by checking what query-string actually returns for duplicate keys.
- // We'll accept either a valid sessionId or empty object if it creates an array - expect( - result.sessionId === undefined || typeof result.sessionId === 'string', - ).toBe(true); + // query-string v7+ returns the last value for duplicate keys + expect(result).toEqual({ sessionId: 'valid2' });
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/src/screens/prove/ViewFinderScreen.tsx(3 hunks)app/src/utils/deeplinks.ts(1 hunks)app/src/utils/proving/provingMachine.ts(3 hunks)app/tests/utils/deeplinks.test.ts(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- app/src/screens/prove/ViewFinderScreen.tsx
- app/src/utils/proving/provingMachine.ts
🧰 Additional context used
📓 Path-based instructions (2)
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/utils/deeplinks.ts
**/*.{test,spec}.{ts,js,tsx,jsx}
⚙️ CodeRabbit Configuration File
**/*.{test,spec}.{ts,js,tsx,jsx}: Review test files for:
- Test coverage completeness
- Test case quality and edge cases
- Mock usage appropriateness
- Test readability and maintainability
Files:
app/tests/utils/deeplinks.test.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: transphorm
PR: selfxyz/self#636
File: app/ios/Podfile:14-14
Timestamp: 2025-06-30T15:27:13.795Z
Learning: React Native 0.80 supports iOS 15.1 as the minimum deployment target, not iOS 16.0. This allows for broader device compatibility while still being compatible with the React Native 0.80 upgrade.
app/src/utils/deeplinks.ts (1)
Learnt from: transphorm
PR: #636
File: app/src/utils/cameraPermission.ts:19-21
Timestamp: 2025-07-12T22:00:02.041Z
Learning: The Android permission handling in app/src/utils/cameraPermission.ts is robust and properly implemented using PermissionsAndroid.request() and PermissionsAndroid.check(). Previous issues with Android permission assumptions have been resolved in the current implementation.
🧬 Code Graph Analysis (1)
app/tests/utils/deeplinks.test.ts (2)
app/src/utils/deeplinks.ts (2)
parseAndValidateUrlParams(66-87)handleUrl(89-147)app/src/navigation/index.tsx (1)
navigationRef(59-59)
⏰ 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). (1)
- GitHub Check: build
🔇 Additional comments (2)
app/src/utils/deeplinks.ts (1)
29-59: Well-implemented parameter validation with proper error handlingThe function correctly handles URL decoding errors and validates parameters against their respective patterns. The dev-only logging approach is appropriate.
app/tests/utils/deeplinks.test.ts (1)
52-142: Comprehensive test coverage for handleUrl with excellent security testingThe test suite properly covers all parameter types, error scenarios, and includes important security tests like XSS attempts. The console spy management is handled correctly.
* audit fixes (#645) * merge dev branch into main (#624) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> * update contracts (#628) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) * implement self uups upgradeable (#592) * implement self uups upgradeable * small changes in identityVerificationHubImplV2 * delete aderyn.toml * chore: add custom verifier * chnage return output * feat: use self structs and a Generic output struct * feat: add userIdentifier, nullifier, forbiddencountries to returned output * add root view functions from registry * fix: build and compilation errors * add userDefined data into selfVerificationRoot * "resolve conflicts" * fix compilation problem * fix how to register verification config * test: CustomVerifier * fix verification root and hub integration * add scope check in hub impl * replace poseidon hash to ripemd+sha256 * add todo list * feat: refactor and add test cases for generic formatter * add performUserIdentifierCheck in basicVerification * change how to handle additionalData and fix stack too deep * start adding test codes * fix dependency problems in monorepo * fix: forbidden countries (#612) LGTM! * able to run test code * pass happy path * delete unused codes * change error code name, add caller address validation and add scripts to run test and build in monorepo * add all test cases in vcAndDisclose flow * remove comment out * chore: use actual user identifier outputs * success in registration tests * cover all cases * pass contractVersion instead of circuitVersion * fix disclose test * chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter * change val name and remove unused lines * add val name change * remove userIdentifier from return data * feat: use GenericDiscloseOutput struct in verfication hook fix test cases for user identifier * chore: change the function order for Hub Impl V2 (#625) * fix nat specs * add nat spec in SelfStructs --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Nesopie <[email protected]> * prettier (#629) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> Co-authored-by: Nesopie <[email protected]> * fix: vc_and_disclose_id test (#640) * fix: vc_and_disclose_id test * chore: yarn prettier * fix: check if a config id exists * chore: change the function where the config not set verification is happening * fix: add await * feat: add getConfigId function in SelfVerificationRoot (#650) * feat: add getConfigId function in SelfVerificationRoot * update comment --------- Co-authored-by: motemotech <[email protected]> * chore: fix ofac end index in eu id cards * chore: fix tests * fix: example contracts and tests --------- Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> * Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658) * publish npm-package (#651) * App/eu id updates (#638) * fix build issues * generate disclosure proof with euids * generate disclosure proof with euids * Eu id updates 2 (#648) * update vc_and_disclose_id test (dev branch) (#641) * fix: vc_and_disclose_id test * chore: yarn prettier * Show modal on NFC scan error (#642) * Add help button and error modal actions * fix the screen management * yarn nice * Bump build v2.5.4: ios 132; android 71 (#631) * bump version and build numbers * remove tamagui/toast * fix marketing version * fix: update TD1 and TD3 checks (#643) * bum yarn.lock * add version and user defined data --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> * remove the mock user define data * get the useridentifier as a hash from the user defined data * chore: add version and userDefinedData * feat: use the version in register / dsc proofs as well * update calculateUserIdentifierHash * yarn nice * refactor: consolidate user context data handling and update payload structure * fix typing issues on sha1 * remove console.log(sha1) * fix sha1 import * refactor: streamline userDefinedData handling and adjust payload type for circuit * refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash * yarn nice * yarn lint common * use ts-ignore for sha1 import * fix app ci tests * fix typing issue * remove unused ts-ignore * cast uuid before calling generateinputs * bump qrcode version * add tsup on the qrcode sdk * fix: exports on selfxyz/qrcode * update how we define config.version * fix yarn imports * yarn format --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Ayman <[email protected]> * Hotfix contract compile error (#660) * Fix previous rebase error * Refactor deployment module for Identity Verification Hub V2. * Fix/sdk (#652) * fix: sdk build configs * chore: SelfBackendVerifier (WIP) * feat: add custom verification * feat: consider destination chain in user defined data * chore: export attestation id * chore: export attestation id * chore: export config storage * chore: don't throw an error if the proof is not valid * chore: trim abi and rm typechain types * refactor * chore: rm unnecessary exports * 📝 Add docstrings to `fix/sdk` (#653) Docstrings generation was requested by @remicolin. * https://github.com/selfxyz/self/pull/652#issuecomment-2992046545 The following files were modified: * `sdk/core/src/utils/hash.ts` * `sdk/core/src/utils/proof.ts` * `sdk/core/src/utils/utils.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * review fixes * chore: fix package.json cjs types * chore: add minor changes to checks * feat: add InMemoryConfigStore, allIds constant and verificationResult type * chore: export Verification config * feat: change the verification config types * fix: throw issues early if verification config is null * fix: update yarn.lock file * chore: lint * fix: rm ts expect error directive * fix: contract tests * use excluded countries instead forbidden countries list * chore: change types in constnats --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update npm-publish workflow and bump core package version to 1.0.0 (#661) * update import * Update get verification config visibility (#664) * Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands. * Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment. * Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access. * Apply BUSL v1.1 license headers to app (#665) * Add BSL license headers to app sources * prettier * fix license reference - https://spdx.org/licenses/BUSL-1.1.html * bump build: android 73 (#659) * Contracts/deploy staging (#668) * update scripts * deploy vc and disclose id * fix the deployment scripts on staging * update yarn.lock * bump ios build and version (#669) * configure coderabbitai (#670) * tweak coderabbit * bump * more thorough test spec * Apply BSL to app codebase (#639) * Clean up root license wording * Simplify SPDX header * simplify license and rename BSL to BUSL * fix merge issues * fix missing method --------- Co-authored-by: Justin Hernandez <[email protected]> * SEL-423 apply xcode build suggestions (#671) * apply recommended app settings from xcode * stick to portrait orientation and update target settings * remove app clip references * Circuit audit fixes (#644) * feat: add range checks before use of LessEqThan and SelectSubArray * fix: Num2Bits_strict to constrain virtualKey * bump core version * bump core version and fix ci * chore: use npm_auth_token in yarnrc * chroe: rm yarnrc changes * chore: update npm publish * chore: run npm publish manually * chore: change hub contract address (#675) * Update npm-publish.yml * merge dev to main (#657) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) * implement self uups upgradeable (#592) * implement self uups upgradeable * small changes in identityVerificationHubImplV2 * delete aderyn.toml * chore: add custom verifier * chnage return output * feat: use self structs and a Generic output struct * feat: add userIdentifier, nullifier, forbiddencountries to returned output * add root view functions from registry * fix: build and compilation errors * add userDefined data into selfVerificationRoot * "resolve conflicts" * fix compilation problem * fix how to register verification config * test: CustomVerifier * fix verification root and hub integration * add scope check in hub impl * replace poseidon hash to ripemd+sha256 * add todo list * feat: refactor and add test cases for generic formatter * add performUserIdentifierCheck in basicVerification * change how to handle additionalData and fix stack too deep * start adding test codes * fix dependency problems in monorepo * fix: forbidden countries (#612) LGTM! * able to run test code * pass happy path * delete unused codes * change error code name, add caller address validation and add scripts to run test and build in monorepo * add all test cases in vcAndDisclose flow * remove comment out * chore: use actual user identifier outputs * success in registration tests * cover all cases * pass contractVersion instead of circuitVersion * fix disclose test * chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter * change val name and remove unused lines * add val name change * remove userIdentifier from return data * feat: use GenericDiscloseOutput struct in verfication hook fix test cases for user identifier * chore: change the function order for Hub Impl V2 (#625) * fix nat specs * add nat spec in SelfStructs --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Nesopie <[email protected]> * prettier (#629) * CAN auth - android (#613) * add missed files * add NFCMethodSelectionScreen * bump android build --------- Co-authored-by: Justin Hernandez <[email protected]> * feat: add MRZ correction method to NFCMethodSelectionScreen (#627) * add npm auth token env (#632) * bump sdk version (#633) * publish npm package when merging on dev * bump common sdk version * replace yarn publish by npm publish * update common package version * Simplify dev mode gesture (#635) * Simplify developer mode gesture * Enable dev mode on MockData screen with five taps * add build smt function to common sdk * update vc_and_disclose_id test (dev branch) (#641) * fix: vc_and_disclose_id test * chore: yarn prettier * Show modal on NFC scan error (#642) * Add help button and error modal actions * fix the screen management * yarn nice * Bump build v2.5.4: ios 132; android 71 (#631) * bump version and build numbers * remove tamagui/toast * fix marketing version * fix: update TD1 and TD3 checks (#643) * bum yarn.lock * Bump build: ios 133; android 72 and build fixes (#654) * update gesture version and bump android build * bump and fix ios build * update lock files * fixes * fix fotoapparat library source * Update example contracts to include EUID usage (#656) * refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic * refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations * refactor: remove BASIS_POINTS constant from Airdrop contract * feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721 * fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook * cherry pick commit from add-test-self-verification... * block non-dev pr to main branch * audit fixes (#645) * merge dev branch into main (#624) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> * update contracts (#628) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) * implement self uups upgradeable (#592) * implement self uups upgradeable * small changes in identityVerificationHubImplV2 * delete aderyn.toml * chore: add custom verifier * chnage return output * feat: use self structs and a Generic output struct * feat: add userIdentifier, nullifier, forbiddencountries to returned output * add root view functions from registry * fix: build and compilation errors * add userDefined data into selfVerificationRoot * "resolve conflicts" * fix compilation problem * fix how to register verification config * test: CustomVerifier * fix verification root and hub integration * add scope check in hub impl * replace poseidon hash to ripemd+sha256 * add todo list * feat: refactor and add test cases for generic formatter * add performUserIdentifierCheck in basicVerification * change how to handle additionalData and fix stack too deep * start adding test codes * fix dependency problems in monorepo * fix: forbidden countries (#612) LGTM! * able to run test code * pass happy path * delete unused codes * change error code name, add caller address validation and add scripts to run test and build in monorepo * add all test cases in vcAndDisclose flow * remove comment out * chore: use actual user identifier outputs * success in registration tests * cover all cases * pass contractVersion instead of circuitVersion * fix disclose test * chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter * change val name and remove unused lines * add val name change * remove userIdentifier from return data * feat: use GenericDiscloseOutput struct in verfication hook fix test cases for user identifier * chore: change the function order for Hub Impl V2 (#625) * fix nat specs * add nat spec in SelfStructs --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Nesopie <[email protected]> * prettier (#629) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> Co-authored-by: Nesopie <[email protected]> * fix: vc_and_disclose_id test (#640) * fix: vc_and_disclose_id test * chore: yarn prettier * fix: check if a config id exists * chore: change the function where the config not set verification is happening * fix: add await * feat: add getConfigId function in SelfVerificationRoot (#650) * feat: add getConfigId function in SelfVerificationRoot * update comment --------- Co-authored-by: motemotech <[email protected]> * chore: fix ofac end index in eu id cards * chore: fix tests * fix: example contracts and tests --------- Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> * Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658) * publish npm-package (#651) * App/eu id updates (#638) * fix build issues * generate disclosure proof with euids * generate disclosure proof with euids * Eu id updates 2 (#648) * update vc_and_disclose_id test (dev branch) (#641) * fix: vc_and_disclose_id test * chore: yarn prettier * Show modal on NFC scan error (#642) * Add help button and error modal actions * fix the screen management * yarn nice * Bump build v2.5.4: ios 132; android 71 (#631) * bump version and build numbers * remove tamagui/toast * fix marketing version * fix: update TD1 and TD3 checks (#643) * bum yarn.lock * add version and user defined data --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> * remove the mock user define data * get the useridentifier as a hash from the user defined data * chore: add version and userDefinedData * feat: use the version in register / dsc proofs as well * update calculateUserIdentifierHash * yarn nice * refactor: consolidate user context data handling and update payload structure * fix typing issues on sha1 * remove console.log(sha1) * fix sha1 import * refactor: streamline userDefinedData handling and adjust payload type for circuit * refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash * yarn nice * yarn lint common * use ts-ignore for sha1 import * fix app ci tests * fix typing issue * remove unused ts-ignore * cast uuid before calling generateinputs * bump qrcode version * add tsup on the qrcode sdk * fix: exports on selfxyz/qrcode * update how we define config.version * fix yarn imports * yarn format --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Ayman <[email protected]> * Hotfix contract compile error (#660) * Fix previous rebase error * Refactor deployment module for Identity Verification Hub V2. * Fix/sdk (#652) * fix: sdk build configs * chore: SelfBackendVerifier (WIP) * feat: add custom verification * feat: consider destination chain in user defined data * chore: export attestation id * chore: export attestation id * chore: export config storage * chore: don't throw an error if the proof is not valid * chore: trim abi and rm typechain types * refactor * chore: rm unnecessary exports * 📝 Add docstrings to `fix/sdk` (#653) Docstrings generation was requested by @remicolin. * https://github.com/selfxyz/self/pull/652#issuecomment-2992046545 The following files were modified: * `sdk/core/src/utils/hash.ts` * `sdk/core/src/utils/proof.ts` * `sdk/core/src/utils/utils.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * review fixes * chore: fix package.json cjs types * chore: add minor changes to checks * feat: add InMemoryConfigStore, allIds constant and verificationResult type * chore: export Verification config * feat: change the verification config types * fix: throw issues early if verification config is null * fix: update yarn.lock file * chore: lint * fix: rm ts expect error directive * fix: contract tests * use excluded countries instead forbidden countries list * chore: change types in constnats --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update npm-publish workflow and bump core package version to 1.0.0 (#661) * update import * Update get verification config visibility (#664) * Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands. * Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment. * Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access. * Apply BUSL v1.1 license headers to app (#665) * Add BSL license headers to app sources * prettier * fix license reference - https://spdx.org/licenses/BUSL-1.1.html * bump build: android 73 (#659) * Contracts/deploy staging (#668) * update scripts * deploy vc and disclose id * fix the deployment scripts on staging * update yarn.lock * bump ios build and version (#669) * configure coderabbitai (#670) * tweak coderabbit * bump * more thorough test spec * Apply BSL to app codebase (#639) * Clean up root license wording * Simplify SPDX header * simplify license and rename BSL to BUSL * fix merge issues * fix missing method --------- Co-authored-by: Justin Hernandez <[email protected]> * SEL-423 apply xcode build suggestions (#671) * apply recommended app settings from xcode * stick to portrait orientation and update target settings * remove app clip references * Circuit audit fixes (#644) * feat: add range checks before use of LessEqThan and SelectSubArray * fix: Num2Bits_strict to constrain virtualKey * bump core version * bump core version and fix ci * chore: use npm_auth_token in yarnrc * chroe: rm yarnrc changes * chore: update npm publish * chore: run npm publish manually * chore: change hub contract address (#675) * Update npm-publish.yml --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> Co-authored-by: Nesopie <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Kevin Lin <[email protected]> Co-authored-by: kevinsslin <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Eric Nakagawa <[email protected]> * chore: use proper secret when publishing * feat: enable publishing if workflow was triggered manually * Contracts/update verifier (#673) * update hardhat config * update vc and disclose verifier * update vc and disclose verifier script and run it * update test self verification root * update verifier * bump sdk version and use new hub address * chore: update zk-kit binary merkle root dep (#674) * Dev (#677) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) * implement self uups upgradeable (#592) * implement self uups upgradeable * small changes in identityVerificationHubImplV2 * delete aderyn.toml * chore: add custom verifier * chnage return output * feat: use self structs and a Generic output struct * feat: add userIdentifier, nullifier, forbiddencountries to returned output * add root view functions from registry * fix: build and compilation errors * add userDefined data into selfVerificationRoot * "resolve conflicts" * fix compilation problem * fix how to register verification config * test: CustomVerifier * fix verification root and hub integration * add scope check in hub impl * replace poseidon hash to ripemd+sha256 * add todo list * feat: refactor and add test cases for generic formatter * add performUserIdentifierCheck in basicVerification * change how to handle additionalData and fix stack too deep * start adding test codes * fix dependency problems in monorepo * fix: forbidden countries (#612) LGTM! * able to run test code * pass happy path * delete unused codes * change error code name, add caller address validation and add scripts to run test and build in monorepo * add all test cases in vcAndDisclose flow * remove comment out * chore: use actual user identifier outputs * success in registration tests * cover all cases * pass contractVersion instead of circuitVersion * fix disclose test * chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter * change val name and remove unused lines * add val name change * remove userIdentifier from return data * feat: use GenericDiscloseOutput struct in verfication hook fix test cases for user identifier * chore: change the function order for Hub Impl V2 (#625) * fix nat specs * add nat spec in SelfStructs --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Nesopie <[email protected]> * prettier (#629) * CAN auth - android (#613) * add missed files * add NFCMethodSelectionScreen * bump android build --------- Co-authored-by: Justin Hernandez <[email protected]> * feat: add MRZ correction method to NFCMethodSelectionScreen (#627) * add npm auth token env (#632) * bump sdk version (#633) * publish npm package when merging on dev * bump common sdk version * replace yarn publish by npm publish * update common package version * Simplify dev mode gesture (#635) * Simplify developer mode gesture * Enable dev mode on MockData screen with five taps * add build smt function to common sdk * update vc_and_disclose_id test (dev branch) (#641) * fix: vc_and_disclose_id test * chore: yarn prettier * Show modal on NFC scan error (#642) * Add help button and error modal actions * fix the screen management * yarn nice * Bump build v2.5.4: ios 132; android 71 (#631) * bump version and build numbers * remove tamagui/toast * fix marketing version * fix: update TD1 and TD3 checks (#643) * bum yarn.lock * Bump build: ios 133; android 72 and build fixes (#654) * update gesture version and bump android build * bump and fix ios build * update lock files * fixes * fix fotoapparat library source * Update example contracts to include EUID usage (#656) * refactor: update HappyBirthday contract to V2 with support for E-Passport and EUID cards, introduce bonus multipliers, and enhance verification logic * refactor: update Airdrop contract to V2 with support for E-Passport and EU ID Card attestations * refactor: remove BASIS_POINTS constant from Airdrop contract * feat: introduce SelfIdentityERC721 contract for issuing NFTs based on verified identity credentials, replacing SelfPassportERC721 * fix: update verification functions in Airdrop, HappyBirthday, and SelfIdentityERC721 contracts to use customVerificationHook * cherry pick commit from add-test-self-verification... * block non-dev pr to main branch * audit fixes (#645) * merge dev branch into main (#624) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> * update contracts (#628) * remove sdk/tests (#622) * remove sdk/tests * chore: update yarn.lock --------- Co-authored-by: Ayman <[email protected]> * fix: add range check on paddedInLength of shaBytesDynamic (#623) * fix ci (#626) * implement self uups upgradeable (#592) * implement self uups upgradeable * small changes in identityVerificationHubImplV2 * delete aderyn.toml * chore: add custom verifier * chnage return output * feat: use self structs and a Generic output struct * feat: add userIdentifier, nullifier, forbiddencountries to returned output * add root view functions from registry * fix: build and compilation errors * add userDefined data into selfVerificationRoot * "resolve conflicts" * fix compilation problem * fix how to register verification config * test: CustomVerifier * fix verification root and hub integration * add scope check in hub impl * replace poseidon hash to ripemd+sha256 * add todo list * feat: refactor and add test cases for generic formatter * add performUserIdentifierCheck in basicVerification * change how to handle additionalData and fix stack too deep * start adding test codes * fix dependency problems in monorepo * fix: forbidden countries (#612) LGTM! * able to run test code * pass happy path * delete unused codes * change error code name, add caller address validation and add scripts to run test and build in monorepo * add all test cases in vcAndDisclose flow * remove comment out * chore: use actual user identifier outputs * success in registration tests * cover all cases * pass contractVersion instead of circuitVersion * fix disclose test * chore: add natspecs for ImplHubV2, CustomVerifier and GenericFormatter * change val name and remove unused lines * add val name change * remove userIdentifier from return data * feat: use GenericDiscloseOutput struct in verfication hook fix test cases for user identifier * chore: change the function order for Hub Impl V2 (#625) * fix nat specs * add nat spec in SelfStructs --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Nesopie <[email protected]> * prettier (#629) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> Co-authored-by: Nesopie <[email protected]> * fix: vc_and_disclose_id test (#640) * fix: vc_and_disclose_id test * chore: yarn prettier * fix: check if a config id exists * chore: change the function where the config not set verification is happening * fix: add await * feat: add getConfigId function in SelfVerificationRoot (#650) * feat: add getConfigId function in SelfVerificationRoot * update comment --------- Co-authored-by: motemotech <[email protected]> * chore: fix ofac end index in eu id cards * chore: fix tests * fix: example contracts and tests --------- Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> * Update deployment module for Identity Verification Hub V2 with detailed documentation and library linkage for CustomVerifier. Update initialization process to reflect changes in V2 implementation, ensuring proper setup for proxy deployment. (#658) * publish npm-package (#651) * App/eu id updates (#638) * fix build issues * generate disclosure proof with euids * generate disclosure proof with euids * Eu id updates 2 (#648) * update vc_and_disclose_id test (dev branch) (#641) * fix: vc_and_disclose_id test * chore: yarn prettier * Show modal on NFC scan error (#642) * Add help button and error modal actions * fix the screen management * yarn nice * Bump build v2.5.4: ios 132; android 71 (#631) * bump version and build numbers * remove tamagui/toast * fix marketing version * fix: update TD1 and TD3 checks (#643) * bum yarn.lock * add version and user defined data --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> * remove the mock user define data * get the useridentifier as a hash from the user defined data * chore: add version and userDefinedData * feat: use the version in register / dsc proofs as well * update calculateUserIdentifierHash * yarn nice * refactor: consolidate user context data handling and update payload structure * fix typing issues on sha1 * remove console.log(sha1) * fix sha1 import * refactor: streamline userDefinedData handling and adjust payload type for circuit * refactor: update sha1 usage and enhance logging in calculateUserIdentifierHash * yarn nice * yarn lint common * use ts-ignore for sha1 import * fix app ci tests * fix typing issue * remove unused ts-ignore * cast uuid before calling generateinputs * bump qrcode version * add tsup on the qrcode sdk * fix: exports on selfxyz/qrcode * update how we define config.version * fix yarn imports * yarn format --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Ayman <[email protected]> * Hotfix contract compile error (#660) * Fix previous rebase error * Refactor deployment module for Identity Verification Hub V2. * Fix/sdk (#652) * fix: sdk build configs * chore: SelfBackendVerifier (WIP) * feat: add custom verification * feat: consider destination chain in user defined data * chore: export attestation id * chore: export attestation id * chore: export config storage * chore: don't throw an error if the proof is not valid * chore: trim abi and rm typechain types * refactor * chore: rm unnecessary exports * 📝 Add docstrings to `fix/sdk` (#653) Docstrings generation was requested by @remicolin. * https://github.com/selfxyz/self/pull/652#issuecomment-2992046545 The following files were modified: * `sdk/core/src/utils/hash.ts` * `sdk/core/src/utils/proof.ts` * `sdk/core/src/utils/utils.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * review fixes * chore: fix package.json cjs types * chore: add minor changes to checks * feat: add InMemoryConfigStore, allIds constant and verificationResult type * chore: export Verification config * feat: change the verification config types * fix: throw issues early if verification config is null * fix: update yarn.lock file * chore: lint * fix: rm ts expect error directive * fix: contract tests * use excluded countries instead forbidden countries list * chore: change types in constnats --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update npm-publish workflow and bump core package version to 1.0.0 (#661) * update import * Update get verification config visibility (#664) * Update deployment module for Identity Verification Hub V2 to correct file paths and module name for deployment commands. * Add troubleshooting documentation for verification issues in deployHubV2.ts. Include manual verification steps and common failure reasons to assist users during deployment. * Change visibility of getVerificationConfigV2 function from internal to public in IdentityVerificationHubImplV2 contract to allow external access. * Apply BUSL v1.1 license headers to app (#665) * Add BSL license headers to app sources * prettier * fix license reference - https://spdx.org/licenses/BUSL-1.1.html * bump build: android 73 (#659) * Contracts/deploy staging (#668) * update scripts * deploy vc and disclose id * fix the deployment scripts on staging * update yarn.lock * bump ios build and version (#669) * configure coderabbitai (#670) * tweak coderabbit * bump * more thorough test spec * Apply BSL to app codebase (#639) * Clean up root license wording * Simplify SPDX header * simplify license and rename BSL to BUSL * fix merge issues * fix missing method --------- Co-authored-by: Justin Hernandez <[email protected]> * SEL-423 apply xcode build suggestions (#671) * apply recommended app settings from xcode * stick to portrait orientation and update target settings * remove app clip references * Circuit audit fixes (#644) * feat: add range checks before use of LessEqThan and SelectSubArray * fix: Num2Bits_strict to constrain virtualKey * bump core version * bump core version and fix ci * chore: use npm_auth_token in yarnrc * chroe: rm yarnrc changes * chore: update npm publish * chore: run npm publish manually * chore: change hub contract address (#675) * Update npm-publish.yml * chore: use proper secret when publishing * feat: enable publishing if workflow was triggered manually * Contracts/update verifier (#673) * update hardhat config * update vc and disclose verifier * update vc and disclose verifier script and run it * update test self verification root * update verifier * bump sdk version and use new hub address * chore: update zk-kit binary merkle root dep (#674) --------- Co-authored-by: Ayman <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: nicoshark <[email protected]> Co-authored-by: Nesopie <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Kevin Lin <[email protected]> Co-authored-by: kevinsslin <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Eric Nakagawa <[email protected]> * refactor deployment scripts (#678) * feat: add register eu id instances (#682) * feat: add register eu id instances * feat: add new instances * chore: update scripts * chore: fix sig alg * chore: rm circuits * update the smart contracts scripts (#684) * remove the && false * fix euid (#685) * keep build and version in sync (#686) * fix env set to null * fix: circuit for register ci (#690) * fix: circuit for register ci * fix: rm duplicate workflow_dispatch * feat: add better error handling (#691) * fix: older than bug (#692) * bump: sdk/[email protected] * fix: config not found bug * decrease parallel circuits to 3 * ci: add prettier check for contract sdk (#602) * Add Prettier check for code formatting in contracts workflow * Update contracts workflow: remove unused checkout action and fix build step name * Run formatter * Run lint fix * chore: update build_cpp to 2 concurrent builds * Contract/fix sdk (#695) * fix contracts sdk * fix contracts sdk * Fix contract example v2 (#694) * feat: add verification config ID functionality to Airdrop, HappyBirthday, and SelfIdentityERC721 contracts * Run formatter * SEL-473: Add lint rule for BUSL headers (#698) * chore(app): enforce license header via eslint * update lock and order * fix formatting * SEL-444: Fix android cloud backup (#697) * feat(android): migrate google backup * update lock and google services config * add bulk format command * backup fixes * working drive settings!!!!!!!! * remove unneeded intent filter * add tests * coderabbit feedback * coderabbit feedback * abstract google method * coderabbit feedback and fix test * more coderabbit suggestions and tests fixes * chore: update relayer verifier enum to include the register circuits (#699) * fix env sample (#700) * Abstract iOS cloud backup logic (#701) * feat(ios): abstract cloud backup logic * prettier and cr feedback * tested on iOS and android and functionality is the same * Fix navigation serialization warnings (#702) * test: cover modal callbacks * coderabbit feedback * feat(app): clarify passport linking (#704) * Show NFC support message (#708) * SEL-425: Add document management analytics events (#706) * Add document management analytics * coderabbit feedback * SEL-447: Improve proof failure feedback (#707) * feat: flag stale proofs as failed * make a constant * format * SEL-330: Add backup check after verification (#711) * route to save phrase if backup disabled * format * SEL-483: Implement recovery backup prompts (#710) * feat: prompt users to back up account * feat: prompt users to back up account * format * Add tests for recovery prompt logic * more lint updates * fix imports * fix unused import * update cursor suggestions * implement coderabbit suggestions and fix tests * SEL-472: Enable production push notifications (#703) * chore: leave sandbox apns token comment * tweak entitlement * coderabbit ai feedback * firebase tweaks * Chore: ensure there is an extra empty line after the license declaration (#712) * ensure there is an extra empty line after the license declaration * ignore adding header to cjs config files * add missing license header * ignore linting metro config * bump version and add mainnet hub address * Bugfix: Show recovery prompt only when user has docs (#714) * feat(app): prompt recovery only when docs exist * cr feedbacl * SEL-487: Prompt user to backup recovery phrase before registering (#715) * feat: prompt backup before registration * coderabbit feedback * fix tests * coderabbitai feedback and fix tests * Remove StartupFlushPolicy (#717) * SEL-479: Multi-ID onboarding mvp flow (#688) * save new launch screen wip * save wip * finalize launch look * replace launch screen * rename * update camera onboarding and scan screen * update tips looks * update nfc scan issue screens * update copy * add launch screen todo * fix casing * update launch screen link, copy and add tracking event * bump project version to match app store * match app store * updated supported bio id link * add dialog message support back in * cr feedback * bump version and build * update images * tweak animation layout * loop with setTimeout * fix onboarding assets (#719) * feat: add flag to use PACEPolling (#680) * feat: add flag to use PACEPolling * fix: santize before storing in store * bump ios build number and update podfile lock * prettier * bump build * feat: add flag to use PACEPolling * fix: santize before storing in store * bump ios build number and update podfile lock * prettier * bump build --------- Co-authored-by: Justin Hernandez <[email protected]> * fix backup button label (#722) * update version to 2.6.0 and bump build numbers (#721) * SEL-179 & SEL-312: Add gitleaks and GitGuardian scanning (#705) * chore: add secret scanning setup * fix: correct GitGuardian action path * cr feedbacak * test husky commit * pr feedback * fix workflows * tweaks * fix versions * upgrade: migrate from husky v8 to v9 - Update husky from ^8.0.0 to ^9.1.7 - Change prepare script from 'husky install' to 'husky' - Remove v8 hook structure (shebang, husky.sh sourcing) - Delete .husky/_/ directory as it's not needed in v9 - Maintain gitleaks pre-commit hook functionality * coderabbitai feedback * add bulk sort command (#723) * feat(app): redirect empty docs to launch (#725) * Apply consistent safe area padding across screens (#726) * Contracts/update verifiers (#729) * update the verifiers * update deployment script * update deployment script and deploy to prod * prettier run write * App/ethcc fixes (#730) * fix mock data screen * increase timout between dsc and register proof * fix the isUserRegisteredWithAlternativeCSCA function * yarn nice * allow people to switch to a mock id (#732) * yarn nice * chore: update default config id method * chore: use named exports * Update README.md * Temporarily disable recovery redirect and reminder prompts (#733) * Revert "SEL-487: Prompt user to backup recovery phrase before registering (#715)" This reverts commit fe14ac655e11b4b9e0c4023002b84fcc79bedd31. * revert update * fix safe area context pkg * Revert "SEL-487: Prompt user to backup recovery phrase before registering (#715)" This reverts commit fe14ac655e11b4b9e0c4023002b84fcc79bedd31. * fix old flow * more silent tests * update lock files * hard code return * SEL-486: Fix unwrap DO (#718) * update podfile: unwrapDO * update lock * bump version and builds * bump build; forgot to enable logs * fix version to not interfere with release --------- Co-authored-by: Justin Hernandez <[email protected]> * SEL-494: Update proving machine event tracking (#734) * Add extensive proof analytics instrumentation * prettier and sort events by key name * remove loading screen race condition redirect (#736) * Chore: new build for v2.6.0 ios 145 android 81 (#737) * bump version and build * properly bump app * bump build * Improve manual mobile deploy workflow and docs (#728) * Add basic Fastlane helper tests * Upgrade fastlane and enhance helper tests (#738) * simplify mobile deploy pipelines and make them manual. update readme * update fastlane dev readme * update tests and add helper script * cr feedback, update tests, revert circuits package.json sort change * tweaks * fix slack * cr feedback and fixes * add better cjs eslint support * save wip. add confirmation check script. update scripts * remove auto increment feature * migrate readme items over to DEV due to fastlane auto regen docs flow * use regular xcode * fix hermes compiler path * coderabbit feedback * reinstall when on local dev * fix upload * simplify * simplify confirmation feedback with tests * fix mobile deploys * cr feedback * test iOS building * fix trigger logic * cr feedback * updates * fix env var * fix order * re-enable upload to testflight for ios * updated notes * chore: update readme * Bugfix: android deeplinks (#742) * bugfix: deep linking * add android manifest test * bump build and version * format readme * fix deeplink genmockiddoc * add the gender to the deeplink optoin * bump version (#743) * fix the female bug * bump build 148 (#744) * SEL-496: Add Firebase Remote Config and dev feature flag screen (#735) * feat: add remote config support * update lock * tweak config logic. add feature flag viewing screen * add tests * allow for local overriding of feature flags * save local override work * save wip * clean up ui * update screen to handle multi value types * fix tests * cr feedback and fix tests * remote config upates. fix tests, codex feedback * Improve AGENTS workflow notes (#747) * clarify workflow instructions * agents feedback * Address minor mobile deployment bugs (#745) * feat: improve deployment tooling * cr feedback * for temp testing * clean build artifacts after deploy * add deploy source * uncomment ios commands * Add tests for minor deployment fixes (#750) * Add test coverage for deployment scripts and Fastfile * format * increase github check to 5 minutes * Extend platform build file tests (#748) * Add build file tests * cr feedback * Add proving machine tests (#749) * Add actor mock helper and tests * format tests * fix tests * wip fix tests * address cr feedback * Add thorough test cases for mobile app (#752) * Add actor mock helper and tests * format tests * fix tests * Revert non-app tests * update tests * fix tests * coderabbit feedback * revert change * remove spurious tests * don't use crypto in core sdk * Start of Web App (#689) * Add .cursorignore to optimize AI editor performance and security (#758) Prevents Cursor AI from accessing sensitive files (keys, credentials, deployment configs) and large generated artifacts that slow down indexing. Keeps source code accessible while excluding build outputs, node_modules, and circuit/contract compilation artifacts across the monorepo. * SEL-504: fix fonts and some styles (#762) * fix fonts and some styles * dry config * fix some warnings * lets start with coverage for app (#763) * lets start with coverage for app * lint * better setup * SEL-559: Update td1 regex (#760) * feat: update td1 regex * update review comments * fix: NPE on expirationDate regex * fix user defined data (#766) * fix: name formatting for middle name * bump: sdk/core to 1.0.7-beta.1 * Feat/retrieve OFAC trees from api (#769) * retrieve the ofac trees from the api * remove the ofac trees from the common repo * fix ofac test * yarn nice * yarn nice * yarn nice * refactor ofac fetching * Release new build v2.6.2 (#779) * bump version and build * ignore podfile * Remove failing version test (#780) * remove version check test * remove test all together * SEL-269: Update ESLint rules & lock prettier config (#781) * Update ESLint config and lock prettier config * Refine ESLint config and fix lint issues * Apply eslint fixes * Use socketIo alias (#782) * move gesture handler * save wip updates * fix svg imports * update tsconfig * eslint updates * eslint fixes * improve ignore folders * coderabbit feedback * Fix style prop shorthands (#787) * Expand view style props * Expand remaining style props * update types * fix pipeline * fix test env check * nicer casting * fix booleans * update deeplink url handling and make it more robust * add socket error handler * Add COSE signature verification tests (#788) * Update ESLint config and lock prettier config * Refine ESLint config and fix lint issues * save wip updates * eslint updates * eslint fixes * Add COSE signature verification tests * fix tests * SEL-553: Show NFC Progress (#764) * feat: add haptics * fix: BAC FAILED error event * update lock file --------- Co-authored-by: Justin Hernandez <[email protected]> * SEL-566: Navigate Home based on document validity (#768) * feat: navigate home if atleast one valid document is present * update comments * Review: Remove unnecessary continue statement * feat: add tracking * SEL-544: Generate Mock DSC on mock-passport flow (#772) * feat: Generate mock DSC on mock-passport flow * Remove console log * yarn format * revert to mock dsc generation * SEL-570: Display user ID in prove screen (#790) * Display user ID on prove screen * Add user ID formatting util and tests * Clarify user ID formatting * fix nice * add tests and save toggle wip * update tests based on feedback * say connected wallet when wallet * fix: Add localhost validation to prevent invalid endpoint usage in QR Code SDK (#794) * Feat/mobile deployment automation (#759) * feat: add version management system with build number tracking - Add version.json to track iOS/Android build numbers separately - Create version.cjs script for build number management - Add Fastlane version_manager.rb helper - Keep npm version for semver, version.json for build tracking * feat: integrate version.json with Fastlane deployment process ## What Changed - Updated iOS and Android Fastlane lanes to use version.json for build number management - Added automatic build number increment on deployment - Added deployment timestamp tracking ## How It Works ### iOS Deployment 1. Reads current build number from version.json 2. Increments iOS build number (e.g., 148 → 149) 3. Updates Xcode project with new build number via increment_build_number 4. Proceeds with TestFlight deployment 5. Updates lastDeployed timestamp on successful upload ### Android Deployment 1. Reads current build number from version.json 2. Increments Android build number (e.g., 82 → 83) 3. Updates build.gradle with new version code via increment_version_code 4. Proceeds with Play Store deployment 5. Updates lastDeployed timestamp on successful upload ## Why This Change - Eliminates manual version/build number entry - Prevents version conflicts between deployments - Provides single source of truth for build numbers - Enables automatic deployments without human intervention - Tracks deployment history with timestamps ## Dependencies - Requires version.json file (already created in previous commit) - Uses existing Fastlane plugins: - increment_build_number (iOS - built-in) - increment_version_code (Android - from plugin) - Version numbers still managed by npm version command * feat: enhance deploy confirmation with version.json info * fix: use ENV variable directly in increment_build_number to avoid secret masking * fix: correct xcodeproj path for GitHub Actions workflow * feat: add test mode to workflow for safe testing - Skip store uploads when test_mode is true - Test version bumps and builds without deployment - Prevent accidental pushes to TestFlight/Play Store * fix: use gradle_file_path instead of gradle_file for increment_version_code * fix: use gsub to remove ../ prefix for CI compatibility * chore: remove accidentally committed files - Remove .cursor/mcp.json - Remove .cursorignore - Remove deployment-automation-summary.md - Remove deployment-meeting-questions.md - Remove pipeline.md * feat: auto-commit version.json after successful deployment - Commits version.json changes back to repository - Only runs when test_mode is false - Uses [skip ci] to prevent infinite loops - Checks for actual changes before committing * feat : update package.json in build step using npm version * feat: add comprehensive caching to mobile deployment workflow - Add caching for Yarn dependencies, Ruby gems, CocoaPods, Gradle, and Android NDK - Implement cache versioning strategy for easy cache invalidation - Fix cache order: caches now restored after checkout but before dependency installation - Update mobile-setup action to skip installs when dependencies are cached - Add cache size monitoring to track usage against GitHub's 10GB limit - Fix Slack notification bug: skip notifications in test_mode - Add detailed logging for package.json version updates (show from/to versions) Expected performance improvement: ~50% faster builds (from ~15min to ~7-10min) * fix: move bundler config after Ruby setup in mobile-setup action * fix: rename cache env vars to avoid Yarn conflicts Yarn was interpreting YARN_CACHE_VERSION as its own config setting. Prefixed all cache version env vars with GH_ to avoid conflicts. * fix: remove bundler deployment mode to allow Gemfile updates The deployment mode was causing bundler to fail when Gemfile changed (nokogiri was removed). CI should be able to update the lockfile as needed. * feat: implement strict lock file enforcement (Option 1) - Re-enable bundler deployment mode for strict Gemfile.lock checking - Use yarn install --immutable for strict yarn.lock checking - Add clear error messages when lock files are out of date - Add pre-checks to verify lock files exist - This ensures reproducible builds and makes caching maximally effective When developers change dependencies, they must now: 1. Run yarn install or bundle install locally 2. Commit the updated lock files 3. CI will fail with helpful instructions if they forget * fix: update Gemfile.lock for CI environment Remove nokogiri from Gemfile.lock since it's excluded in CI environments (GITHUB_ACTIONS=true). This allows the strict lock file checks to pass in CI. * fix: correct yarn.lock path for monorepo workspace The project uses Yarn workspaces with yarn.lock at the repository root, not in the app directory. Updated paths to check for yarn.lock at workspace root and use it for cache keys. * fix: handle both boolean and string test_mode parameter The test_mode parameter was only checking for string 'true' but could be passed as boolean true from command line. Now handles both cases to ensure test mode works correctly for iOS and Android. * fix: address code review feedback for mobile deployment workflow - Replace jq with Node.js for version extraction (jq not available on macOS runners) - Fix concurrent commit race condition by creating separate update-version job - Add platform validation to version_manager.rb and version.cjs scripts - Use POSIX-compatible single = for shell string comparisons - Ensure single atomic commit when deploying to both platforms * fix: formatting and linting issues - Remove trailing spaces from workflow YAML file - Fix prettier formatting in JavaScript files - Add -y flag to yarn version command for non-interactive mode - Address all lint warnings from CI --------- Co-authored-by: Jayaditya Gupta <[email protected]> * fix: increment iOS build number * fix: bump app version to 2.6.3 for iOS release * App/deeplink callback (#789) * add deepllinkCallback support * bump package version * yarn nice * fix background countdown * cast the URL to prevent malicious code introduction * fix: use cleanDocumentNumber (#784) * increment iOS bundle version * Feat/push to dev main (#767) * feat: add version management system with build number tracking - Add version.json to track iOS/Android build numbers separately - Create version.cjs script for build number management - Add Fastlane version_manager.rb helper - Keep npm version for semver, version.json for build tracking * feat: integrate version.json with Fastlane deployment process ## What Changed - Updated iOS and Android Fastlane lanes to use version.json for build number management - Added automatic build number increment on deployment - Added deployment timestamp tracking ## How It Works ### iOS Deployment 1. Reads current build number from version.json 2. Increments iOS build number (e.g., 148 → 149) 3. Updates Xcode project with new build number via increment_build_number 4. Proceeds with TestFlight deployment 5. Updates lastDeployed timestamp on successful upload ### Android Deployment 1. Reads current build number from version.json 2. Increments Android build number (e.g., 82 → 83) 3. Updates build.gradle with new version code via increment_version_code 4. Proceeds with Play Store deployment 5. Updates lastDeployed timestamp on successful upload ## Why This Change - Eliminates manual version/build number entry - Prevents version conflicts between deployments - Provides single source of truth for build numbers - Enables automatic deployments without human intervention - Tracks deployment history with timestamps ## Dependencies - Requires version.json file (already created in previous commit) - Uses existing Fastlane plugins: - increment_build_number (iOS - built-in) - increment_version_code (Android - from plugin) - Version numbers still managed by npm version command * feat: enhance deploy confirmation with version.json info * fix: use ENV variable directly in increment_build_number to avoid secret masking * fix: correct xcodeproj path for GitHub Actions workflow * feat: add test mode to workflow for safe testing - Skip store uploads when test_mode is true - Test version bumps and builds without deployment - Prevent accidental pushes to TestFlight/Play Store * fix: use gradle_file_path instead of gradle_file for increment_version_code * fix: use gsub to remove ../ prefix for CI compatibility * chore: remove accidentally committed files - Remove .cursor/mcp.json - Remove .cursorignore - Remove deployment-automation-summary.md - Remove deployment-meeting-questions.md - Remove pipeline.md * feat: auto-commit version.json after successful deployment - Commits version.json changes back to repository - Only runs when test_mode is false - Uses [skip ci] to prevent infinite loops - Checks for actual changes before committing * feat : update package.json in build step using npm version * feat: add comprehensive caching to mobile deployment workflow - Add caching for Yarn dependencies, Ruby gems, CocoaPods, Gradle, and Android NDK - Implement cache versioning strategy for easy cache invalidation - Fix cache order: caches now restored after checkout but before dependency installation - Update mobile-setup action to skip installs when dependencies are cached - Add cache size monitoring to track usage against GitHub's 10GB limit - Fix Slack notification bug: skip notifications in test_mode - Add detailed logging for package.json version updates (show from/to versions) Expected performance improvement: ~50% faster builds (from ~15min to ~7-10min) * fix: move bundler config after Ruby setup in mobile-setup action * fix: rename cache env vars to avoid Yarn conflicts Yarn was interpreting YARN_CACHE_VERSION as its own config setting. Prefixed all cache version env vars with GH_ to avoid conflicts. * fix: remove bundler deployment mode to allow Gemfile updates The deployment mode was causing bundler to fail when Gemfile changed (nokogiri was removed). CI should be able to update the lockfile as needed. * feat: implement strict lock file enforcement (Option 1) - Re-enable bundler deployment mode for strict Gemfile.lock checking - Use yarn install --immutable for strict yarn.lock checking - Add clear error messages when lock files are out of date - Add pre-checks to verify lock files exist - This ensures reproducible builds and makes caching maximally effective When developers change dependencies, they must now: 1. Run yarn install or bundle install locally 2. Commit the updated lock files 3. CI will fail with helpful instructions if they forget * fix: update Gemfile.lock for CI environment Remove nokogiri from Gemfile.lock since it's excluded in CI environments (GITHUB_ACTIONS=true). This allows the strict lock file checks to pass in CI. * fix: correct yarn.lock path for monorepo workspace The project uses Yarn workspaces with yarn.lock at the repository root, not in the app directory. Updated paths to check for yarn.lock at workspace root and use it for cache keys. * fix: handle both boolean and string test_mode parameter The test_mode parameter was only checking for string 'true' but could be passed as boolean true from command line. Now handles both cases to ensure test mode works correctly for iOS and Android. * fix: address code review feedback for mobile deployment workflow - Replace jq with Node.js for version extraction (jq not available on macOS runners) - Fix concurrent commit race condition by creating separate update-version job - Add platform validation to version_manager.rb and version.cjs scripts - Use POSIX-compatible single = for shell string comparisons - Ensure single atomic commit when deploying to both platforms * fix: formatting and linting issues - Remove trailing spaces from workflow YAML file - Fix prettier formatting in JavaScript files - Add -y flag to yarn version command for non-interactive mode - Address all lint warnings from CI * feat: implement automated branch-based mobile deployments - Add mobile-deploy-auto.yml workflow that triggers on PR merges to dev/main - Update mobile-deploy.yml to support workflow_call for reusability - Add deployment_track, version_bump, and auto_deploy parameters - Create new Fastlane lanes (deploy_auto) for iOS and Android - Implement smart version bumping based on PR labels (major/minor/patch) - Add graceful error handling for Play Store permission issues - Enhance Slack notifications with deployment track information This enables automatic deployments when PRs are merged: - dev branch → internal testing track - main branch → production track - Skip deployment with [skip-deploy] in PR or no-deploy label * feat: add automated git tagging and release system - Add automatic git tagging for production deployments (v2.5.5, platform-specific tags) - Create GitHub releases with changelogs for production deployments - Add manual release script (yarn release) for version bumping and tagging - Implement simple changelog generation from git history - Add comprehensive deployment documentation in .github/MOBILE_DEPLOYMENT.md - Update app/README.md with deployment commands and workflows This completes the release automation system requested in the ticket for manual tagging and versioning with automated changelogs and release notes. --------- Co-authored-by: Jayaditya Gupta <[email protected]> * Implement basic code splitting * cm feedback * update lock * yarn nice * add typing to crypto loader * fix type. more opportunities * lint suggestions * build dependencies before linting * fix build command * save updated imports * update build checks * fix import * fix imports and test * fix install commands * Update Gemfile.lock to exclude nokogiri in CI environments - Regenerated Gemfile.lock with GITHUB_ACTIONS=true to match the conditional nokogiri exclusion in the Ge…
Summary
Testing
yarn lintyarn buildyarn workspace @selfxyz/contracts build(fails: Invalid account for network)yarn typesyarn workspace @selfxyz/common testyarn workspace @selfxyz/circuits test(fails: Unsupported signature algorithm)yarn workspace @selfxyz/mobile-app testhttps://chatgpt.com/codex/tasks/task_b_68805e6240e8832dba8fdd5cf5512d3a
Summary by CodeRabbit
Chores
@envimport alias..pngfiles to support image imports..svgfiles to support React components.Refactor
New Features