-
Notifications
You must be signed in to change notification settings - Fork 26
Feat: Improved error logs on android and remove logs #53
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughUpdated Android error message formatting for DOM exceptions and removed console logging in two web code paths related to missing WebAuthn extensions. No control-flow changes or public API modifications. Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
android/src/main/java/expo/modules/passkeys/ReactNativePasskeysModule.kt (1)
100-104: Consider extracting duplicate DomException handling logic.Both
getRegistrationExceptionandgetAuthenticationExceptionhave identical logic for formatting DomException errors. Extracting this into a shared helper function would reduce duplication and improve maintainability.For example, you could add:
private fun formatDomException(domError: Any, message: String?): String { val errorType = domError.javaClass.simpleName val errorMessage = message ?: "Unknown error" return "DomError: $errorType - $errorMessage" }Then use it in both functions:
is CreatePublicKeyCredentialDomException -> { - val errorType = e.domError.javaClass.simpleName - val errorMessage = e.message ?: "Unknown error" - "DomError: $errorType - $errorMessage" + formatDomException(e.domError, e.message) }is GetPublicKeyCredentialDomException -> { - val errorType = e.domError.javaClass.simpleName - val errorMessage = e.message ?: "Unknown error" - "DomError: $errorType - $errorMessage" + formatDomException(e.domError, e.message) }Also applies to: 131-135
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
android/src/main/java/expo/modules/passkeys/ReactNativePasskeysModule.kt(2 hunks)src/ReactNativePasskeysModule.web.ts(0 hunks)src/utils/warn-user-of-missing-webauthn-extensions.ts(0 hunks)
💤 Files with no reviewable changes (2)
- src/ReactNativePasskeysModule.web.ts
- src/utils/warn-user-of-missing-webauthn-extensions.ts
🔇 Additional comments (1)
android/src/main/java/expo/modules/passkeys/ReactNativePasskeysModule.kt (1)
100-104: Excellent improvement to error reporting!The new format provides clear, human-readable error messages. The extraction of
errorTypeanderrorMessageis well-implemented, and the fallback to "Unknown error" is appropriate.
Instead of just getting errors like this:
androidx.credentials.exceptions.domerrors.DataError@85a93b2one now gets more info on what was the issue like so for instance :DomError: DataError - [50152] RP ID cannot be validated.Summary by CodeRabbit