feat: Expose isRetryable property on CredentialsManagerException, ApiException, and WebAuthenticationException#786
Merged
utkrishtsahu merged 11 commits intomainfrom Mar 31, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an isRetryable signal to CredentialsManagerException so Flutter apps can distinguish transient credential-operation failures (safe to retry) from permanent ones (should not retry).
Changes:
- Added
CredentialsManagerException.isRetryablein the platform interface, sourced from_isRetryableinPlatformException.details. - Propagated
_isRetryablefrom native layers: Android viaCredentialsManagerException.toMap(), and iOS/macOS viaFlutterError(from: CredentialsManagerError)details enrichment. - Added unit tests and updated examples documentation to describe platform behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| auth0_flutter_platform_interface/lib/src/credentials-manager/credentials_manager_exception.dart | Adds isRetryable getter reading _isRetryable from details. |
| auth0_flutter_platform_interface/test/credential_manager_exception_test.dart | Adds tests covering isRetryable true/false/missing flag behavior. |
| auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/CredentialsManagerExceptionExtensions.kt | Introduces CredentialsManagerException.toMap() that sets _isRetryable based on network AuthenticationException. |
| auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/request_handlers/credentials_manager/GetCredentialsRequestHandler.kt | Sends exception.toMap() as error details to Flutter. |
| auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/request_handlers/credentials_manager/RenewCredentialsRequestHandler.kt | Sends exception.toMap() as error details to Flutter. |
| auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/request_handlers/credentials_manager/GetSSOCredentialsRequestHandler.kt | Sends exception.toMap() as error details to Flutter. |
| auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/CredentialsManagerExceptionExtensionsTest.kt | Adds tests for Android _isRetryable mapping across different causes. |
| auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift | Adds _isRetryable to FlutterError details with retryability rules for renew/network/biometrics. |
| auth0_flutter/example/ios/Tests/Utilities.swift | Strengthens assertion to verify _isRetryable exists and is a Bool in details. |
| auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerExtensionsTests.swift | Adds iOS tests asserting retryability for specific CredentialsManagerError cases. |
| auth0_flutter/EXAMPLES.md | Documents isRetryable usage and platform behavior notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pmathew92
reviewed
Mar 24, 2026
…Exception, and WebAuthenticationException
…ryable-property-on-CredentialsManagerException
… isRetryable using Auth0APIError protocol
pmathew92
reviewed
Mar 30, 2026
pmathew92
reviewed
Mar 30, 2026
sanchitmehtagit
previously approved these changes
Mar 30, 2026
5 tasks
pmathew92
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Changes
Adds the isRetryable property to CredentialsManagerException, ApiException, and WebAuthenticationException to indicate whether a failure is transient and can be retried.
Dart: Added bool get isRetryable to WebAuthenticationException, which reads _isRetryable from the details map. Added bool get isRetryable to ApiException, which delegates to existing isNetworkError flag (no native changes needed).
Android: Updated LoginWebAuthRequestHandler and LogoutWebAuthRequestHandler to pass mapOf("_isRetryable" to exception.isNetworkError) as error details.
iOS: Extended FlutterError(from: WebAuthError) to include _isRetryable in the details dictionary. Returns true for network-related AuthenticationError and URLError. Returns false for all other cases.
Docs: Updated EXAMPLES.md with isRetryable usage examples for ApiException and WebAuthenticationException.
📎 References
SDK-8093
🎯 Testing
Unit tests added:
Manual testing:
Verified on Android device (Pixel 7a) and iOS simulator (iPhone 17 Pro) using the example app — tested WebAuth login cancel, WebAuth logout (not logged in), API login with bad credentials, getCredentials, renewCredentials, and clearCredentials + getCredentials scenarios. Confirmed isRetryable is false for permanent errors and correctly propagated through the platform channel on both platforms.