From ca071106ca9557dd52997ba675f4f70f00ac057a Mon Sep 17 00:00:00 2001 From: Stephen Thomas Date: Fri, 8 Nov 2024 10:23:43 -0600 Subject: [PATCH 1/2] Fixes url error coercion --- Sources/Auth/Internal/SessionManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Auth/Internal/SessionManager.swift b/Sources/Auth/Internal/SessionManager.swift index 80cfc0ae0..0531c1dec 100644 --- a/Sources/Auth/Internal/SessionManager.swift +++ b/Sources/Auth/Internal/SessionManager.swift @@ -106,7 +106,7 @@ private actor LiveSessionManager { // Need to do this check here, because not all RetryableError's should be retried. // URLError conforms to RetryableError, but only a subset of URLError should be retried, // the same is true for AuthError. - if let error = error as? any RetryableError, error.shouldRetry { + if let error = error as? URLError, error.shouldRetry { throw error } else { remove() From 32022e1966788f1bd604befc6255f39105c153bb Mon Sep 17 00:00:00 2001 From: Stephen Thomas Date: Fri, 8 Nov 2024 10:26:39 -0600 Subject: [PATCH 2/2] Include non-url errors --- Sources/Auth/Internal/SessionManager.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Auth/Internal/SessionManager.swift b/Sources/Auth/Internal/SessionManager.swift index 0531c1dec..684bbce78 100644 --- a/Sources/Auth/Internal/SessionManager.swift +++ b/Sources/Auth/Internal/SessionManager.swift @@ -108,6 +108,8 @@ private actor LiveSessionManager { // the same is true for AuthError. if let error = error as? URLError, error.shouldRetry { throw error + } else if let error = error as? any RetryableError, error.shouldRetry { + throw error } else { remove() throw error