From 5928592aa79c842b8f602ce815962389f19f192e Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Thu, 30 Nov 2023 16:35:53 +0100 Subject: [PATCH 1/2] Don't throw when one account can't be authenticated (#1178) --- .../MastodonCore/Service/API/APIService+HomeTimeline.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift index 5317cd4b0..0ba55beb2 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift @@ -46,8 +46,9 @@ extension APIService { // FIXME: This is a dirty hack to make the performance-stuff work. // Problem is, that we don't persist the user on disk anymore. So we have to fetch // it when we need it to display on the home timeline. + // We need this (also) for the Account-list, but it might be the wrong place. App Startup might be more appropriate for authentication in AuthenticationServiceProvider.shared.authentications { - _ = try await accountInfo(domain: authentication.domain, + _ = try await? accountInfo(domain: authentication.domain, userID: authentication.userID, authorization: Mastodon.API.OAuth.Authorization(accessToken: authentication.userAccessToken)).value } From 7b8898a1aecf3e92234241e257673a6c758a304c Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Thu, 30 Nov 2023 16:39:43 +0100 Subject: [PATCH 2/2] :facepalm: (#1178) --- .../MastodonCore/Service/API/APIService+HomeTimeline.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift index 0ba55beb2..f806f856f 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+HomeTimeline.swift @@ -48,7 +48,7 @@ extension APIService { // it when we need it to display on the home timeline. // We need this (also) for the Account-list, but it might be the wrong place. App Startup might be more appropriate for authentication in AuthenticationServiceProvider.shared.authentications { - _ = try await? accountInfo(domain: authentication.domain, + _ = try? await accountInfo(domain: authentication.domain, userID: authentication.userID, authorization: Mastodon.API.OAuth.Authorization(accessToken: authentication.userAccessToken)).value }