-
Notifications
You must be signed in to change notification settings - Fork 179
Read document catalog from selfClient #936
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
Read document catalog from selfClient #936
Conversation
WalkthroughMove document types into the shared package, add a DocumentsAdapter and SelfClient document APIs, thread SelfClient through screens and proving flows, refactor passport data provider for direct keychain loading, deduplication, and migration, and update tests/mocks to use the SelfClient adapter surface. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor UI as Screen
participant SC as SelfClient
participant DA as DocumentsAdapter
participant KC as Keychain
UI->>SC: hasAnyValidRegisteredDocument(selfClient)
SC->>DA: loadDocumentCatalog()
DA->>KC: read catalog
KC-->>DA: catalog
DA-->>SC: DocumentCatalog
SC-->>UI: any(document.isRegistered)
alt registered exists
UI->>UI: navigate(Home)
else
UI->>UI: navigate(Launch)
end
sequenceDiagram
autonumber
actor Provider as AppProvider
participant SC as SelfClient
participant DA as DocumentsAdapter
participant KC as Keychain
Provider->>SC: getAllDocuments()
SC->>DA: loadDocumentCatalog()
DA->>KC: read catalog (ids)
KC-->>DA: catalog
loop for each id
SC->>DA: loadDocumentById(id)
DA->>KC: read document(id)
KC-->>DA: PassportData|null
DA-->>SC: data
end
SC-->>Provider: { id: { data, metadata } }
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ 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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, 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.
generally seems good to me.
I think you did some of the same stuff as @seshanthS (which is a good sign, since it means we are all thinking similarly)
… github.com:selfxyz/self into shazarre/read_document_catalog_from_the_self_client
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: 16
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (7)
app/src/screens/settings/ManageDocumentsScreen.tsx (1)
127-145: Ensure type safety by including ‘aadhaar’ in DocumentCategory and tightening signaturesThe
extractCountryFromDatahelper currently accepts a plain string fordocumentCategoryand even handles an'aadhaar'case—yet the sharedDocumentCategorytype is only'passport' | 'id_card'. This mismatch undermines type safety and allows invalid values to slip through at compile time. To resolve:• In common/src/utils/types.ts (line 4), extend the union:
export type DocumentCategory = 'passport' | 'id_card' | 'aadhaar';• In ManageDocumentsScreen.tsx (and any other consumers), change the parameter type from
stringtoDocumentCategory:- const extractCountryFromData = ( - data: string, - documentCategory: string, - ): string | null => { + const extractCountryFromData = ( + data: string, + documentCategory: DocumentCategory, + ): string | null => {• Update the display-name logic (getDisplayName) to cover the new category or explicitly handle mock variants as needed:
switch (documentType) { case 'passport': return 'Passport'; case 'mock_passport': return 'Mock Passport'; case 'id_card': return 'ID Card'; - /* no aadhaar case */ + case 'aadhaar': + return 'Aadhaar Card'; default: return documentType; }Optional: Align “ID Card” naming
If “ID Card” is intended to refer only to EU identity documents, consider renaming the category to'eu_id_card'(and updating all call sites, includinggetDisplayNameand any mappings) to avoid ambiguity.app/src/utils/proving/validateDocument.ts (1)
27-35: CI break: getAllDocuments is imported but not exported by passportDataProviderThe pipeline failure indicates
getAllDocumentsisn’t exported. Given the new catalog flow, prefer loading the catalog and iterating its documents, which also removes this import.Apply this diff to drop the unused/invalid import:
- getAllDocuments, loadDocumentCatalog, loadPassportDataAndSecret, loadSelectedDocument, setSelectedDocument, storePassportData, updateDocumentRegistrationState,app/src/screens/passport/PassportCameraScreen.tsx (1)
126-133: Differentiate “catalog load failed” from “no documents” to prevent misroutingIf the catalog call fails, hasAnyValidRegisteredDocument currently returns false, which silently routes users to Launch even when documents exist. Add an error path (and a short timeout) so failures are observable and don’t look like “no docs.”
Apply this diff to harden onCancelPress:
const onCancelPress = async () => { - const hasValidDocument = await hasAnyValidRegisteredDocument(client); - if (hasValidDocument) { - navigateToHome(); - } else { - navigateToLaunch(); - } + try { + const hasValidDocument = await Promise.race<boolean>([ + hasAnyValidRegisteredDocument(client), + new Promise<boolean>((_, reject) => + setTimeout(() => reject(new Error('timeout:document-catalog')), 2000), + ), + ]); + if (hasValidDocument) { + navigateToHome(); + } else { + navigateToLaunch(); + } + } catch (err) { + // Surface telemetry via SDK event instead of console logging. + client.emit?.('error', Object.assign(new Error('SELF_DOC_CATALOG_LOAD_FAILED'), { cause: err })); + // Optionally: show a toast/snackbar instead of silent fallback. + navigateToLaunch(); + } };packages/mobile-sdk-alpha/src/types/public.ts (1)
124-143: Missing IdentityCommitment & DSCKeyCommitment in public types — please addI confirmed that
VerificationConfigis already defined insdk/core/src/types/types.ts, but I didn’t findIdentityCommitmentorDSCKeyCommitmentanywhere in the repo. To keep the SDK’s type surface aligned with our spec and avoid drift in proofs/verification, please add both interfaces alongside the existing public types.• File:
packages/mobile-sdk-alpha/src/types/public.tsor better, in the sharedsdk/core/src/types/types.ts
• Add definitions such as:export interface IdentityCommitment { commitment: string; // Poseidon hash (hex) nullifier: string; // Domain-separated nullifier timestamp: number; // UTC epoch seconds version: string; // Circuit version (semver) documentType: 'passport' | 'eu_id_card'; } export interface DSCKeyCommitment { publicKeyHash: string; // Poseidon hash (hex) certificateChain: string[]; // Hashes of chain certs (leaf→root) revocationStatus: boolean; // True if revoked issuer: string; // ISO 3166-1 alpha-2 country code }This will ensure downstream modules can import these types directly and maintain consistency in our verification flows.
app/src/utils/proving/provingMachine.ts (1)
599-647: Load the selected document via SelfClient (aligns with PR objective and prevents drift)init still pulls data from providers (loadSelectedDocument, unsafe_getPrivateKey). The PR’s goal is to read the document catalog via SelfClient; let’s use selfClient.loadDocumentCatalog/loadDocumentById to determine the selected document. This avoids divergence between sources and simplifies future SDK-driven changes.
actor = createActor(provingMachine); -setupActorSubscriptions(actor, selfClient); +setupActorSubscriptions(actor); actor.start(); trackEvent(ProofEvents.DOCUMENT_LOAD_STARTED); -// TODO call on self client -const selectedDocument = await loadSelectedDocument(); -if (!selectedDocument) { - console.error('No document found for proving'); - trackEvent(PassportEvents.PASSPORT_DATA_NOT_FOUND, { stage: 'init' }); - actor!.send({ type: 'PASSPORT_DATA_NOT_FOUND' }); - return; -} - -const { data: passportData } = selectedDocument; +// Use SelfClient as the single source of truth +const catalog = await selfClient.loadDocumentCatalog(); +let selectedId = catalog.selectedDocumentId ?? catalog.documents[0]?.id; +if (!selectedId) { + console.error('No document found for proving'); + trackEvent(PassportEvents.PASSPORT_DATA_NOT_FOUND, { stage: 'init' }); + actor!.send({ type: 'PASSPORT_DATA_NOT_FOUND' }); + return; +} +const passportData = await selfClient.loadDocumentById(selectedId); +if (!passportData) { + console.error('Selected document data not found'); + trackEvent(PassportEvents.PASSPORT_DATA_NOT_FOUND, { stage: 'init' }); + actor!.send({ type: 'PASSPORT_DATA_NOT_FOUND' }); + return; +} -// TODO call on self client const secret = await unsafe_getPrivateKey(); if (!secret) { console.error('Could not load secret'); trackEvent(ProofEvents.LOAD_SECRET_FAILED); actor!.send({ type: 'ERROR' }); return; }Note: If the secret is also moving under SelfClient control, plan a follow-up to source it from the SDK once available.
app/src/providers/passportDataProvider.tsx (2)
83-93: Rewrite safeGetAllDocuments to use SelfClient directly (fixes missing export and reduces coupling)Replace the helper with a local impl that walks the catalog and loads docs. This removes the dependency on a non-exported SDK util and keeps the provider resilient.
-const safeGetAllDocuments = async (selfClient: SelfClient) => { - try { - return await getAllDocuments(selfClient); - } catch (error) { - console.warn( - 'Error in safeGetAllDocuments, returning empty object:', - error, - ); - return {}; - } -}; +const safeGetAllDocuments = async (selfClient: SelfClient) => { + try { + const catalog = await selfClient.loadDocumentCatalog(); + const allDocs: { + [documentId: string]: { data: PassportData; metadata: DocumentMetadata }; + } = {}; + for (const metadata of catalog.documents) { + const data = await selfClient.loadDocumentById(metadata.id); + if (data) { + allDocs[metadata.id] = { data, metadata }; + } + } + return allDocs; + } catch (error) { + console.warn('Error in safeGetAllDocuments, returning empty object:', error); + return {}; + } +};
432-447: loadAllPassportData should also switch to the local SelfClient-powered helperThis function still calls the (now removed) getAllDocuments import. Use the safe helper to prevent future breakage.
-const allDocs = await getAllDocuments(selfClient); +const allDocs = await safeGetAllDocuments(selfClient);
🧹 Nitpick comments (14)
app/src/screens/recovery/PassportDataNotFoundScreen.tsx (1)
21-27: SDK client usage LGTM; add in-flight guard to avoid double navigationThe migration to
useSelfClient()andhasAnyValidRegisteredDocument(selfClient)is correct. Consider a short-lived “checking…” disabled state to prevent rapid re-taps causing double navigation when the async check is in flight.+ const [checking, setChecking] = React.useState(false); const onPress = async () => { - const hasValidDocument = await hasAnyValidRegisteredDocument(selfClient); + if (checking) return; + setChecking(true); + const hasValidDocument = await hasAnyValidRegisteredDocument(selfClient); if (hasValidDocument) { navigateToHome(); } else { navigateToLaunch(); } + setChecking(false); };app/src/screens/passport/UnsupportedPassportScreen.tsx (1)
27-33: Good switch to SDK; consider adding a minimal loading/disable stateSame suggestion as the recovery screen: add an in-flight guard so users can’t trigger multiple concurrent checks and navigations by tapping rapidly.
+ const [checking, setChecking] = React.useState(false); const onPress = async () => { - const hasValidDocument = await hasAnyValidRegisteredDocument(selfClient); + if (checking) return; + setChecking(true); + const hasValidDocument = await hasAnyValidRegisteredDocument(selfClient); if (hasValidDocument) { navigateToHome(); } else { navigateToLaunch(); } + setChecking(false); };app/src/utils/proving/validateDocument.ts (2)
75-123: Avoid mutating global 'selected document' while scanning all documentsInside the loop,
setSelectedDocument(documentId)flips global selection for each document. If this runs while UI depends on the selected document, it can cause subtle, user-visible state churn. Prefer a read-by-id path to fetch data for a given document without altering global selection (e.g.,loadDocumentById(documentId)), or introduce a dedicated repository method that scopes reads by id.If/when a by-id accessor is available, the loop can avoid global mutation:
// pseudo-code illustration for (const { id: documentId } of documents) { const selectedDocument = await loadDocumentById(documentId); // ...rest unchanged }
317-328: Deprecation shim is fine; add a runtime warn to aid migration and telemetryKeeping this shim reduces churn, but its name is identical to the SDK export and can confuse call-site autocomplete. Add a
console.warnso any lingering use is visible in dev logs and Crashlytics (if collected).export async function hasAnyValidRegisteredDocument(): Promise<boolean> { + if (__DEV__) { + // eslint-disable-next-line no-console + console.warn('[deprecated] validateDocument.hasAnyValidRegisteredDocument(): use @selfxyz/mobile-sdk-alpha hasAnyValidRegisteredDocument(selfClient)'); + } try { const catalog = await loadDocumentCatalog(); return catalog.documents.some(doc => doc.isRegistered === true);app/src/providers/selfClientProvider.tsx (1)
11-12: Extract Documents Adapter to a Standalone Module to Decouple ProvidersI ran the suggested import‐cycle check and confirmed there is currently no circular import between
selfClientProvider.tsxandpassportDataProvider.tsx. However, pullingselfClientDocumentsAdapterdirectly frompassportDataProviderstill couples these top-level providers and risks a future cycle if one starts importing the other.• File to update:
app/src/providers/selfClientProvider.tsx(remove direct import)
• New module to create:app/src/adapters/documents/selfClientDocumentsAdapter.ts(standalone adapter)Minimal diff for the provider import:
- import { selfClientDocumentsAdapter } from '@/providers/passportDataProvider'; + import { selfClientDocumentsAdapter } from '@/adapters/documents/selfClientDocumentsAdapter';And in
app/src/adapters/documents/selfClientDocumentsAdapter.ts:import { loadDocumentById, loadDocumentCatalog } from '@/providers/passportDataProvider'; import type { DocumentsAdapter } from '@selfxyz/mobile-sdk-alpha'; export const selfClientDocumentsAdapter: DocumentsAdapter = { loadDocumentCatalog, loadDocumentById, }; export default selfClientDocumentsAdapter;This refactor keeps your provider layer clean, prevents brittle imports, and avoids potential Metro/Jest initialization order issues down the road.
app/src/screens/aesop/PassportOnboardingScreen.tsx (1)
8-12: Prevent double navigation from rapid taps; guard async check and disable the Cancel button while in-flight.
onCancelPressawaits an async catalog read with no reentrancy guard. On slower devices/network, repeated taps can enqueue multiple navigations (Home/Launch) and produce inconsistent UI state. Add a lightweight “isChecking” guard and disable the Cancel button until the check completes.Apply this diff within the changed block:
-const onCancelPress = async () => { - const hasValidDocument = await hasAnyValidRegisteredDocument(client); - if (hasValidDocument) { - navigateToHome(); - } else { - navigateToLaunch(); - } -}; +let isCheckingRef = { current: false }; +const onCancelPress = async () => { + if (isCheckingRef.current) return; + isCheckingRef.current = true; + try { + const hasValidDocument = await hasAnyValidRegisteredDocument(client); + if (hasValidDocument) { + navigateToHome(); + } else { + navigateToLaunch(); + } + } finally { + isCheckingRef.current = false; + } +};Outside the selected lines, also wire the disabled state on the Cancel button:
<SecondaryButton trackEvent={PassportEvents.CAMERA_SCAN_CANCELLED} onPress={onCancelPress} disabled={isCheckingRef.current} />Optional: swap
isCheckingRefforuseStateif you want automatic re-render to apply the disabled prop immediately.Also applies to: 27-38
packages/mobile-sdk-alpha/tests/utils/testHelpers.ts (1)
43-46: Mocks align with the new DocumentsAdapter; consider seeding helpers for richer tests.The empty catalog/null-by-id defaults are fine as a baseline. For stronger coverage of document flows, add an overridable factory that can seed documents (registered/unregistered, different types) so tests can assert behavior without re-mocking here.
Example helper:
export const makeMockDocuments = (docs: any[] = []) => ({ loadDocumentCatalog: async () => ({ documents: docs }), loadDocumentById: async (id: string) => docs.find(d => d.id === id) ?? null, });Then in
mockAdapters:export const mockDocuments = makeMockDocuments();Also applies to: 52-53
app/tests/src/providers/passportDataProvider.test.tsx (1)
133-138: Minor test resilience: centralize the provider wrapper to reduce future churn.Multiple specs inline the same
<SelfClientProvider config={{}} adapters={mockAdapters}>…</SelfClientProvider>wrapper. Centralizing this into arenderWithSelfClienthelper reduces duplication and ensures future adapter changes (e.g., additional required fields) are picked up in one place. Not blocking, but it materially improves maintainability.Also applies to: 147-152, 168-173, 187-192, 212-217, 225-229, 235-240, 247-252, 261-266, 273-278
app/src/screens/misc/SplashScreen.tsx (1)
9-12: ✅ SelfClientProvider Confirmed at App Entry; Optional SplashScreen Mount-Safety RefactorGreat news—
SelfClientProvideralready wraps your native root inapp/App.tsx(lines 29–39), souseSelfClientis available on SplashScreen at startup. No changes needed there.However, to guard against “setState after unmount” in fast navigations, I still recommend adding a simple cancellation flag inside your SplashScreen effect. This prevents calling
setNextScreenon an unmounted component, eliminating potential React warnings or crashes.• File app/src/screens/misc/SplashScreen.tsx (around lines 9–12):
– Add alet cancelled = false;guard in youruseEffect.
– WrapsetNextScreen(...)calls inif (!cancelled) ….
– Return() => { cancelled = true; }from the effect cleanup.Here’s a minimal pattern to slot into your existing effect:
useEffect(() => { if (!dataLoadInitiatedRef.current) { dataLoadInitiatedRef.current = true; - (async () => { - const hasValid = await hasAnyValidRegisteredDocument(selfClient); - setNextScreen(hasValid ? 'Home' : 'Launch'); - })(); + let cancelled = false; + + const loadDataAndDetermineNextScreen = async () => { + try { + const hasValid = await hasAnyValidRegisteredDocument(selfClient); + if (!cancelled) setNextScreen(hasValid ? 'Home' : 'Launch'); + } catch (error) { + console.error(`Error in SplashScreen data loading: ${error}`); + if (!cancelled) setNextScreen('Launch'); + } + }; + + loadDataAndDetermineNextScreen(); + return () => { + cancelled = true; + }; } }, [selfClient, setNextScreen]);Optional: As mentioned, you could centralize and cache this “has registered doc” decision in your
SelfClientProviderto avoid duplicate catalog reads across Splash and other flows.packages/mobile-sdk-alpha/tests/client.test.ts (1)
9-19: Stabilize error assertion strategy to reduce test brittlenessThe tests currently assert exact error strings (e.g., 'scanner adapter not provided'). Minor wording changes in notImplemented(name) would break these tests. Prefer regex or partial matching.
Apply these diffs:
- ).toThrow('scanner adapter not provided'); + ).toThrow(/scanner adapter not provided/);- expect(() => createSelfClient({ config: {}, adapters: { scanner, crypto, documents } })).toThrow( - 'network adapter not provided', - ); + expect(() => + createSelfClient({ config: {}, adapters: { scanner, crypto, documents } }), + ).toThrow(/network adapter not provided/);- expect(() => createSelfClient({ config: {}, adapters: { scanner, network, documents } })).toThrow( - 'crypto adapter not provided', - ); + expect(() => + createSelfClient({ config: {}, adapters: { scanner, network, documents } }), + ).toThrow(/crypto adapter not provided/);- expect(() => createSelfClient({ config: {}, adapters: { scanner, network, crypto } })).toThrow( - 'documents adapter not provided', - ); + expect(() => + createSelfClient({ config: {}, adapters: { scanner, network, crypto } }), + ).toThrow(/documents adapter not provided/);Also applies to: 22-31, 33-37
packages/mobile-sdk-alpha/src/documents/utils.ts (1)
11-29: Parallelize catalog fetches and harden against per-document failuresThe current for-of loop serializes N loadDocumentById calls and fails the whole operation on a single rejection. Parallelize with Promise.all and continue on per-document errors to improve performance and resilience.
Apply this diff:
const catalog = await selfClient.loadDocumentCatalog(); - const allDocs: { - [documentId: string]: { data: PassportData; metadata: DocumentMetadata }; - } = {}; - - for (const metadata of catalog.documents) { - const data = await selfClient.loadDocumentById(metadata.id); - if (data) { - allDocs[metadata.id] = { data, metadata }; - } - } - - return allDocs; + const aggregated: { + [documentId: string]: { data: PassportData; metadata: DocumentMetadata }; + } = {}; + await Promise.all( + catalog.documents.map(async metadata => { + try { + const data = await selfClient.loadDocumentById(metadata.id); + if (data) aggregated[metadata.id] = { data, metadata }; + } catch (err) { + // Surface via SDK event; avoid console noise/PII. + selfClient.emit?.( + 'error', + Object.assign(new Error('SELF_LOAD_DOCUMENT_BY_ID_FAILED'), { cause: err, id: metadata.id }), + ); + } + }), + ); + return aggregated;app/src/utils/proving/provingMachine.ts (3)
26-26: Use a type-only import for SelfClient to avoid bundling at runtimeSelfClient is only used for typing; switch to a type-only import to avoid pulling it into the JS bundle. This is a safe perf micro-optimization and keeps the boundary clean.
-import { SelfClient } from '@selfxyz/mobile-sdk-alpha'; +import type { SelfClient } from '@selfxyz/mobile-sdk-alpha';
210-214: Don’t thread SelfClient through every method; store it once in stateYou’re passing selfClient through subscriptions and method signatures, but some code paths (e.g., _handleRegisterErrorOrFailure) don’t receive it, and validatingDocument doesn’t actually use it. Persist selfClient in the store and read it where needed. This removes param plumbing, fixes the TODO later, and reduces call-site errors.
interface ProvingState { currentState: ProvingStateType; + selfClient?: SelfClient; … - init: ( - selfClient: SelfClient, - circuitType: 'dsc' | 'disclose' | 'register', - userConfirmed?: boolean, - ) => Promise<void>; + init: (selfClient: SelfClient, circuitType: 'dsc' | 'disclose' | 'register', userConfirmed?: boolean) => Promise<void>; … - validatingDocument: (selfClient: SelfClient) => Promise<void>; + validatingDocument: () => Promise<void>; … - postProving: (selfClient: SelfClient) => void; + postProving: () => void; … } function setupActorSubscriptions( - newActor: AnyActorRef, - selfClient: SelfClient, + newActor: AnyActorRef, ) { newActor.subscribe((state: StateFrom<typeof provingMachine>) => { … if (state.value === 'validating_document') { - get().validatingDocument(selfClient); + get().validatingDocument(); } … if (state.value === 'post_proving') { - get().postProving(selfClient); + get().postProving(); } }); }And set it during init:
set({ currentState: 'idle', + selfClient, … });Also applies to: 223-236
689-783: validatingDocument(selfClient) parameter is unused; either use it or remove itPassing selfClient but not using it is misleading and increases cognitive load. If registration/validation logic is moving into the SDK (validateDocument/checkRegistration), wire it now; otherwise drop the param until needed.
Option A (use SelfClient now): invoke selfClient.checkRegistration/validateDocument where appropriate.
Option B (simpler): remove the param and rely on store state as proposed earlier.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (27)
app/src/providers/passportDataProvider.tsx(11 hunks)app/src/providers/selfClientProvider.tsx(2 hunks)app/src/screens/aesop/PassportOnboardingScreen.tsx(3 hunks)app/src/screens/misc/SplashScreen.tsx(3 hunks)app/src/screens/passport/PassportCameraScreen.tsx(3 hunks)app/src/screens/passport/PassportNFCScanScreen.tsx(3 hunks)app/src/screens/passport/PassportNFCScanScreen.web.tsx(3 hunks)app/src/screens/passport/UnsupportedPassportScreen.tsx(2 hunks)app/src/screens/prove/ConfirmBelongingScreen.tsx(2 hunks)app/src/screens/prove/ProveScreen.tsx(3 hunks)app/src/screens/recovery/PassportDataNotFoundScreen.tsx(1 hunks)app/src/screens/settings/ManageDocumentsScreen.tsx(1 hunks)app/src/utils/proving/index.ts(1 hunks)app/src/utils/proving/provingMachine.ts(12 hunks)app/src/utils/proving/validateDocument.ts(1 hunks)app/tests/src/providers/passportDataProvider.test.tsx(8 hunks)app/tests/src/utils/proving/validateDocument.test.ts(1 hunks)app/tests/utils/selfClientProvider.ts(1 hunks)common/src/utils/types.ts(1 hunks)packages/mobile-sdk-alpha/src/adapters/index.ts(1 hunks)packages/mobile-sdk-alpha/src/client.ts(3 hunks)packages/mobile-sdk-alpha/src/documents/utils.ts(1 hunks)packages/mobile-sdk-alpha/src/index.ts(3 hunks)packages/mobile-sdk-alpha/src/types/public.ts(4 hunks)packages/mobile-sdk-alpha/tests/client.test.ts(6 hunks)packages/mobile-sdk-alpha/tests/client.test.tsx(1 hunks)packages/mobile-sdk-alpha/tests/utils/testHelpers.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/technical-specification.mdc)
**/*.{ts,tsx}: Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Files:
app/src/screens/aesop/PassportOnboardingScreen.tsxapp/src/screens/passport/UnsupportedPassportScreen.tsxpackages/mobile-sdk-alpha/src/adapters/index.tsapp/tests/utils/selfClientProvider.tsapp/src/utils/proving/validateDocument.tspackages/mobile-sdk-alpha/tests/client.test.tsxapp/tests/src/providers/passportDataProvider.test.tsxapp/src/screens/settings/ManageDocumentsScreen.tsxapp/src/screens/prove/ConfirmBelongingScreen.tsxcommon/src/utils/types.tsapp/src/providers/selfClientProvider.tsxpackages/mobile-sdk-alpha/src/documents/utils.tsapp/src/screens/recovery/PassportDataNotFoundScreen.tsxapp/tests/src/utils/proving/validateDocument.test.tsapp/src/screens/passport/PassportNFCScanScreen.web.tsxapp/src/utils/proving/index.tspackages/mobile-sdk-alpha/src/client.tspackages/mobile-sdk-alpha/tests/utils/testHelpers.tsapp/src/screens/prove/ProveScreen.tsxapp/src/screens/misc/SplashScreen.tsxapp/src/screens/passport/PassportNFCScanScreen.tsxapp/src/screens/passport/PassportCameraScreen.tsxapp/src/utils/proving/provingMachine.tspackages/mobile-sdk-alpha/src/types/public.tspackages/mobile-sdk-alpha/src/index.tspackages/mobile-sdk-alpha/tests/client.test.tsapp/src/providers/passportDataProvider.tsx
app/src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:
- Component architecture and reusability
- State management patterns
- Performance optimizations
- TypeScript type safety
- React hooks usage and dependencies
- Navigation patterns
Files:
app/src/screens/aesop/PassportOnboardingScreen.tsxapp/src/screens/passport/UnsupportedPassportScreen.tsxapp/src/utils/proving/validateDocument.tsapp/src/screens/settings/ManageDocumentsScreen.tsxapp/src/screens/prove/ConfirmBelongingScreen.tsxapp/src/providers/selfClientProvider.tsxapp/src/screens/recovery/PassportDataNotFoundScreen.tsxapp/src/screens/passport/PassportNFCScanScreen.web.tsxapp/src/utils/proving/index.tsapp/src/screens/prove/ProveScreen.tsxapp/src/screens/misc/SplashScreen.tsxapp/src/screens/passport/PassportNFCScanScreen.tsxapp/src/screens/passport/PassportCameraScreen.tsxapp/src/utils/proving/provingMachine.tsapp/src/providers/passportDataProvider.tsx
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}: Review alpha mobile SDK code for:
- API consistency with core SDK
- Platform-neutral abstractions
- Performance considerations
- Clear experimental notes or TODOs
Files:
packages/mobile-sdk-alpha/src/adapters/index.tspackages/mobile-sdk-alpha/tests/client.test.tsxpackages/mobile-sdk-alpha/src/documents/utils.tspackages/mobile-sdk-alpha/src/client.tspackages/mobile-sdk-alpha/tests/utils/testHelpers.tspackages/mobile-sdk-alpha/src/types/public.tspackages/mobile-sdk-alpha/src/index.tspackages/mobile-sdk-alpha/tests/client.test.ts
**/*.{test,spec}.{ts,js,tsx,jsx}
⚙️ CodeRabbit configuration file
**/*.{test,spec}.{ts,js,tsx,jsx}: Review test files for:
- Test coverage completeness
- Test case quality and edge cases
- Mock usage appropriateness
- Test readability and maintainability
Files:
packages/mobile-sdk-alpha/tests/client.test.tsxapp/tests/src/providers/passportDataProvider.test.tsxapp/tests/src/utils/proving/validateDocument.test.tspackages/mobile-sdk-alpha/tests/client.test.ts
common/src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
common/src/**/*.{ts,tsx,js,jsx}: Review shared utilities for:
- Reusability and modular design
- Type safety and error handling
- Side-effect management
- Documentation and naming clarity
Files:
common/src/utils/types.ts
packages/mobile-sdk-alpha/src/index.ts
📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)
Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Files:
packages/mobile-sdk-alpha/src/index.ts
🧠 Learnings (17)
📚 Learning: 2025-08-23T02:02:02.506Z
Learnt from: transphorm
PR: selfxyz/self#942
File: app/vite.config.ts:170-0
Timestamp: 2025-08-23T02:02:02.506Z
Learning: In the selfxyz/self React Native app, devTools from '@/navigation/devTools' are intentionally shipped to production builds for testing purposes, not excluded as is typical in most applications.
Applied to files:
app/src/screens/aesop/PassportOnboardingScreen.tsx
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to packages/mobile-sdk-alpha/src/crypto/** : Place crypto adapters and utilities in packages/mobile-sdk-alpha/src/crypto/
Applied to files:
packages/mobile-sdk-alpha/src/adapters/index.tsapp/tests/utils/selfClientProvider.ts
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Applied to files:
packages/mobile-sdk-alpha/src/adapters/index.tsapp/tests/utils/selfClientProvider.tspackages/mobile-sdk-alpha/tests/client.test.tsxpackages/mobile-sdk-alpha/src/documents/utils.tspackages/mobile-sdk-alpha/tests/utils/testHelpers.tsapp/src/screens/misc/SplashScreen.tsxpackages/mobile-sdk-alpha/src/types/public.tspackages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to tests/__setup__/databaseMocks.ts : Provide SQLite testing utilities in tests/__setup__/databaseMocks.ts and use a mock database instance
Applied to files:
app/tests/utils/selfClientProvider.tspackages/mobile-sdk-alpha/tests/utils/testHelpers.ts
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to packages/mobile-sdk-alpha/tests/setup.ts : Provide Vitest setup file at packages/mobile-sdk-alpha/tests/setup.ts to suppress console noise
Applied to files:
app/tests/utils/selfClientProvider.ts
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to app/jest.setup.js : Provide comprehensive Jest setup in app/jest.setup.js with required mocks
Applied to files:
app/tests/utils/selfClientProvider.tsapp/tests/src/providers/passportDataProvider.test.tsxapp/tests/src/utils/proving/validateDocument.test.tspackages/mobile-sdk-alpha/tests/utils/testHelpers.ts
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to jest.setup.js : Maintain comprehensive mocks in jest.setup.js for all native modules
Applied to files:
app/tests/utils/selfClientProvider.tsapp/tests/src/providers/passportDataProvider.test.tsx
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to tests/src/**/*.{test,spec}.{ts,tsx,js,jsx} : Use renderHook for custom hook testing
Applied to files:
app/tests/src/providers/passportDataProvider.test.tsx
📚 Learning: 2025-08-24T18:52:25.766Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.766Z
Learning: Test error boundaries and recovery mechanisms
Applied to files:
app/tests/src/providers/passportDataProvider.test.tsx
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to src/**/*.{tsx} : Implement comprehensive error boundaries in React components
Applied to files:
app/tests/src/providers/passportDataProvider.test.tsx
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to src/navigation/**/*.{ts,tsx} : Use react-navigation/native with createStaticNavigation for type-safe navigation
Applied to files:
app/src/screens/settings/ManageDocumentsScreen.tsxapp/src/screens/prove/ConfirmBelongingScreen.tsxapp/src/screens/misc/SplashScreen.tsx
📚 Learning: 2025-08-24T18:55:07.911Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/technical-specification.mdc:0-0
Timestamp: 2025-08-24T18:55:07.911Z
Learning: Applies to **/*.{ts,tsx} : Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Applied to files:
common/src/utils/types.ts
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to packages/mobile-sdk-alpha/README.md : Document new/updated SDK modules and usage in packages/mobile-sdk-alpha/README.md
Applied to files:
packages/mobile-sdk-alpha/src/documents/utils.tspackages/mobile-sdk-alpha/src/client.tspackages/mobile-sdk-alpha/src/types/public.tspackages/mobile-sdk-alpha/src/index.ts
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to native/ios/**/*.{swift} : iOS NFC: implement custom PassportReader as a Swift module
Applied to files:
app/src/screens/passport/PassportNFCScanScreen.web.tsxapp/src/screens/passport/PassportNFCScanScreen.tsx
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to src/navigation/**/*.{ts,tsx} : Set platform-specific initial routes: web → Home, mobile → Splash
Applied to files:
app/src/screens/misc/SplashScreen.tsx
📚 Learning: 2025-08-24T18:55:07.911Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/technical-specification.mdc:0-0
Timestamp: 2025-08-24T18:55:07.911Z
Learning: Passport verification workflow: NFC data extraction → MRZ validation → DSC verification → Register proof → compliance via ZK → attestation
Applied to files:
app/src/screens/passport/PassportNFCScanScreen.tsx
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to contracts/contracts/IdentityVerificationHubImplV2.sol : Identity Verification Hub: manage multi-step verification for passports and EU ID cards, handle document attestation via ZK proofs, and implement E-PASSPORT and EU_ID_CARD paths in IdentityVerificationHubImplV2.sol
Applied to files:
app/src/screens/passport/PassportNFCScanScreen.tsx
🧬 Code graph analysis (18)
app/src/screens/aesop/PassportOnboardingScreen.tsx (2)
packages/mobile-sdk-alpha/src/index.ts (2)
useSelfClient(71-71)hasAnyValidRegisteredDocument(85-85)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
hasAnyValidRegisteredDocument(37-48)
app/src/screens/passport/UnsupportedPassportScreen.tsx (3)
packages/mobile-sdk-alpha/src/index.ts (2)
useSelfClient(71-71)hasAnyValidRegisteredDocument(85-85)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
hasAnyValidRegisteredDocument(37-48)app/src/utils/proving/validateDocument.ts (1)
hasAnyValidRegisteredDocument(320-328)
app/tests/utils/selfClientProvider.ts (1)
packages/mobile-sdk-alpha/tests/utils/testHelpers.ts (5)
mockCrypto(38-41)mockDocuments(43-46)mockNetwork(15-36)mockScanner(11-13)mockAdapters(48-53)
app/tests/src/providers/passportDataProvider.test.tsx (2)
app/tests/utils/selfClientProvider.ts (1)
mockAdapters(53-58)app/src/providers/passportDataProvider.tsx (1)
PassportProvider(174-252)
app/src/screens/prove/ConfirmBelongingScreen.tsx (1)
app/src/utils/haptic/index.ts (1)
notificationSuccess(164-164)
app/src/providers/selfClientProvider.tsx (1)
app/src/providers/passportDataProvider.tsx (1)
selfClientDocumentsAdapter(472-475)
packages/mobile-sdk-alpha/src/documents/utils.ts (2)
packages/mobile-sdk-alpha/src/types/public.ts (2)
SelfClient(124-143)PassportData(3-3)app/src/utils/proving/validateDocument.ts (1)
hasAnyValidRegisteredDocument(320-328)
app/src/screens/recovery/PassportDataNotFoundScreen.tsx (3)
packages/mobile-sdk-alpha/src/index.ts (2)
useSelfClient(71-71)hasAnyValidRegisteredDocument(85-85)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
hasAnyValidRegisteredDocument(37-48)app/src/utils/proving/validateDocument.ts (1)
hasAnyValidRegisteredDocument(320-328)
app/src/screens/passport/PassportNFCScanScreen.web.tsx (3)
packages/mobile-sdk-alpha/src/index.ts (2)
useSelfClient(71-71)hasAnyValidRegisteredDocument(85-85)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
hasAnyValidRegisteredDocument(37-48)app/src/utils/proving/validateDocument.ts (1)
hasAnyValidRegisteredDocument(320-328)
packages/mobile-sdk-alpha/src/client.ts (1)
packages/mobile-sdk-alpha/src/types/public.ts (1)
Adapters(53-61)
packages/mobile-sdk-alpha/tests/utils/testHelpers.ts (3)
app/tests/utils/selfClientProvider.ts (5)
mockDocuments(17-20)mockAdapters(53-58)mockScanner(44-51)mockNetwork(22-42)mockCrypto(12-15)packages/mobile-sdk-alpha/src/index.ts (1)
DocumentsAdapter(7-7)packages/mobile-sdk-alpha/src/types/public.ts (1)
DocumentsAdapter(119-122)
app/src/screens/misc/SplashScreen.tsx (2)
packages/mobile-sdk-alpha/src/documents/utils.ts (1)
hasAnyValidRegisteredDocument(37-48)app/src/utils/proving/validateDocument.ts (1)
hasAnyValidRegisteredDocument(320-328)
app/src/screens/passport/PassportNFCScanScreen.tsx (2)
packages/mobile-sdk-alpha/src/index.ts (2)
useSelfClient(71-71)hasAnyValidRegisteredDocument(85-85)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
hasAnyValidRegisteredDocument(37-48)
app/src/screens/passport/PassportCameraScreen.tsx (4)
packages/mobile-sdk-alpha/src/index.ts (2)
useSelfClient(71-71)hasAnyValidRegisteredDocument(85-85)packages/mobile-sdk-alpha/src/browser.ts (1)
useSelfClient(42-42)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
hasAnyValidRegisteredDocument(37-48)app/src/utils/proving/validateDocument.ts (1)
hasAnyValidRegisteredDocument(320-328)
app/src/utils/proving/provingMachine.ts (2)
packages/mobile-sdk-alpha/src/index.ts (1)
SelfClient(25-25)packages/mobile-sdk-alpha/src/types/public.ts (1)
SelfClient(124-143)
packages/mobile-sdk-alpha/src/types/public.ts (1)
common/src/utils/types.ts (2)
DocumentCatalog(8-11)PassportData(28-43)
packages/mobile-sdk-alpha/tests/client.test.ts (2)
packages/mobile-sdk-alpha/src/client.ts (1)
createSelfClient(54-137)packages/mobile-sdk-alpha/src/types/public.ts (1)
DocumentsAdapter(119-122)
app/src/providers/passportDataProvider.tsx (3)
packages/mobile-sdk-alpha/src/types/public.ts (3)
SelfClient(124-143)PassportData(3-3)DocumentsAdapter(119-122)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
getAllDocuments(11-29)common/src/utils/types.ts (3)
PassportData(28-43)DocumentCatalog(8-11)DocumentMetadata(13-20)
🪛 GitHub Actions: Common CI
app/src/utils/proving/validateDocument.ts
[error] 28-28: TS2459: Module '@/providers/passportDataProvider' declares 'getAllDocuments' locally, but it is not exported.
🪛 GitHub Actions: Web CI
app/src/utils/proving/validateDocument.ts
[error] 28-28: Import 'getAllDocuments' used in this file cannot be resolved due to missing export in the mobile-sdk-alpha browser module.
app/src/providers/passportDataProvider.tsx
[error] 62-62: No matching export for import 'getAllDocuments' from 'src/packages/mobile-sdk-alpha/dist/esm/browser.js' (imported by src/providers/passportDataProvider.tsx). Build step 'yarn web:build' failed.
⏰ 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). (2)
- GitHub Check: e2e-ios
- GitHub Check: build-ios
🔇 Additional comments (20)
app/src/screens/settings/ManageDocumentsScreen.tsx (1)
11-15: Align package exports and unify import paths for shared typesTo prevent runtime and build-time resolution errors, we need a single, supported entrypoint for type definitions in
@selfxyz/common. Currently neither@selfxyz/common/utils/typesnor@selfxyz/common/typesis exported by the package’sexportsfield, and our codebase mixes both paths—tests import from@selfxyz/common/types, while app code and SDK alpha use@selfxyz/common/utils/types.• Add an exports subpath for your chosen alias in
common/package.json, for example:"exports": { + "./utils/types": { + "types": "./dist/esm/src/utils/types.d.ts", + "import": "./dist/esm/src/utils/types.js", + "require": "./dist/cjs/src/utils/types.cjs" + }, ".": { … }, "./constants": { … }, … }• Pick one canonical import path (recommend:
@selfxyz/common/utils/types) and update all imports accordingly:
– app/src/utils/nfcScanner.ts
– app/src/utils/proving/.ts(x) & tests/src/utils/proving/.test.ts
– app/src/screens/settings//*.tsx
– packages/mobile-sdk-alpha/src//.ts
– circuits/tests/**/.ts
– contracts/test/utils/**/*.ts
• Ensure your TS configs cover the chosen alias (inapp/tsconfig.jsonandapp/tsconfig.test.json), for example:{ "paths": { "@selfxyz/common": ["../common"], "@selfxyz/common/*": ["../common/*"], "@selfxyz/common/utils/types": ["../common/src/utils/types"] } }• One-liner to bulk-normalize in VS Code or CI:
rg -l "@selfxyz/common/types" -g "*.{ts,tsx,js,jsx}" \ | xargs sed -i "s|@selfxyz/common/types|@selfxyz/common/utils/types|g"This will guarantee consistent resolution across app, tests, SDK, circuits, and contracts.
⛔ Skipped due to learnings
Learnt from: transphorm PR: selfxyz/self#795 File: app/src/screens/prove/ProveScreen.tsx:5-5 Timestamp: 2025-07-28T19:18:48.270Z Learning: The import path 'selfxyz/common/utils/scope' is valid when the common package has a "./utils/*" export mapping in package.json, even if ESLint shows resolution errors before the package is built. The package.json exports field properly maps "./utils/*" to the compiled files in dist/.Learnt from: CR PR: selfxyz/self#0 File: .cursor/rules/mobile-sdk-migration.mdc:0-0 Timestamp: 2025-08-24T18:54:04.799Z Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.tsLearnt from: CR PR: selfxyz/self#0 File: .cursorrules:0-0 Timestamp: 2025-08-24T18:52:25.765Z Learning: Applies to tests/src/**/*.{ts,tsx,js,jsx} : Use tests/ alias for test importsLearnt from: CR PR: selfxyz/self#0 File: .cursor/rules/mobile-sdk-migration.mdc:0-0 Timestamp: 2025-08-24T18:54:04.799Z Learning: Applies to packages/mobile-sdk-alpha/package.json : Enable tree shaking for the SDK (e.g., ensure 'sideEffects' is correctly set in package.json and exports are ESM-friendly)Learnt from: CR PR: selfxyz/self#0 File: .cursorrules:0-0 Timestamp: 2025-08-24T18:52:25.765Z Learning: Applies to src/utils/**/*.{ts,tsx} : Place shared utilities in @/utilsLearnt from: CR PR: selfxyz/self#0 File: .cursorrules:0-0 Timestamp: 2025-08-24T18:52:25.765Z Learning: Applies to src/types/**/*.{ts,tsx} : Place type definitions in @/typesapp/tests/src/utils/proving/validateDocument.test.ts (1)
3-3: Verify PassportData import path consistencyThere’s an import in
• app/tests/src/utils/proving/validateDocument.test.ts:import type { PassportData } from '@selfxyz/common/types';while most of the mobile-SDK and app code imports PassportData from
import type { PassportData } from '@selfxyz/common/utils/types';This divergence can break type resolution in tests or lead to duplicate type declarations if both paths aren’t aliased to the same module.
Action items:
- Update the test to use the canonical path:
- import type { PassportData } from '@selfxyz/common/types'; + import type { PassportData } from '@selfxyz/common/utils/types';- Verify your root and test tsconfig.json “paths” mappings cover whichever import you standardize on (e.g. alias
@selfxyz/common/utils/*→common/dist/utils/*).- Confirm the common package’s package.json exports include that same entrypoint under both ESM and CJS (if needed for downstream consumers).
Please double-check the tsconfig “paths” and package.json “exports” before merging to ensure IDEs, CI, and Jest resolve the chosen module identically.
app/src/screens/prove/ConfirmBelongingScreen.tsx (1)
42-47: Ensureinit(selfClient, 'dsc')Is Idempotent WhenselfClientChanges
- We searched across
app/srcand confirmed there’s only one direct call toinit(selfClient, 'dsc')in
app/src/screens/prove/ConfirmBelongingScreen.tsx:45—no unintended duplicates in this component.- There’s no local definition of
initin your codebase; it’s being supplied by your proving-machine hook or an external SDK.- Double-initializing a proving flow (or re-registering listeners/contracts) can introduce hard-to-debug state issues, memory leaks, or performance regressions if
selfClientever changes or the component remounts.Action:
Verify inside your proving hook or SDK that callinginit(...)more than once is a no-op after the first successful run. If it isn’t, add a guard (e.g. internal flag, memoization, or early return) to prevent repeat initialization.app/src/utils/proving/index.ts (1)
18-18: No leftover imports ofhasAnyValidRegisteredDocumentfound
All call sites now correctly import from@selfxyz/mobile-sdk-alpha, so removing the barrel re-export poses no breakage.app/src/utils/proving/validateDocument.ts (1)
52-57: Switch to catalog-based iteration in validateDocument.tsAlign this function with the new SDK-driven catalog and avoid relying on the legacy
getAllDocumentsdictionary:-export async function checkAndUpdateRegistrationStates(): Promise<void> { - const allDocuments = await getAllDocuments(); - for (const documentId of Object.keys(allDocuments)) { +export async function checkAndUpdateRegistrationStates(): Promise<void> { + const { documents } = await loadDocumentCatalog(); + for (const { id: documentId } of documents) { try { await setSelectedDocument(documentId); const selectedDocument = await loadSelectedDocument(); if (!selectedDocument) continue;Before merging, please:
• Confirm that the
DocumentCatalogtype (returned byloadDocumentCatalog) exposes anid: stringproperty on each entry.
• Remove thegetAllDocumentsimport in this file.
• Note:getAllDocumentsis still used across hooks and screens—if you’re fully migrating, you’ll need to update those references as well to avoid inconsistent behavior.app/src/providers/selfClientProvider.tsx (1)
52-52: Documents adapter wiring: LGTM.Adapter is correctly exposed on
adapters.documents, enablingclient.loadDocumentCatalog()/loadDocumentById()paths in the SDK. No blocking issues from a security or performance standpoint.app/src/screens/prove/ProveScreen.tsx (2)
60-61: LGTM on client retrieval.Using
useSelfClient()here aligns the proving flow with the new documents-backed architecture.
23-23: AllprovingStore.initcalls now use the new two-argument signature
- Verified in app/src/screens/prove/ProveScreen.tsx (line 98):
provingStore.init(selfClient, 'disclose')- Repo-wide ripgrep confirms no single-argument
provingStore.initcalls remainEffect dependencies and import of
useSelfClientlook correct. No further updates needed.app/tests/src/providers/passportDataProvider.test.tsx (1)
7-8: Great: tests now provide a documents adapter via the SDK provider. Add a focused test for the app SelfClientProvider wiring.These tests exercise
PassportProviderunder the SDKSelfClientProviderwith mocks, which is solid. However, they don’t validate the app’sSelfClientProviderwiring (wheredocuments: selfClientDocumentsAdapterwas added). A small smoke test mountingapp/src/providers/selfClientProvider.tsxwould catch regressions if that adapter is removed or misconfigured.You can scaffold it like:
import RNProvider from '@/providers/selfClientProvider'; import { render } from '@testing-library/react-native'; it('App SelfClientProvider exposes documents adapter', () => { const { getByTestId } = render( <RNProvider> <TestHarnessThatCallsLoadDocumentCatalog testID="adapter-ok" /> </RNProvider> ); expect(getByTestId('adapter-ok')).toBeTruthy(); });Also applies to: 15-16
packages/mobile-sdk-alpha/src/index.ts (1)
7-7: Expose DocumentsAdapter via public API — good additionMaking DocumentsAdapter part of the public surface is the right step for adapterized document access across app and SDK.
packages/mobile-sdk-alpha/tests/client.test.ts (1)
135-138: Good: minimal DocumentsAdapter stub ensures adapter contract is exercisedThe stub matches the public DocumentsAdapter surface and unblocks client creation paths and catalog calls in tests.
app/src/screens/passport/PassportCameraScreen.tsx (1)
9-13: SDK import migration looks correct and consistentSwitching to the SDK’s hasAnyValidRegisteredDocument and useSelfClient aligns this screen with the new SelfClient-centric document flow. No issues spotted.
packages/mobile-sdk-alpha/src/client.ts (1)
45-46: Requiring the documents adapter is the right callMarking documents as a required adapter up-front prevents deferred runtime failures when calling document APIs. Looks good.
packages/mobile-sdk-alpha/src/types/public.ts (1)
119-123: DocumentsAdapter type is clear and minimalThe new adapter interface is well-scoped and aligns with the current API surface. No issues found.
app/tests/utils/selfClientProvider.ts (1)
53-58: Mocks cover all required adapters for createSelfClientIncluding documents in mockAdapters prevents adapter-missing runtime errors in tests. Looks good.
app/src/utils/proving/provingMachine.ts (1)
932-944: Chaining dsc -> register with the same SelfClient looks goodPost-proving transition reuses the same client instance and avoids re-fetching external state. This keeps the flow coherent.
app/src/providers/passportDataProvider.tsx (4)
190-194: Good: getAllData is now driven by a SelfClient instanceThis keeps legacy consumers working while sourcing data via the new SDK. Once call sites are migrated, consider removing getAllData entirely.
472-475: Adapter surface looks correct and future-proofs SelfClient usageBinding the adapter to loadDocumentCatalog/loadDocumentById is a clean seam for the SDK. LGTM.
398-430: initializeNativeModules is already called at app startupI verified that the app invokes initializeNativeModules exactly once, before any provider consumers mount:
• app/src/screens/misc/SplashScreen.tsx (lines 52–54):
const modulesReady = await initializeNativeModules(); if (!modulesReady) { … }• app/src/providers/passportDataProvider.tsx (lines 388–390) includes the JSDoc reminder to call this at startup.
Since the splash screen is the first UI loaded and no other code paths use native modules beforehand, no additional changes are required.
641-643: Verify potential data-loss ingetAllDatausageI ran a global search for
getAllDataacross.ts/.tsxfiles and found no direct call sites outside its definition, but absence of evidence isn’t proof of absence:
- Please manually confirm whether any components or utilities consume
getAllData(e.g., via context, hooks, dynamic invocation).- If it’s unused, consider removing the TODO and deprecating the method to avoid confusion.
- If it is used, refactor its return value to map each
documentTypeto an array ofPassportData(or otherwise warn callers) to prevent silent overwrites when multiple documents share the same type.
…f client for document loading remove deprecated hasAnyValidRegisteredDocument and its usages
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
app/src/providers/passportDataProvider.tsx (4)
83-93: Route through the local SelfClient helper to restore functionality
safeGetAllDocumentsstill calls the non-exported helper. Point it to the new local helper.Apply this diff:
- return await getAllDocuments(selfClient); + return await getAllDocumentsViaClient(selfClient);
432-447: Unblock build: swap to the local SelfClient-based implementationApply this diff:
- const allDocs = await getAllDocuments(selfClient); + const allDocs = await getAllDocumentsViaClient(selfClient);This keeps the legacy shape without depending on SDK barrel exports.
477-513: Prevent silent “empty catalog” by initializing before readsSame readiness problem exists when loading the catalog. Initialize first; still return an empty catalog if init fails.
Apply this diff:
export async function loadDocumentCatalogDirectlyFromKeychain(): Promise<DocumentCatalog> { try { // Extra safety check for module initialization if (typeof Keychain === 'undefined' || !Keychain) { console.warn( 'Keychain module not yet initialized, returning empty catalog', ); return { documents: [] }; } - // Check if native modules are ready (should be initialized at app startup) - if (!nativeModulesReady) { + // Check if native modules are ready (attempt initialization if needed) + if (!nativeModulesReady) { + await initializeNativeModules(); + } + if (!nativeModulesReady) { console.warn('Native modules not ready, returning empty catalog'); return { documents: [] }; }
766-772: Strengthen at-rest protections for PII in Keychain/KeystoreYou’re storing full document catalogs (and documents) without explicit access controls. Recommend enforcing device security (passcode/biometry) where available and preferring “this device only” storage to avoid sync leakage.
Illustrative change for iOS (gate by Platform in real code) and stronger Android security levels:
await Keychain.setGenericPassword('catalog', JSON.stringify(catalog), { service: 'documentCatalog', // iOS accessible: Keychain.ACCESSIBLE.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY, accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE, // Android securityLevel: Keychain.SECURITY_LEVEL.SECURE_HARDWARE, });Mirror these options for document records (
document-{id}) as well. This meaningfully raises the bar against device-level compromise.app/src/utils/proving/provingMachine.ts (1)
320-325: Type mismatch:selfAppis set in store but not declared in ProvingState (compile-time error)
selfApp: nullis being set in the Zustand store initializer, butselfAppis not part of theProvingStateinterface. This will fail type-checking.Apply this diff to remove the extraneous property:
env: null, - selfApp: null, error_code: null,
♻️ Duplicate comments (2)
app/src/providers/passportDataProvider.tsx (1)
54-66: Fix CI: remove non-exported getAllDocuments import from SDK barrelBuild is failing because
@selfxyz/mobile-sdk-alphadoes not re-exportgetAllDocuments. Replace the SDK import with a local helper that callsselfClient.loadDocumentCatalog()andselfClient.loadDocumentById().Apply this diff:
import { DocumentsAdapter, - getAllDocuments, SelfClient, useSelfClient, } from '@selfxyz/mobile-sdk-alpha';Add this helper near the other helpers in this file:
// Local helper to avoid depending on SDK barrel re-exports async function getAllDocumentsViaClient( selfClient: SelfClient, ): Promise<{ [documentId: string]: { data: PassportData; metadata: DocumentMetadata } }> { const catalog = await selfClient.loadDocumentCatalog(); const entries = await Promise.all( catalog.documents.map(async (metadata) => { const data = await selfClient.loadDocumentById(metadata.id); return data ? [metadata.id, { data, metadata }] as const : null; }), ); return Object.fromEntries(entries.filter(Boolean) as [string, { data: PassportData; metadata: DocumentMetadata }][]); }#!/bin/bash # Verify no remaining imports of getAllDocuments from the SDK barrel rg -nP -C2 "from ['\"]@selfxyz/mobile-sdk-alpha['\"][^;]*\{[^}]*\bgetAllDocuments\b" app/ packages/ # Verify all call sites are routed through the new local helper rg -nP -C2 "\bgetAllDocuments\s*\(" app/app/src/utils/proving/provingMachine.ts (1)
1-1: Confirm mandated shared types exist (IdentityCommitment, DSCKeyCommitment, VerificationConfig)Per project guidelines, these must exist in a centralized TS types module with the specified fields. A previous review found them missing/mismatched in the codebase. Please confirm they now exist and are imported from the single source of truth.
#!/bin/bash # Verify mandated types exist exactly once and match expected shapes. rg -nP --type=ts -C2 'interface\s+IdentityCommitment\b|type\s+IdentityCommitment\b' rg -nP --type=ts -C2 'interface\s+DSCKeyCommitment\b|type\s+DSCKeyCommitment\b' rg -nP --type=ts -C2 'interface\s+VerificationConfig\b|type\s+VerificationConfig\b'
🧹 Nitpick comments (3)
app/src/utils/proving/validateDocument.ts (1)
28-34: Avoid bypassing the SelfClient boundary for document readsThis import pulls documents directly from Keychain, which sidesteps the new adapter/client abstraction introduced in this PR. That makes behavior inconsistent depending on call site and risks diverging logic (e.g., caching, remote-backed sources in future). Prefer going through the SelfClient (or accept an optional SelfClient param here) so a single adapter controls the source of truth. At minimum, ensure native modules are initialized before any direct Keychain reads (see next comment).
Would you like me to refactor this to accept an optional
SelfClientand useselfClient.loadDocumentCatalog()/loadDocumentById()when available?app/src/providers/passportDataProvider.tsx (2)
880-896: Load documents concurrently to reduce I/O latencyFetching each document serially will scale poorly as the catalog grows. Use
Promise.allto parallelize Keychain calls. Example:- for (const metadata of catalog.documents) { - const data = await loadDocumentByIdDirectlyFromKeychain(metadata.id); - if (data) { - allDocs[metadata.id] = { data, metadata }; - } - } + const pairs = await Promise.all( + catalog.documents.map(async (metadata) => { + const data = await loadDocumentByIdDirectlyFromKeychain(metadata.id); + return data ? [metadata.id, { data, metadata }] as const : null; + }), + ); + for (const entry of pairs) { + if (entry) { + const [id, value] = entry; + allDocs[id] = value; + } + }
118-135: Optional: Canonical byte‐level hashing for eContentAfter verifying,
passportData.eContentis always anumber[](common/src/utils/types.ts:34), soJSON.stringify(number[])under V8 (and all major JS engines) produces a stable, deterministic string representation. The current approach works without drift, but you may optionally optimize for performance or explicitly guarantee byte‐level hashing by:• Dropping the unused
typeof … === 'string'branch (since eContent never arrives as a raw string)
• Converting the array directly into aUint8Arrayand hashing the bytesExample diff in
app/src/providers/passportDataProvider.tsx:function calculateContentHash(passportData: PassportData): string { - if (passportData.eContent) { - // eContent is likely a buffer or array, convert to string properly - const eContentStr = - typeof passportData.eContent === 'string' - ? passportData.eContent - : JSON.stringify(passportData.eContent); - return sha256(eContentStr); - } + if (passportData.eContent) { + // eContent is a byte array—hash raw bytes directly + const rawBytes = Uint8Array.from(passportData.eContent); + return sha256Bytes(rawBytes); // use a byte‐oriented sha256 helper + } // For documents without eContent (like aadhaar), hash core stable fields const stableData = { documentType: passportData.documentType,You’ll need to import or implement a
sha256Bytes(data: Uint8Array): stringhelper (for example, from a crypto library that accepts byte arrays).
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
app/src/providers/passportDataProvider.tsx(26 hunks)app/src/utils/proving/provingMachine.ts(12 hunks)app/src/utils/proving/validateDocument.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/technical-specification.mdc)
**/*.{ts,tsx}: Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Files:
app/src/utils/proving/validateDocument.tsapp/src/providers/passportDataProvider.tsxapp/src/utils/proving/provingMachine.ts
app/src/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
app/src/**/*.{ts,tsx,js,jsx}: Review React Native TypeScript code for:
- Component architecture and reusability
- State management patterns
- Performance optimizations
- TypeScript type safety
- React hooks usage and dependencies
- Navigation patterns
Files:
app/src/utils/proving/validateDocument.tsapp/src/providers/passportDataProvider.tsxapp/src/utils/proving/provingMachine.ts
🧠 Learnings (6)
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Applied to files:
app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-08-25T14:25:57.541Z
Learnt from: aaronmgdr
PR: selfxyz/self#951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.541Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.
Applied to files:
app/src/providers/passportDataProvider.tsx
📚 Learning: 2025-08-24T18:55:07.911Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/technical-specification.mdc:0-0
Timestamp: 2025-08-24T18:55:07.911Z
Learning: Applies to **/*.{ts,tsx} : Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Applied to files:
app/src/utils/proving/provingMachine.ts
📚 Learning: 2025-08-24T18:55:07.911Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/technical-specification.mdc:0-0
Timestamp: 2025-08-24T18:55:07.911Z
Learning: Applies to **/*.{ts,tsx} : Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Applied to files:
app/src/utils/proving/provingMachine.ts
📚 Learning: 2025-08-24T18:55:07.911Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/technical-specification.mdc:0-0
Timestamp: 2025-08-24T18:55:07.911Z
Learning: Applies to **/*.{ts,tsx} : Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Applied to files:
app/src/utils/proving/provingMachine.ts
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to contracts/contracts/IdentityVerificationHubImplV2.sol : Identity Verification Hub: manage multi-step verification for passports and EU ID cards, handle document attestation via ZK proofs, and implement E-PASSPORT and EU_ID_CARD paths in IdentityVerificationHubImplV2.sol
Applied to files:
app/src/utils/proving/provingMachine.ts
🧬 Code graph analysis (3)
app/src/utils/proving/validateDocument.ts (1)
app/src/providers/passportDataProvider.tsx (1)
getAllDocumentsDirectlyFromKeychain(880-896)
app/src/providers/passportDataProvider.tsx (3)
common/src/utils/types.ts (3)
DocumentCatalog(8-11)PassportData(28-43)DocumentMetadata(13-20)packages/mobile-sdk-alpha/src/types/public.ts (2)
SelfClient(124-143)PassportData(3-3)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
getAllDocuments(11-29)
app/src/utils/proving/provingMachine.ts (3)
packages/mobile-sdk-alpha/src/types/public.ts (1)
SelfClient(124-143)app/src/navigation/index.tsx (1)
navigationRef(53-53)packages/mobile-sdk-alpha/src/documents/utils.ts (1)
hasAnyValidRegisteredDocument(37-48)
🪛 GitHub Actions: Web CI
app/src/providers/passportDataProvider.tsx
[error] 62-62: Command 'yarn web:build' failed. Import error: 'getAllDocuments' is not exported by '../packages/mobile-sdk-alpha/dist/esm/browser.js' (imported by 'src/providers/passportDataProvider.tsx').
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: e2e-ios
- GitHub Check: run_circuit_tests
- GitHub Check: analyze-android
- GitHub Check: build-ios
🔇 Additional comments (7)
app/src/providers/passportDataProvider.tsx (1)
448-470: No on-demand initialization needed—startup already handles itYour search shows that
initializeNativeModules()is invoked in the splash screen before any provider code runs:
• In app/src/screens/misc/SplashScreen.tsx (line 52):
const modulesReady = await initializeNativeModules();
• Tests in app/tests/src/providers/passportDataProvider.test.tsx also call it before any document-loading functions.Since the app’s launch flow (and your tests) always await module initialization at startup, adding an extra
await initializeNativeModules()insideloadDocumentByIdDirectlyFromKeychainis redundant and risks masking setup errors rather than surfacing them. Keep the single, explicit initialization at startup as documented.Likely an incorrect or invalid review comment.
app/src/utils/proving/provingMachine.ts (6)
26-29: SelfClient-based integration import looks correctImporting
SelfClientandhasAnyValidRegisteredDocumentfrom the SDK aligns with the PR goal to move document responsibilities into the client. No issues spotted here.
212-215: Threading SelfClient through the state transitions is the right callPassing
selfClientintosetupActorSubscriptions, and then through tovalidatingDocument,postProving, and_handleRegisterErrorOrFailuremakes the state machine deterministic with respect to its data source. This removes hidden dependencies on globals/singletons. Nicely done.Also applies to: 225-225, 237-237, 245-245
425-441: Correctly sourcing registration check from SelfClient on failureUsing
hasAnyValidRegisteredDocument(selfClient)to decide the failure navigation path ensures we consult the single source of truth (the client-backed catalog). The try/catch fallbacks are appropriate.
934-946: Chaining DSC -> Register via selfClient-aware init is correctRe-entering the state machine with
init(selfClient, 'register', true)after DSC proving ensures the environment is correctly reset and the client remains threaded through the flow. This matches the intended two-step verification path.
691-785: SelfClient param is unused in validatingDocument (intentional for now, but keep it short-lived)
validatingDocument(selfClient)doesn’t useselfClientyet. Given the migration in flight, that’s fine short-term. Ensure follow-up work moves the relevant checks (where appropriate) onto the client or explicitly document why they must remain on-chain/local.Would you like me to identify which validations can rely on the new
SelfClientdocument APIs vs. which must remain chain-based (e.g.,isDocumentNullified) and draft a migration plan?
636-656: Migrate to SelfClient’s DocumentAdapter & JIT Secret Loading• In app/src/utils/proving/provingMachine.ts (lines 636–656), stop calling the legacy loadSelectedDocument() and instead:
– Retrieve the “selected document” identifier from your SelfClient store (e.g. via useSelfAppStore.getState().selectedDocumentId).
– Call selfClientDocumentsAdapter.loadDocumentById(selectedId).
– If that returns null, log a warning and fallback to loadSelectedDocument() for now.
• Remove the init-time secret fetch (unsafe_getPrivateKey()at line 649) and the upfrontsecretstorage:
– Drop the error block around the legacy secret load.
– Stop settingsecretin your protocol store (set({ passportData, secret, env })→set({ passportData, env })).
• Fetch the private key just-in-time inside _generatePayload() for each flow (register/disclose), then immediately discard it:// provingMachine.ts – init hunk - const selectedDocument = await loadSelectedDocument(); + const selectedId = useSelfAppStore.getState().selectedDocumentId; + let selectedDocument = await selfClientDocumentsAdapter.loadDocumentById(selectedId); + if (!selectedDocument) { + console.warn('Falling back to legacy document provider'); + selectedDocument = await loadSelectedDocument(); + } // … - const secret = await unsafe_getPrivateKey(); - if (!secret) { /* error handling */ } // … - set({ passportData, secret, env }); + set({ passportData, env }); // secret will be loaded in _generatePayload()• Drop the
secretprecondition from startProving() — it should only guard against missing WebSocket/sharedKey/passportData/uuid.Next steps:
- Confirm how the SelfClient catalog surfaces the “selected document” (ID, primary-flag, path), or point me to any helper you’ve already wired.
- I can then replace
loadSelectedDocument()with the SelfClient adapter and remove the legacy fallback once coverage is complete.
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/mobile-sdk-alpha/src/validation/document.ts (1)
120-140: Validation returns true when DG1 hash is missing/empty.This allows unverified data to pass validation, weakening integrity guarantees. If DG1 is your minimal integrity check, the function must fail when
dg1Hashis absent.Apply this fix:
} else { onDg1HashMissing?.(passportData); - } + return false; + }
♻️ Duplicate comments (1)
packages/mobile-sdk-alpha/src/documents/utils.ts (1)
41-52: Remove console logging; emit structured errors to avoid PII leakageConsole logs in SDK helpers risk leaking user data and are hard to aggregate. Emit an error event instead and keep user consoles clean. This was requested previously.
Apply:
-export const hasAnyValidRegisteredDocument = async (client: SelfClient): Promise<boolean> => { - console.log('Checking if there are any valid registered documents'); - - try { - const catalog = await client.loadDocumentCatalog(); - - return catalog.documents.some(doc => doc.isRegistered === true); - } catch (error) { - console.error('Error loading document catalog:', error); - return false; - } -}; +export const hasAnyValidRegisteredDocument = async (client: SelfClient): Promise<boolean> => { + try { + const catalog = await client.loadDocumentCatalog(); + return catalog.documents.some(doc => doc.isRegistered === true); + } catch (error) { + client.emit?.('error', Object.assign(new Error('SELF_DOC_CATALOG_LOAD_FAILED'), { cause: error })); + return false; + } +};
🧹 Nitpick comments (3)
packages/mobile-sdk-alpha/src/validation/document.ts (1)
131-135: Avoid unconditional console.error in an SDK: gate logs or surface via a callback.Uncontrolled logging in production can leak sensitive details and add noise. Prefer dev-only logging and/or a callback so the app controls telemetry.
Minimal change (dev-only logging):
- console.error('Error calculating DG1 hash:', e); + if (typeof __DEV__ !== 'undefined' && __DEV__) { + // eslint-disable-next-line no-console + console.error('Error calculating DG1 hash:', e); + }Optionally, expose a callback to let hosts handle the error:
export interface PassportValidationCallbacks { /** DG1 hash missing or empty; nothing to validate against. */ onDg1HashMissing?: (data: PassportData) => void; + /** DG1 hash calculation failed. */ + onDg1HashCalculationError?: (error: unknown, data: PassportData) => void; } // ... } catch (e) { - // Log the error or handle it appropriately - console.error('Error calculating DG1 hash:', e); + callbacks.onDg1HashCalculationError?.(e, passportData); + if (typeof __DEV__ !== 'undefined' && __DEV__) { + // eslint-disable-next-line no-console + console.error('Error calculating DG1 hash:', e); + } return false; }packages/mobile-sdk-alpha/tests/client.test.ts (2)
43-46: Add tests asserting delegation for loadDocumentCatalog/loadDocumentByIdSince these APIs were added to SelfClient, add targeted tests to ensure delegation and error propagation to the
documentsadapter.Apply:
@@ it('creates client successfully with all required adapters', () => { const client = createSelfClient({ config: {}, adapters: { scanner, network, crypto, documents } }); expect(client).toBeTruthy(); }); + it('delegates loadDocumentCatalog to documents adapter', async () => { + const loadDocumentCatalog = vi.fn().mockResolvedValue({ documents: [] }); + const client = createSelfClient({ + config: {}, + adapters: { scanner, network, crypto, documents: { ...documents, loadDocumentCatalog } }, + }); + await expect(client.loadDocumentCatalog()).resolves.toEqual({ documents: [] }); + expect(loadDocumentCatalog).toHaveBeenCalledTimes(1); + }); + + it('delegates and propagates errors for loadDocumentById', async () => { + const err = new Error('boom'); + const loadDocumentById = vi.fn().mockRejectedValue(err); + const client = createSelfClient({ + config: {}, + adapters: { scanner, network, crypto, documents: { ...documents, loadDocumentById } }, + }); + await expect(client.loadDocumentById('doc-1')).rejects.toBe(err); + expect(loadDocumentById).toHaveBeenCalledWith('doc-1'); + });
81-98: Avoid monkey-patching built-ins in tests; use vi.spyOn with proper restoreDirectly replacing
Map.prototype.setrisks bleed-through if the test throws mid-execution. Prefervi.spyOn(...).mockImplementation(...);andmockRestore()in finally to guarantee restoration.Apply:
- const cb = vi.fn(); - const originalSet = Map.prototype.set; - let eventSet: Set<(p: any) => void> | undefined; - Map.prototype.set = function (key: any, value: any) { - if (key === 'progress') eventSet = value; - return originalSet.call(this, key, value); - }; - const unsub = client.on('progress', cb); - Map.prototype.set = originalSet; + const cb = vi.fn(); + let eventSet: Set<(p: any) => void> | undefined; + const spy = vi.spyOn(Map.prototype, 'set').mockImplementation(function (this: Map<any, any>, key: any, value: any) { + if (key === 'progress') eventSet = value as any; + // @ts-expect-error - call original + return Map.prototype.set.wrappedMethod ? (Map.prototype.set as any).wrappedMethod.call(this, key, value) : (spy.getMockImplementation() as any)(key, value); + }); + try { + const unsub = client.on('progress', cb); + eventSet?.forEach(fn => fn({ step: 'one' })); + expect(cb).toHaveBeenCalledWith({ step: 'one' }); + unsub(); + eventSet?.forEach(fn => fn({ step: 'two' })); + expect(cb).toHaveBeenCalledTimes(1); + } finally { + spy.mockRestore(); + }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (17)
app/src/providers/selfClientProvider.tsx(2 hunks)app/src/screens/aesop/PassportOnboardingScreen.tsx(3 hunks)app/src/screens/passport/PassportCameraScreen.tsx(3 hunks)app/src/screens/passport/PassportNFCScanScreen.tsx(3 hunks)app/src/screens/passport/PassportNFCScanScreen.web.tsx(3 hunks)app/src/screens/passport/UnsupportedPassportScreen.tsx(3 hunks)app/src/screens/prove/ConfirmBelongingScreen.tsx(2 hunks)app/src/screens/prove/ProveScreen.tsx(2 hunks)app/src/screens/settings/ManageDocumentsScreen.tsx(1 hunks)app/src/utils/proving/provingMachine.ts(12 hunks)app/src/utils/proving/validateDocument.ts(2 hunks)packages/mobile-sdk-alpha/src/client.ts(3 hunks)packages/mobile-sdk-alpha/src/documents/utils.ts(1 hunks)packages/mobile-sdk-alpha/src/index.ts(3 hunks)packages/mobile-sdk-alpha/src/types/public.ts(4 hunks)packages/mobile-sdk-alpha/src/validation/document.ts(1 hunks)packages/mobile-sdk-alpha/tests/client.test.ts(7 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
- app/src/screens/passport/PassportNFCScanScreen.web.tsx
- packages/mobile-sdk-alpha/src/client.ts
- app/src/screens/settings/ManageDocumentsScreen.tsx
- packages/mobile-sdk-alpha/src/index.ts
- app/src/screens/prove/ProveScreen.tsx
- app/src/screens/aesop/PassportOnboardingScreen.tsx
- app/src/screens/prove/ConfirmBelongingScreen.tsx
- app/src/providers/selfClientProvider.tsx
- app/src/utils/proving/validateDocument.ts
- app/src/screens/passport/PassportCameraScreen.tsx
- app/src/screens/passport/UnsupportedPassportScreen.tsx
- app/src/utils/proving/provingMachine.ts
- app/src/screens/passport/PassportNFCScanScreen.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/technical-specification.mdc)
**/*.{ts,tsx}: Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Files:
packages/mobile-sdk-alpha/src/documents/utils.tspackages/mobile-sdk-alpha/src/validation/document.tspackages/mobile-sdk-alpha/tests/client.test.tspackages/mobile-sdk-alpha/src/types/public.ts
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
packages/mobile-sdk-alpha/**/*.{ts,tsx,js,jsx}: Review alpha mobile SDK code for:
- API consistency with core SDK
- Platform-neutral abstractions
- Performance considerations
- Clear experimental notes or TODOs
Files:
packages/mobile-sdk-alpha/src/documents/utils.tspackages/mobile-sdk-alpha/src/validation/document.tspackages/mobile-sdk-alpha/tests/client.test.tspackages/mobile-sdk-alpha/src/types/public.ts
packages/mobile-sdk-alpha/src/validation/**
📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)
Place document validation logic in packages/mobile-sdk-alpha/src/validation/
Files:
packages/mobile-sdk-alpha/src/validation/document.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:
packages/mobile-sdk-alpha/tests/client.test.ts
🧠 Learnings (8)
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to packages/mobile-sdk-alpha/src/index.ts : Re-export new SDK modules via packages/mobile-sdk-alpha/src/index.ts
Applied to files:
packages/mobile-sdk-alpha/src/documents/utils.tspackages/mobile-sdk-alpha/src/validation/document.tspackages/mobile-sdk-alpha/src/types/public.ts
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to packages/mobile-sdk-alpha/README.md : Document new/updated SDK modules and usage in packages/mobile-sdk-alpha/README.md
Applied to files:
packages/mobile-sdk-alpha/src/documents/utils.ts
📚 Learning: 2025-08-24T18:54:04.799Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.799Z
Learning: Applies to packages/mobile-sdk-alpha/src/validation/** : Place document validation logic in packages/mobile-sdk-alpha/src/validation/
Applied to files:
packages/mobile-sdk-alpha/src/validation/document.ts
📚 Learning: 2025-08-25T14:25:57.541Z
Learnt from: aaronmgdr
PR: selfxyz/self#951
File: app/src/providers/authProvider.web.tsx:17-18
Timestamp: 2025-08-25T14:25:57.541Z
Learning: The selfxyz/mobile-sdk-alpha/constants/analytics import path is properly configured with SDK exports, Metro aliases, and TypeScript resolution. Import changes from @/consts/analytics to this path are part of valid analytics migration, not TypeScript resolution issues.
Applied to files:
packages/mobile-sdk-alpha/src/validation/document.ts
📚 Learning: 2025-08-24T18:55:07.911Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/technical-specification.mdc:0-0
Timestamp: 2025-08-24T18:55:07.911Z
Learning: Applies to **/*.{ts,tsx} : Define VerificationConfig with fields: circuitVersion (semver), complianceRules array, timeWindow (seconds, 24h), clockDrift (±5 min), trustAnchors, revocationRoots, timeSource (NTP), nullifierScope (domain separation)
Applied to files:
packages/mobile-sdk-alpha/src/types/public.ts
📚 Learning: 2025-08-24T18:55:07.911Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/technical-specification.mdc:0-0
Timestamp: 2025-08-24T18:55:07.911Z
Learning: Applies to **/*.{ts,tsx} : Define IdentityCommitment with fields: commitment (Poseidon hash), nullifier (domain-separated), timestamp (UTC number), version (circuit version), documentType ('passport' | 'eu_id_card')
Applied to files:
packages/mobile-sdk-alpha/src/types/public.ts
📚 Learning: 2025-08-24T18:55:07.911Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/technical-specification.mdc:0-0
Timestamp: 2025-08-24T18:55:07.911Z
Learning: Applies to **/*.{ts,tsx} : Define DSCKeyCommitment with fields: publicKeyHash (Poseidon hash), certificateChain (hashes), revocationStatus (boolean), issuer (country code)
Applied to files:
packages/mobile-sdk-alpha/src/types/public.ts
📚 Learning: 2025-08-24T18:52:25.765Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-08-24T18:52:25.765Z
Learning: Applies to contracts/contracts/IdentityVerificationHubImplV2.sol : Identity Verification Hub: manage multi-step verification for passports and EU ID cards, handle document attestation via ZK proofs, and implement E-PASSPORT and EU_ID_CARD paths in IdentityVerificationHubImplV2.sol
Applied to files:
packages/mobile-sdk-alpha/src/types/public.ts
🧬 Code graph analysis (3)
packages/mobile-sdk-alpha/src/documents/utils.ts (1)
packages/mobile-sdk-alpha/src/types/public.ts (1)
SelfClient(159-179)
packages/mobile-sdk-alpha/tests/client.test.ts (2)
packages/mobile-sdk-alpha/src/client.ts (1)
createSelfClient(59-150)packages/mobile-sdk-alpha/src/types/public.ts (1)
DocumentsAdapter(154-157)
packages/mobile-sdk-alpha/src/types/public.ts (2)
common/src/utils/types.ts (2)
DocumentCatalog(8-11)PassportData(28-43)app/src/utils/nfcScanner.ts (1)
response(187-262)
⏰ 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). (4)
- GitHub Check: run_circuit_tests
- GitHub Check: e2e-ios
- GitHub Check: analyze-android
- GitHub Check: analyze-ios
🔇 Additional comments (11)
packages/mobile-sdk-alpha/src/validation/document.ts (2)
7-7: Type-only import migration looks correct and risk-free for runtime.Good move to shared types and using
import typeto avoid bundling runtime code. This aligns with the centralization effort and keeps the mobile SDK surface stable.
85-114: No changes needed: eContent/signedAttr metadata enforcement is intentional
The presence checks and algorithm validation foreContentHashFunctionandsignedAttrHashFunctioninisPassportDataValidguard downstream hashing and signature steps (e.g. invalidateDocument.tsand proving circuits). Dropping the early returns here would allow missing metadata to propagate into core security routines, breaking existing tests and weakening integrity guarantees.
– Tested behavior indocument.test.tsconfirms that missing or unsupported eContent/signedAttr algorithms must fail early.
– Downstream code relies on these fields to compute and verify hashes and nullifiers.Likely an incorrect or invalid review comment.
packages/mobile-sdk-alpha/tests/client.test.ts (5)
13-22: Good: creation fails fast when scanner is missingThe expectation and error message align with the client’s required adapters validation.
25-35: Good: network/crypto missing adapter checks are coveredThese tests help guard required-surface regressions.
37-41: Good: documents adapter is now mandatory and testedCovers the newly required adapter and validates error message.
48-57: Core client behaviors covered wellScan success/failure, stub proof handle, MRZ parsing, stub registration, and analytics routing tests look solid and aligned with the current implementation.
Also applies to: 59-67, 69-79, 100-106, 108-114, 120-127
153-156: Minimal documents adapter stub is appropriate for testsGood: returns simple, deterministic values to satisfy type usage without introducing flaky IO.
packages/mobile-sdk-alpha/src/types/public.ts (4)
95-96: Adapters now include documents: required per client usageGood: keeping
documentson the required adapters surface aligns withcreateSelfClientvalidation.
154-157: DocumentsAdapter shape LGTMInterface matches the client’s delegation surface and shared types.
177-179: SelfClient adds document-loading APIs; consistent with adapterSurface looks correct and maintains single-responsibility by delegating to the adapter.
5-5: Re-export not possible—core types missing or incompleteThe suggested diff can’t be applied as-is because:
- IdentityCommitment and DSCKeyCommitment are not defined in
@selfxyz/core/src/types/types.ts.- VerificationConfig exists but only includes
{ minimumAge?, excludedCountries?, ofac? }, which doesn’t match the spec’s required fields (circuitVersion,complianceRules,timeWindow,clockDrift,trustAnchors,revocationRoots,timeSource,nullifierScope)【analysis†head】.Next steps:
- Define
IdentityCommitment(withcommitment,nullifier,timestamp,version,documentType).- Define
DSCKeyCommitment(withpublicKeyHash,certificateChain,revocationStatus,issuer).- Extend
VerificationConfigper spec (add missing fields).- Then add the re-export in
packages/mobile-sdk-alpha/src/types/public.ts.Likely an incorrect or invalid review comment.
* SDK Go version (#920) * feat: helper functions and constant for go-sdk * feat: formatRevealedDataPacked in go * chore: refactor * feat: define struct for selfBackendVerifier * feat: verify function for selfBackendVerifier * feat(wip): custom hasher * feat: SelfVerifierBacked in go * test(wip): scope and userContextHash is failing * test: zk proof verified * fix: MockConfigStore getactionId function * chore: refactor * chore: remove abi duplicate files * chore: move configStore to utils * chore: modified VcAndDiscloseProof struct * chore: more review changes * feat: impl DefaultConfig and InMemoryConfigStore * chore: refactor and export functions * fix: module import and README * chore: remove example folder * chore: remove pointers from VerificationConfig * chore: coderabbit review fixes * chore: more coderabbit review fix * chore: add license * fix: convert attestationIdd to int * chore: remove duplicate code --------- Co-authored-by: ayman <[email protected]> * Moving proving Utils to common (#935) * remove react dom * moves proving utils to the common * need to use rn components * fix imports * add proving-utils and dedeuplicate entry configs for esm and cjs. * must wrap in text component * fix metro bundling * fix mock import * fix builds and tests * please save me * solution? * fix test * Move proving inputs to the common package (#937) * create ofactTree type to share * move proving inputs from app to register inputs in common * missed reexport * ok * add some validations as suggested by our ai overlords * Fix mock passport flow (#942) * fix dev screens * add hint * rename * fix path * fix mobile-ci path * fix: extractMRZ (#938) * fix: extractMRZ * yarn nice && yarn types * fix test: remove unused * fix mobile ci * add script --------- Co-authored-by: Justin Hernandez <[email protected]> * Move Proving attest and cose (#950) * moved attest and cose utils to common with cursor converted tests in common to use vitest and converted coseVerify.test to vitest after moving from app to common what does cryptoLoader do? * moved away * get buff Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * SELF-253 feat: add user email feedback (#889) * feat: add sentry feedback * add sentry feedback to web * feat: add custom feedback modal & fix freeze on IOS * yarn nice * update lock * feat: show feedback widget on NFC scan issues (#948) * feat: show feedback widget on NFC scan issues * fix ref * clean up * fix report issue screen * abstract send user feedback email logic * fixes * change text to Report Issue * sanitize email and track event messge * remove unnecessary sanitization * add sanitize error message tests * fix tests * save wip. almost done * fix screen test * fix screen test * remove non working test --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> * chore: centralize license header checks (#952) * chore: centralize license header scripts * chore: run license header checks from root * add header to other files * add header to bundle * add migration script and update check license headers * convert license to mobile sdk * migrate license headers * remove headers from common; convert remaining * fix headers * add license header checks * update unsupported passport screen (#953) * update unsupported passport screen * yarn nice * Migrate Analytics (#951) * setup analytics adapter for self mobile sdk client and use in app * wrap for context * fix build * yarn types is an alias for build when build just compiles ts * ok unlock * deeper * ok this looks to work * fix license check * make sure it starts with this line * someone didnt commit * fix double analytics bug and builds * lint * Read document catalog from selfClient (#936) * [SELF-676] feat: upgrade React Native from 0.75.4 to 0.76.9 (#943) * chore: upgrade build tooling to Node 22 and AGP 8.6 * chore: upgrade react-native to 0.76.9 * update lock files and formatting * fix path * fix: handle hermes-engine cache mismatch in CI after React Native upgrade - Add fallback logic to run 'pod update hermes-engine' when pod install fails - This resolves CocoaPods cache issues that occur after React Native version upgrades - Fixes CI pipeline failures on codex/update-core-tooling-for-react-native-upgrade branch * fix: improve hermes-engine cache handling in CI - Preemptively clear CocoaPods cache before pod install - This prevents dependency analysis failures that occur when cached podspecs conflict - Addresses the root cause: cache conflicts during 'Analyzing dependencies' phase - Keeps fallback logic for additional safety * fix: handle hermes-engine cache in mobile-bundle-analysis workflow - Add pod-install-with-cache-fix.sh script to handle hermes-engine cache conflicts - Update install-app:setup script to use the new cache fix approach - This fixes the mobile-bundle-analysis.yml workflow failures after React Native upgrade - Proactively clears CocoaPods cache and has fallback for hermes-engine updates * formatting * fix: robust hermes-engine cache handling in CI workflows - Apply comprehensive cache clearing to mobile-ci.yml and mobile-e2e.yml - Pre-emptively run 'pod update hermes-engine' before pod install - Clear multiple cache locations to handle CI environment differences - This prevents 'hermes-engine differs from Pods/Local Podspecs' errors - Fixes all workflows affected by React Native 0.76.9 upgrade cache issues * fixes * clean up * update lock files * fix tests * sort * fixes * fix ci * fix deployment target * android fixes * upgrade fix * fixes * fix: streamline mobile CI build and caching (#946) * fix: streamline mobile CI build and caching * Enable mobile E2E tests on codex/fix-mobile-ci-workflow-errors branch * test * simplify and fix path * workflow fixes * fix loading on 0.76.9 * clean up unnecessary comments * fix readme * finalize upgrade to 0.76.9 * fix android build and upgrade * fix bundler caching * download cli to fix "yarn start" issues * fix cli build erorr * fix script path * better path * abstract build step to prevent race condition * fixes * better cache * fix corepack build error * update lock * update lock * add yarn cache to workflows * fix test building * ci caching improvements * fix common type check * fix common ci * better mobile sdk alpha building logic * chore: speed up mobile e2e workflow (#962) * chore: speed up mobile e2e workflow * chore: disable android e2e job * chore: speed up ios build * fix: bundle js for ios debug build * fix e2e * fix mobile ci (#964) * feat: improve mixpanel flush strategy (#960) * feat: improve mixpanel flush strategy * fixes * fix build * update lock * refactor methods * conslidate calls * update package and lock * refactor: remove namespace imports (#969) * refactor: remove namespace imports * refactor: use named fs imports * refactor(app): replace path and fs namespace imports * format * format * Mixpanel tweaks (#971) * udpates * fox * update license * Add DSC parsing check (#836) * Handle missing dsc parsed * nice * fix test * throw * fix * chore(app): upgrade dependencies (#968) * chore(app): upgrade dependencies * update package * update lock files * fixes * lock * fix * Auth Adapter + (#958) * basic auth adapater * remove SelfMobileSDk, this was another architecture which the adapter patern replaced * rename to avoid confusion with client.test.ts * basic auth adapater * remove SelfMobileSDk, this was another architecture which the adapter patern replaced * rename to avoid confusion with client.test.ts * self * fix * remove prototypes * make sure its mounted * fix tests * fmt * require required adapters * fix types * not a partial * adds missing exports * fix missing data * Fix nfc configuration scanning issue (#978) * fix nfc scanning on ios and android * save test * fix tests * fix lint * Chore fix ios nfc scanning and compiling (#979) * fixes * silence error * fix debugge * fix nfc scanning * lint and pipeline fixes * large runner (#980) * chore: update to macos latest large runner (#981) * bump up to macos-latest-large * fix ci * Move loadSelectedDocument to SDK (#967) Co-authored-by: Aaron DeRuvo <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * docs: update mobile SDK migration progress (#982) * docs: record app integration progress * docs: consolidate mobile SDK migration tracking * docs: humanize migration tracking and merge prompts * docs: add common consolidation tasks * docs: reprioritize migration tasks * docs: soften migration plan tone * docs: detail agent prompts with file paths * docs: catalog Linear tasks for SDK * updates * remove artifact management * moves validateDocument functions into the common package. (#977) * moves validateDocument functions into the common package. * fix build issues and lint * handle bad connections better in nullifiier * add an abort controler to nullifer fetcher, ignore fals positives * import types separately * take it as an arg * chore: update yarn.lock * chore(app): resolve lint warnings (#990) * chore(app): resolve lint warnings * update lock * clean up any types * fix types * feedback from cr * [SELF-703] feat: Migrate mock generator to mobile sdk (#992) * feat: expose mock generator * formatting * fix tests and lint * rename passport to document * fix types * [SELF-698] scaffold mobile sdk demo app (#993) * chore: scaffold mobile sdk demo app * test: cover demo app menu * prettier and types * sort * add android app foundation * fix android loading * get ios app running * update script * cr feedback * disable fabric * fixes * fixes * fix * SELF-702: Refactor navigation structure and dev utilities (#994) * Refactor navigation and dev screens * refactor: rename passport screens to document * fixes * add missing header * fixes * type files * feat: clarify proof verification analytics (#996) * feat: increase sha256 byte size and add new rsa circuits (#986) * feat: increase sha256 byte size and add new rsa circuits * feat: modularise the rsa fp pow mod * chore: comment signature verifier for testing * fix: sha256_sha256_sha224_ecdsa_secp224r1 * lint * chore: implement google play suggestions (#997) * google play suggestions * update gitguardian ignore * remove unused * chore: address yarn lock issues (#1004) * address yarn lock issues * fix postinstall * skip postinstall for ci (#1005) * [SELF-654] feat: add native modules (#919) * feat: add ios native modules * fix: extractMRZ * Add android OCR native module * wire native mrz module with adapter * wire Native modules and fix tests * fixes * fix license header logic * fix tests * fix types * fix: ci test * fix: android build ci * fix: ios build CI * add podfile.lock * add yarn.lock * update lock files * add yarn.lock * add license * order methods * update lock * pipeline fixes * prettier * update lock file * fix native modules on external apps * bundle @selfxyz/common into mobile-sdk-alpha * chore: address yarn lock issues (#1004) * address yarn lock issues * fix postinstall * update lock * fix build issues * fix pipeline issue * fix ci * fix bad merge * fix android ci * fix ci errors * fix mobile sdk ci. stop gap fix for now until we create a package * tweaks * retry aapt2 approach * use ^0.8.4 instead of ^0.8.0 due to the use of custom errors * workflow fixes * fix file * update * fix ci * test ci fix * fix test --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> * chore: update dev with staging 09/06/25 (#1007) * update CI * bump iOS version * update readme * update mobile-deploy ci * bump version iOS * update workflow to use workload identity federation (#933) * update workflow to use workload identity federation * add token permissions * correct provider name * chore: incrementing android build version for version 2.6.4 [github action] --------- Co-authored-by: Self GitHub Actions <[email protected]> * update ci * update ci * update ci * update ci * update ci * fix ci * fix ci * fix ci * remove fastlane use for android * bump iOS build version * update CI python script * iterate on CI * iterate on CI * iterate on CI * Dev (#941) * SDK Go version (#920) * feat: helper functions and constant for go-sdk * feat: formatRevealedDataPacked in go * chore: refactor * feat: define struct for selfBackendVerifier * feat: verify function for selfBackendVerifier * feat(wip): custom hasher * feat: SelfVerifierBacked in go * test(wip): scope and userContextHash is failing * test: zk proof verified * fix: MockConfigStore getactionId function * chore: refactor * chore: remove abi duplicate files * chore: move configStore to utils * chore: modified VcAndDiscloseProof struct * chore: more review changes * feat: impl DefaultConfig and InMemoryConfigStore * chore: refactor and export functions * fix: module import and README * chore: remove example folder * chore: remove pointers from VerificationConfig * chore: coderabbit review fixes * chore: more coderabbit review fix * chore: add license * fix: convert attestationIdd to int * chore: remove duplicate code --------- Co-authored-by: ayman <[email protected]> * Moving proving Utils to common (#935) * remove react dom * moves proving utils to the common * need to use rn components * fix imports * add proving-utils and dedeuplicate entry configs for esm and cjs. * must wrap in text component * fix metro bundling * fix mock import * fix builds and tests * please save me * solution? * fix test * Move proving inputs to the common package (#937) * create ofactTree type to share * move proving inputs from app to register inputs in common * missed reexport * ok * add some validations as suggested by our ai overlords * Fix mock passport flow (#942) * fix dev screens * add hint * rename * fix path * fix mobile-ci path * fix: extractMRZ (#938) * fix: extractMRZ * yarn nice && yarn types * fix test: remove unused * fix mobile ci * add script --------- Co-authored-by: Justin Hernandez <[email protected]> * Move Proving attest and cose (#950) * moved attest and cose utils to common with cursor converted tests in common to use vitest and converted coseVerify.test to vitest after moving from app to common what does cryptoLoader do? * moved away * get buff Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * SELF-253 feat: add user email feedback (#889) * feat: add sentry feedback * add sentry feedback to web * feat: add custom feedback modal & fix freeze on IOS * yarn nice * update lock * feat: show feedback widget on NFC scan issues (#948) * feat: show feedback widget on NFC scan issues * fix ref * clean up * fix report issue screen * abstract send user feedback email logic * fixes * change text to Report Issue * sanitize email and track event messge * remove unnecessary sanitization * add sanitize error message tests * fix tests * save wip. almost done * fix screen test * fix screen test * remove non working test --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> * chore: centralize license header checks (#952) * chore: centralize license header scripts * chore: run license header checks from root * add header to other files * add header to bundle * add migration script and update check license headers * convert license to mobile sdk * migrate license headers * remove headers from common; convert remaining * fix headers * add license header checks * update unsupported passport screen (#953) * update unsupported passport screen * yarn nice --------- Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: ayman <[email protected]> Co-authored-by: Aaron DeRuvo <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * bump version * bump yarn.lock * update ci (#966) * chore: Manually bump and release v2.6.4 (#961) * update lock files * bump and build android * update build artifacts * show generate mock document button * update lock * fix formatting and update failing e2e test * revert podfile * fixes * fix cold start of the app with deeplink * update ci * update ci * Sync MARKETING_VERSION to iOS project files after version bump * chore: incrementing android build version for version 2.6.4 [github action] (#976) Co-authored-by: remicolin <[email protected]> * chore: add build dependencies step for iOS and Android in mobile deploy workflow * chore: enhance mobile deploy workflow by adding CMake installation step * bump android build version * chore: incrementing android build version for version 2.6.4 [github action] (#985) Co-authored-by: remicolin <[email protected]> * chore: configure Metro bundler for production compatibility in mobile deploy workflow * chore: incrementing android build version for version 2.6.4 [github action] (#987) Co-authored-by: remicolin <[email protected]> * Revert "chore: configure Metro bundler for production compatibility in mobile deploy workflow" This reverts commit 60fc1f2580c2f6ad3105d8b904d969412a18bd2e. * reduce max old space size in mobile-deploy ci * fix android french id card (#957) * fix android french id card * fix common ci cache * feat: log apdu (#988) --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> * unblock ci * fix merge * merge fixes * fix tests * make ci happy --------- Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: pputman-clabs <[email protected]> Co-authored-by: Self GitHub Actions <[email protected]> Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: Vishalkulkarni45 <[email protected]> Co-authored-by: ayman <[email protected]> Co-authored-by: Aaron DeRuvo <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: fix yarn format (#1009) * fix yarn format * yarn format * fix lint * undo temporary disabling * pipeline fixes * revert nvmrc change * add new home screen (#1019) * add new home screen * fix typing issue * yarn nice * chore: update the cpp build script (#1021) * chore: install node (#1022) * chore: use node v22 (#1023) * chore: install yarn (#1024) * chore: yarn cache (#1025) * chore: sanitise node version (#1026) * remove lazy loading (#1018) * remove lazy loading * fix tests * formatting * fix imports and web ci * fix tests * fix building * fix * debug ci * fix web ci issue * fix * fix * fix ci * remove web render test * coderabbit feedback * fix ci * use import * fix lint * fix compiling * update lock * update lock * fix: update yarn.lock hash for @selfxyz/mobile-sdk-alpha Resolves CI error where yarn install --immutable failed due to outdated package hash. The hash changed from b2afc4 to f9ebb9. * fix: update yarn.lock hash after mobile-sdk-alpha changes - Hash changed from c0e6b9 to 0d0f72 due to package modifications - Cleaned caches and regenerated lockfile to ensure consistency - This resolves CI cache mismatch where old artifacts had stale hash * fix: update yarn.lock hash after building mobile-sdk-alpha - Final hash: 89f5a6 (includes built dist artifacts) - Built mobile-sdk-alpha to ensure package is in stable state - This should resolve CI immutable install errors * fix yarn lock and build * chore(ci): improve mobile e2e caching (#1010) * chore(ci): improve mobile e2e caching * chore(ci): restore deriveddata cache * chore(ci): remove ios deriveddata cache * chore(ci): cache ios derived data * chore(ci): optimize mobile deploy caching * chore(ci): enable ccache for ios e2e builds * fix(ci): add ccache path for ios e2e * moves ofac and protocol store (#1012) * move ofact tree fetch to common * move protocol store to the msdk, fix some dependencies on msdk * chore: remove register id from register circuits (#1028) * chore: remove register id from register circuits * chore: only use 128ram instance * Feat/build cpp (#1029) * chore: remove register id from register circuits * chore: only use 128ram instance * chore: build 2 circuits at a time * Remove navigationRef from provingMachine (#1011) * SDK: minimize amount of data sent through PROVING_PASSPORT_NOT_SUPPORTED event (#1030) * Fix mock passport generation (#1031) * fix mock passport generation * fix mobile ci tests * Feat/aadhaar (#949) * make contract sdk simpler (#514) * make contract sdk simpler * reduce root inputs * delete convert function * summarize our library * update npm package * update package version * update attestation id * add util function to get revealed data * Revert "make contract sdk simpler (#514)" (#518) This reverts commit 847b88d5ecc0d449b976a552f68af38eec8e561b. * merge dev into main (#576) * Feat: Show error code in SDK (#500) * feat: emit `error_code` and `reason` in app * feat: add `onError` in sdk * feat: Display reason in app * lint & fmt * feat: add scrollview in ProofRequestStatusScreen for long reasons * Fix input generation for 521bit curves (#481) * fix EC point padding for 521 bit curves * rename modulus to point in findStartIndexEC as it is a point * simplify matching logic * simplify padding logic * remove comment * remove log removing .only so the CI/CD runs circuit tests fix disclosure test fix scope in test fix scope error in circuit tests remove .only fix test * run ci/cd * Feat/simpler contract sdk (#519) * make contract sdk simpler * reduce root inputs * delete convert function * summarize our library * update npm package * update package version * update attestation id * add util function to get revealed data --------- Co-authored-by: motemotech <[email protected]> * forgot to include package update (#521) * Bump version to 2.5.1 (#522) * bump version * update fastlane * fix bump version * bump build and add todo * disable commit for now * [SEL-154] Step 1: Scan your passport (#511) * simplify navigation logic * use aesop design hook * save wip * add new aesop redesign screens * save wip design * refactor nav bar logic * fix paths * save wip * stub progress navbar and save wip * save wip progress bar animation * save wip progress bar, almost done with design * fix progress bar design * fix bottom padding * disable git commit for now * fix flaky android downloads that causes pipeline to crash * update lock for ci * [SEL-46] FE: Add minimum bottom padding (#510) * fix bottom padding for smaller screens * fix podfile post install hook permissions check * update pod lock and disable git commit action step for now * update lock * fix flaky android downloads that causes pipeline to crash * fix: improve error handling for forbidden countries list mismatch (#494) * Update SelfBackendVerifier.ts * Update constants.ts * Update formatInputs.ts * Update formatCallData.ts * DX: Auto format on save (#526) * save wip * use elint instead of prettier to sort imports * set imports to warn * sync prettier settigns * update prettier settings * save working version * fix export and disable mobile pipeline for now * limit auto formatting to the app folder * remove artefacts * SEL-187: Make bottom layout scrollable on smaller screens (#525) * fix design check * add an option to disable local sending of sentry events * better sentry enable / disable * fix scan passport height * make bottom layout scrollable so it doesn't squish top screen * simpler logic check. don't create new env var * fix internet connection issues * readd comment * use isConnected instead of internet reachable * use a dynamic bottom panel height * add missing recovery screens * move aesop below * remove dupe export * fix rebase * fix android package download issue * Feat/extend id support (#517) * refactor proving impleting xstate, speedup proving * add disclosure proof support * keep refactoring provingMachine, clean old implementation * call init method when switching from dsc to register * rebase with dev to display why the proof verification failed * refactor ws connexion between front-end and mobile to retrieve self-app * update the webclient at proofVerification and use selfAppStore in provingMachine * fix provintStore.init in ProveScreen * yarn nice * fetch data correctly in splash screen * Bump build versions for 2.5.1 (#531) * release new builds * fix app and build versions * fix env check * display error animation on failure on loading screen (#532) * display error animation on failure on loading screen * remove log --------- Co-authored-by: Justin Hernandez <[email protected]> * ci: bump actions/checkout to v4 (#529) * make contract sdk simpler (#514) * make contract sdk simpler * reduce root inputs * delete convert function * summarize our library * update npm package * update package version * update attestation id * add util function to get revealed data * Revert "make contract sdk simpler (#514)" (#518) This reverts commit 847b88d5ecc0d449b976a552f68af38eec8e561b. * ci: bump actions/checkout to v4 --------- Co-authored-by: nicoshark <[email protected]> Co-authored-by: turnoffthiscomputer <[email protected]> * fix italy (#530) * Fix/proving machine endpoint type (#538) * store endpoint type in proving machine * yarn nice * fix splash screen error (#539) * New bug fix build for v2.5.1 (#540) * bump new build for dev fixes * update lock * reinstall before running local deploy * SEL-178: Improve haptic feedback library (#535) * fix dev settings typing * add dev screens file * save haptic feedback progress * change ordedr * fix initial route and add haptic feedback screen to dev settings options * add delete scripts (#542) * update staging registry address (#545) * feat: Add Disclose history (#533) * feat: Add Disclose history * fix: Duplicate history in list * fix: Outdated disclosures * Delete app/ios/Self copy-Info.plist * allow a scale of up to 1.3 (#546) * allow a scale of up to 1.3 * update lock files * clean up unused imports * fix settings * add common sdk (#537) * add common sdk * remove sdk backend api * remove registry * regenerate sha256 rsa dsc each time * download ski-pem dynamically on staging, refactor initpassportDataParsing * add state machine for button on prove screen, improve ux on splash screen * fetch ski-pem in production * fix linter issues * fix prove screen button bugs * update podfile.lock and yarn.lock * run linter in circuits repo * bump build * bump version for sentry debugging * bump ios to version 118 --------- Co-authored-by: Justin Hernandez <[email protected]> * better connection check (#548) * Clean up navigation and setup Jest (#549) * remove dupe account screens and prefer the term home * organize screen loading better * sort keys * rename screen files wip * fix deleted directory issues * rename folders * fix paths and naming * save working jest import test * save base working jest navigation test * finalize navigation refactor and jest test * update test name and podfile lock * remove unused packages * use the correct version of react test renderer * bump build (#552) * Eth dublin (#554) * add mock id card generator * add genMockIdDoc in common/sdk exports * onboard developer id using deeplink, allow custom birthdate on mockpassport * log more dsc info (#558) * Push notification (#536) * add push notification feature * merge new app impl * change dsc key * import * reverse mock dsc * worked in the ios * checked in android * update url and delete console * delete small changes * lint * add yarn.lock * fix warning message * add mock notification service for test code * fix path for the mock implementation * add mock deeplink to the test code * nice notificationServiceMock.js * delete unused firebase related implementation * fix wording and UI related to notification service * hotfix on mockdatascreen --------- Co-authored-by: turnoffthiscomputer <[email protected]> * Fix deeplink 2 (#560) * fix deeplink * fix deeplink * yarn nice * feat: Use vision for MRZ scanning (SEL-47) (#557) * feat: Use vision for MRZ scanning * modify label to position the smartphone during the OCR scan --------- Co-authored-by: turnoffthiscomputer <[email protected]> * SEL-255: improved loading screen with estimated wait times (#550) * create new loading screen and rename static to misc * fix route * save wip loading screen * save wip animation * save static wip design * continue * splash * add a loading screen text helper * add test for loading screen text * save wip. almost there * update haptic logic * better feedback and add dev scren * save current work * update text logic and tests * load passport metadata in loading screen * simplify and fix tests * test for additional exponents * add new animation * rename file * consolidate ui useEffect and fix loading screen layout * fix current state * remove mockPassportFlow param * merge new loading screen and new notification logic * simplify * update lock * use passportMetadata instead of metadata * save simplification * update loading text based on pr feedback and tests * Bump v2.5.1: ios 122; android 60 (#561) * increment build to 120 * bump builds for 2.5.1. ios 121; android 60 * clean up logic * upgrade react native firebase for privacy manifests * update react native keychain to fix could not recover issue (#564) * fix: update ocr corrections (#563) * Chore: Polish proof history to prep for release (#566) * clean up nav and home boundaries, passport data screen insets * migrate proof history screen out of settings * minor clean up * save wip * add new ibm plex mono font and clean up proof detail screen * remove test data * remove extra loading screen text * remove unnecessary ceil * Bump v2.5.1; ios 123; android 62 (#565) * bump to build 61 * bump ios version * update version * Feature/add prettier formatter (#568) * Add Prettier configuration and ignore files for code formatting - Created .prettierignore to exclude specific directories and files from formatting. - Added .prettierrc.yml with custom settings for print width and trailing commas. - Updated package.json to include Prettier and its Solidity plugin as dependencies, along with scripts for formatting and checking code. * Run prettier formatting * fix nationality using mock passports * SEL-181 & SEL-252: Update mobile app events (#570) * improve analytics handling * add error boundary that flushes segment events before error occurs * upgrade segment analytics package * flush analytics when user encounters error screen * track all click events * add tracking to loading screen * better init and click event names * track cloud backup and modal actions * use __DEV__ for debugging * add tracking to account recovery, auth, mock data * return false instead of throwing * add more tracking events * save wip event updating * abstract analytic event names * update click events * clean up * move reasons comment * add unsupported passport event * Feature/enhance self verification root (#569) * Add SelfVerificationConsumer contract for self-verification logic - Introduced an abstract contract, SelfVerificationConsumer, that extends SelfVerificationRoot. - Implemented nullifier tracking, verification success events, and customizable validation and update methods for nullifiers. - Added error handling for nullifier check failures and hooks for derived contracts to implement custom logic after successful verification. * Add SelfHappyBirthday contract example using SelfVerificationConsumer - Introduced SelfHappyBirthday contract that allows users to claim USDC on their birthday. - Integrated SelfVerificationConsumer for handling verification and nullifier tracking. - Added functions to set claimable amount and window, along with event emissions for state changes. - Implemented logic to check if the claim is within the user's birthday window and transfer USDC accordingly. * Refactor imports in HappyBirthday contract for better organization - Updated import statements in HappyBirthday.sol to use relative paths for ISelfVerificationRoot, SelfCircuitLibrary, and SelfVerificationConsumer. - Improved code readability and maintainability by organizing imports more logically. * Refactor Airdrop contract to use SelfVerificationConsumer for registration logic - Updated Airdrop contract to inherit from SelfVerificationConsumer instead of SelfVerificationRoot. - Refactored mappings for user identifiers and nullifiers for improved clarity and functionality. - Enhanced error handling and updated function parameters for consistency. - Implemented new validation and update methods for nullifiers, streamlining the registration process. - Removed deprecated verifySelfProof function and integrated logic into new methods. * Add events and refactor SelfVerificationRoot and related contracts - Introduced new events in SelfVerificationRoot for verification configuration updates, scope changes, and attestation ID management. - Updated Airdrop contract to remove deprecated events and added a new event for Merkle root updates. - Refactored SelfPassportERC721 to inherit from SelfVerificationConsumer, enhancing verification logic and event handling. - Improved function parameters for consistency and clarity across contracts. * Refactor contracts to use SelfVerificationRoot and enhance verification logic - Removed SelfVerificationConsumer contract and updated related contracts to inherit from SelfVerificationRoot. - Refactored mappings and event emissions in Airdrop, HappyBirthday, and SelfPassportERC721 for improved clarity and functionality. - Enhanced verification success hooks to include user identifiers and nullifiers for better tracking. - Updated constructor parameters for consistency across contracts and improved error handling for user registration and claims. * Refactor constructor in SelfPassportERC721 for improved readability * Refactor function parameters in SelfVerificationRoot and related contracts * Refactor constructor parameter names in IdentityVerificationHub, Airdrop, IdentityRegistry, and ProxyRoot contracts for improved clarity and consistency * fix getCircuitName function (#575) * fix getCircuitName function * fix getCircuitName function * feat: Read ID cards (#571) * Update GitHub checkout action from v3 to v4 (#544) * Bump build version 2.5.2 to test react native keychain (#572) * bump build and version * bump version 2.5.2 * don't downgrade react native keychain * update app/README.md toolchain instructions (#140) * bump build (#580) --------- Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: turboblitz <[email protected]> Co-authored-by: motemotech <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: crStiv <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: James Niken <[email protected]> Co-authored-by: Kevin Lin <[email protected]> Co-authored-by: leopardracer <[email protected]> Co-authored-by: Olof Andersson <[email protected]> * feat(wip): register circuit for aadhaar * chore: add anon aadhar circuits * chore: remove sc and disclose selfrica test * feat: extract aadhaar qr data * test: aadhaar qr data extract circuit * test: aadhaar register circuit * feat: extract pincode and ph no last 4 digit * fix: register aadhaar nullifier and commitment * test: Verify commitment circuit of aadhaar * feat: add photoHash inside commitment * feat: build Aadhaar OFAC SMT * feat: ofac check and reveal data (test done) * test: qr extractor for custom data input * feat: add state as reveal data inside VC and disclose * chore: add comments * fix: num2Ceil component * chore: review changes * chore: use passport SignatureVerifier * fix: signatureVerifier inputs * feat: extract ascii values of fields * feat: provide users the flexibility to reveal specific characters of a field * chore: refactor * test: register aadhaar for tampered data * test(wip): should return 0 if in ofac list * test: ofac check * test: register aadhaar circuit for different qr data * merge dev into main (#683) * 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) * 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 --------- 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]> * fix: commitment hash * fix: register aadhaar test * chore: refactor * feat: reveal data in packed bytes * feat: add constrain on delimiterIndices * feat: reveal timestamp * merge main to feat/aadhaar * fix: tests * feat: hash pubKey * feat: add registry contract * feat: Update HubImplV2 (WIP) * add functions to generate aadhaar data (WIP) * modularize aadhaar data generation (WIP) * fix(wip): register test * fix: test qr extractor * fix * chore: refactor functions * feat: add age extractor and tested * feat: add isMiniumAge check * fix: prepareAadhaarTestData func * registry contract tests * feat: registry contract tests * feat: extract fields from qr data bytes * chore: refactor mockData * feat: move minimum age to revealPackedData * feat: create a constant.ts to retrive fields from unpacked bytes * chore: refactor * fix: exports * rebase * rebase * feat: add public signal ,indices mapping * chore: add public output to indices mapping * fix:AADHAAR_PUBLIC_SIGNAL_INDICES * feat: make nullifier public * fix: nullifier cal for disclose circuits * feat: merge isMiniumAgeValid and miniumAge signal * fix: disclsoe test * feat: support for user identifier and secret * chore :refactor * feat: ofac test last name , firstname * feat: add forbidden_countries_list check * feat: add tests for aadhaar (WIP) * failing ofac tests * feat: finish contract tests * fix: merge conflicts * update the common package to be usable in circuits and contracts * lint everything * coderabbit fixes * chore: update name dob,yob aadhaar ofac tree * feat: merge ofac and reverse ofac check into one * test: merged ofac constrain * SELF-253 feat: add user email feedback (#889) * feat: add sentry feedback * add sentry feedback to web * feat: add custom feedback modal & fix freeze on IOS * yarn nice * update lock * feat: show feedback widget on NFC scan issues (#948) * feat: show feedback widget on NFC scan issues * fix ref * clean up * fix report issue screen * abstract send user feedback email logic * fixes * change text to Report Issue * sanitize email and track event messge * remove unnecessary sanitization * add sanitize error message tests * fix tests * save wip. almost done * fix screen test * fix screen test * remove non working test --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> * chore: centralize license header checks (#952) * chore: centralize license header scripts * chore: run license header checks from root * add header to other files * add header to bundle * add migration script and update check license headers * convert license to mobile sdk * migrate license headers * remove headers from common; convert remaining * fix headers * add license header checks * update unsupported passport screen (#953) * update unsupported passport screen * yarn nice * feat: support new ofac trees * fix: qr extractor tests * chore: remove unassigned age signal * chore: modify timestamp func comment * fix: add constrain on photo bytes delimiter * fix: add range check on minimumAge within 2^7 * fix: range check for country not in list * chore: remove dummy constrain * fix: assert lessthan * fix: check is photoEOI valid * fix: replace maxDataLength with qrPaddedLength for valid del indices * feat: update forbidden countries in disclose and disclose id * feat: convert name to uppercase * fix: add constrain between delimiter and photoEOI * feat: support for phno len 4 and 10 * chore: hard-code attestaion_ID to 3 * feat: calculate nullifier using uppercase name * feat: add real id support * fix: rebase error * chore: refactor * add new nullifier and commitment calc * fix: reuse uppercase name from verify commitment * feat: add a function that will iterate though all pubkeys * chore: skip real id test * chore: yarn format * chore: update yarn.lock * chore: rm trailing / from import * chore: add support for issuing state * chore: linting and types * chore: rm types script from circuits * chore: add license header --------- Co-authored-by: nicoshark <[email protected]> Co-authored-by: turnoffthiscomputer <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: turboblitz <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: crStiv <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: James Niken <[email protected]> Co-authored-by: Kevin Lin <[email protected]> Co-authored-by: leopardracer <[email protected]> Co-authored-by: Olof Andersson <[email protected]> Co-authored-by: vishal <[email protected]> Co-authored-by: Vishalkulkarni45 <[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]> * fix: CLA not supported (#1027) * fix: CLA not supported * fix "yarn android" building * remove unnecessary commands --------- Co-authored-by: Justin Hernandez <[email protected]> * chore: bump app version v2.6.5 (#1034) * update gem lock * bump build and version * fix app versions * chore: fix nfc passport reader private repo access (#1042) * add internal repo pat * update nfc passport reader location * update workflows to use PAT to access NFC Passport Reader * fix ci * update logic to access private repo * build(android): support 16KB page size (#1043) * build(android): support 16KB page size * fix 16kb * update lock * chore: bump v2.6.5 for release (#1036) * bump build * update to ssh clone to fix local build * update podfile lock * fix version * Feat/build aadhaar (#1044) * feat: build aadhaar circuits as well in the ci * feat: add register aadhaar case handling * fix aadhaar register output after building the cpp circuit (#1045) * fix: metro js crypto module build issues (#1047) * fix sdk build issues * fix build error * sort and fix dependencies * add constants-browserify * feat: add new verifiers (#1049) * feat: add new verifiers * format: contracts * fix: ofac check to aadhaar (#1050) * fix: hub-v2 (#1051) * Add DisclosureVerified event for comprehensive verification tracking (#945) * Add VerificationPerformed event to track verification calls - Added VerificationPerformed event with comprehensive tracking fields - Captures requestor contract, version, attestation ID, chain ID, config ID, user identifier, output, and user data - Enhanced _executeVerificationFlow to return additional tracking data - Event emission placed after verification completion for accurate tracking * chore: run formatter * chore: rename verify event name to DisclosureVerified * move clearPassportData, markCurrentDocumentAsRegistered, reStorePassportDataWithRightCSCA to SDK (#1041) * Move self app store to mobile sdk (#1040) * chore(mobile-sdk-alpha): remove unused tslib dependency (#1053) * remove tslib -- seems unused * remove deps accidentally added to root * build file * remove unused imports (#1055) * fix: sha256 signed attr tests (#1058) * fix mock screen launch (#1059) * Hotfix: Belgium ID cards (#1061) * feat: parse belgium TD1 mrz android * feat: Parse Belgium TD1 MRZ IOS * fix: OFAC trees not found (#1060) * fix: relax OFAC tree response validation * test: cover OFAC tree edge cases * fix stateless * revert and fix types * fix tests * [SELF-723] feat: add structured NFC and Proof logging (#1048) * feat: add structured NFC logging * fix ci * Fix: add deps * logging fixes. use breadcrumbs * fix android build * update SeverityLevel * [SELF-705] feat: add proof event logging (#1057) * feat: add proof event logging * refactor: unify sentry event logging * fix types * fix mock * simplify * code rabbit feedback * fix tests --------- Co-authored-by: seshanthS <[email protected]> * skip on dev (#1063) * don't get fancy just disable (#1064) * saw it building so gonna try (#1065) * Dev (#1074) * chore: bump v2.6.5 rd2 (#1067) * commit wip version bump * remove from building * chore: update tooling dependencies (#1069) * chore: update tooling dependencies * chore: align react typings and node types * update lock * chore: minor fixes across monorepo (#1068) * small fixes * fixes * fix gesture handler error * ci fixes * fix yarn build; add workflow ci (#1075) * add new workspace ci * disable package version check for now * build before checks * format * fix in future pr * feat: add functions for disclosing aadhaar attributes (#1033) * feat: add functions for disclosing aadhaar attributes * format * chore: update monorepo artifacts (#1079) * remove unneeded artifacts, skip building circuits * update md files * cleans up unused parts of sdk interface, adds inline documentation, (#1078) * cleans up unused parts of sdk interface, adds inline documentation, * fix up build * yolo * Feat/aadhaar sdk (#1082) * feat: add aadhaar support to the ts sdk * feat: aadhaar support to go sdk * chore: refactor * move clearPassportData, markCurrentDocumentAsRegistered, reStorePassportDataWithRightCSCA to SDK (#1041) * Move self app store to mobile sdk (#1040) * chore(mobile-sdk-alpha): remove unused tslib dependency (#1053) * remove tslib -- seems unused * remove deps accidentally added to root * build file * remove unused imports (#1055) * fix: sha256 signed attr tests (#1058) * fix mock screen launch (#1059) * Hotfix: Belgium ID cards (#1061) * feat: parse belgium TD1 mrz android * feat: Parse Belgium TD1 MRZ IOS * fix: OFAC trees not found (#1060) * fix: relax OFAC tree response validation * test: cover OFAC tree edge cases * fix stateless * revert and fix types * fix tests * [SELF-723] feat: add structured NFC and Proof logging (#1048) * feat: add structured NFC logging * fix ci * Fix: add deps * logging fixes. use breadcrumbs * fix android build * update SeverityLevel * [SELF-705] feat: add proof event logging (#1057) * feat: add proof event logging * refactor: unify sentry event logging * fix types * fix mock * simplify * code rabbit feedback * fix tests --------- Co-authored-by: seshanthS <[email protected]> * skip on dev (#1063) * don't get fancy just disable (#1064) * saw it building so gonna try (#1065) * chore: bump v2.6.5 rd2 (#1067) * commit wip version bump * remove from building * chore: update tooling dependencies (#1069) * chore: update tooling dependencies * chore: align react typings and node types * update lock * chore: minor fixes across monorepo (#1068) * small fixes * fixes * fix gesture handler error * ci fixes * fix yarn build; add workflow ci (#1075) * add new workspace ci * disable package version check for now * build before checks * format * fix in future pr * feat: add functions for disclosing aadhaar attributes (#1033) * feat: add functions for disclosing aadhaar attributes * format * chore: update monorepo artifacts (#1079) * remove unneeded artifacts, skip building circuits * update md files * chore: update hub contract address * format * fix: add aadhaar in AllIds * chore: bump to v1.1.0-beta --------- Co-authored-by: vishal <[email protected]> Co-authored-by: Leszek Stachowski <[email protected]> Co-authored-by: Aaron DeRuvo <[email protected]> Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Seshanth.S🐺 <[email protected]> Co-authored-by: seshanthS <[email protected]> * feat: change to gcp attestation verification (#959) * feat: change to gcp attestation verification * lint * fix e2e test * chore: don't check PCR0 mapping if building the app locally * fmt:fix --------- Co-authored-by: Justin Hernandez <[email protected]> * Mobile SDK: move provingMachine from the app (#1052) * Mobile SDK: move provingMachine from the app * lint, fixes * fix web build? * lint * fix metro build, add deps * update lock files * move the status handlers and proving machine tests * may it be * fix up * yolo --------- Co-authored-by: Justin Hernandez <[email protected]> Co-authored-by: Aaron DeRuvo <[email protected]> * Revert "Mobile SDK: move provingMachine from the app (#1052)" (#1084) This reverts commit 8983ac22688f731bca8890cbf9be9c85b4ac2bf…
Description
This PR moves basic document loading (catalog + single document) to the self client via adapters.
Tested
Ran the app in the emulator, tested if affected screens still load documents without issues.
Summary by CodeRabbit
New Features
Improvements
Tests