Skip to content
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

fix(auth): URLError coercion for RetryableError causing session to be deleted #597

Merged
merged 2 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Sources/Auth/Internal/SessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
URLQueryItem(name: "grant_type", value: "refresh_token")
],
body: configuration.encoder.encode(
UserCredentials(refreshToken: refreshToken)

Check warning on line 90 in Sources/Auth/Internal/SessionManager.swift

View workflow job for this annotation

GitHub Actions / xcodebuild-macOS-14 (test, MACOS)

'UserCredentials' is deprecated: Access to UserCredentials will be removed on the next major release.

Check warning on line 90 in Sources/Auth/Internal/SessionManager.swift

View workflow job for this annotation

GitHub Actions / xcodebuild-macOS-14 (test, TVOS)

'UserCredentials' is deprecated: Access to UserCredentials will be removed on the next major release.
)
)
)
Expand All @@ -106,7 +106,9 @@
// 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 if let error = error as? any RetryableError, error.shouldRetry {
grdsdev marked this conversation as resolved.
Show resolved Hide resolved
throw error
} else {
remove()
Expand Down
Loading