Add biometric lock and rate limit handling
Biometric lock: opt-in Face ID/Touch ID/fingerprint app lock with toggle in ProfileScreen. Locks on background, requires auth on foreground return. Platform implementations: BiometricPrompt (Android), LAContext (iOS). Rate limit: 429 responses parsed with Retry-After header, user-friendly error messages in all 10 locales, retry plugin respects 429. ErrorMessageParser updated for both iOS Swift and KMM.
This commit is contained in:
@@ -48,6 +48,11 @@ struct ErrorCodeMappingTests {
|
||||
#expect(result == "Too many attempts. Please wait a few minutes and try again.")
|
||||
}
|
||||
|
||||
@Test func tooManyRequestsCode() {
|
||||
let result = ErrorMessageParser.parse("error.too_many_requests")
|
||||
#expect(result == "Too many requests. Please try again later.")
|
||||
}
|
||||
|
||||
@Test func taskNotFoundCode() {
|
||||
let result = ErrorMessageParser.parse("error.task_not_found")
|
||||
#expect(result == "Task not found. It may have been deleted.")
|
||||
@@ -137,6 +142,16 @@ struct NetworkErrorPatternTests {
|
||||
let result = ErrorMessageParser.parse("SocketTimeoutException: connect timed out")
|
||||
#expect(result == "Request timed out. Please try again.")
|
||||
}
|
||||
|
||||
@Test func tooManyRequestsDetected() {
|
||||
let result = ErrorMessageParser.parse("Too many requests. Please try again later.")
|
||||
#expect(result == "Too many requests. Please try again later.")
|
||||
}
|
||||
|
||||
@Test func tooManyRequestsWithRetryAfterDetected() {
|
||||
let result = ErrorMessageParser.parse("Too many requests. Please try again in 30 seconds.")
|
||||
#expect(result.contains("Too many requests"))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Technical Error Detection Tests
|
||||
|
||||
Reference in New Issue
Block a user