From c7ecdad26a18cd9dc25ac80984034c1b6fb28c7c Mon Sep 17 00:00:00 2001 From: Vasilis The Pikachu Date: Mon, 1 Dec 2025 23:48:11 +0100 Subject: [PATCH 1/2] Reapply "Fix fallbacks not being used in the launcher (#251)" (#252) This reverts commit 892d95eccd0de2ece4aa713348a1f46946a3b7fa. --- SS14.Launcher/ConfigConstants.cs | 2 +- SS14.Launcher/Models/Logins/LoginManager.cs | 2 +- SS14.Launcher/Utility/UrlFallbackSet.cs | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SS14.Launcher/ConfigConstants.cs b/SS14.Launcher/ConfigConstants.cs index 40852ef5b..18da700fe 100644 --- a/SS14.Launcher/ConfigConstants.cs +++ b/SS14.Launcher/ConfigConstants.cs @@ -11,7 +11,7 @@ public static class ConfigConstants // Refresh login tokens if they're within of expiry. public static readonly TimeSpan TokenRefreshThreshold = TimeSpan.FromDays(15); - // If the user leaves the launcher running for absolute ages, this is how often we'll update his login tokens. + // If the user leaves the launcher running for absolute ages, this is how often we'll update their login tokens. public static readonly TimeSpan TokenRefreshInterval = TimeSpan.FromDays(7); // The amount of time before a server is considered timed out for status checks. diff --git a/SS14.Launcher/Models/Logins/LoginManager.cs b/SS14.Launcher/Models/Logins/LoginManager.cs index 963c5b52a..080aebd3f 100644 --- a/SS14.Launcher/Models/Logins/LoginManager.cs +++ b/SS14.Launcher/Models/Logins/LoginManager.cs @@ -86,7 +86,7 @@ public LoginManager(DataManager cfg, AuthApi authApi) public async Task Initialize() { // Set up timer so that if the user leaves their launcher open for a month or something - // his tokens don't expire. + // their tokens don't expire. _timer = DispatcherTimer.Run(() => { async void Impl() diff --git a/SS14.Launcher/Utility/UrlFallbackSet.cs b/SS14.Launcher/Utility/UrlFallbackSet.cs index 4734aed2f..c3ca100a1 100644 --- a/SS14.Launcher/Utility/UrlFallbackSet.cs +++ b/SS14.Launcher/Utility/UrlFallbackSet.cs @@ -109,6 +109,8 @@ private static async Task AttemptConnection( cancel ).ConfigureAwait(false); + response.EnsureSuccessStatusCode(); + return response; } From 9146778992fd6e3e8627fcc9342cf06c926af1a5 Mon Sep 17 00:00:00 2001 From: Vasilis The Pikachu Date: Tue, 2 Dec 2025 00:35:37 +0100 Subject: [PATCH 2/2] Fix fallbacks not being used in the launcher on 500 class errors This is really the best way i can think of solving this, a 500 is 100% something going wrong. If you have better suggestion to make this more reliable please suggest it. --- SS14.Launcher/Utility/UrlFallbackSet.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SS14.Launcher/Utility/UrlFallbackSet.cs b/SS14.Launcher/Utility/UrlFallbackSet.cs index c3ca100a1..38523ebd0 100644 --- a/SS14.Launcher/Utility/UrlFallbackSet.cs +++ b/SS14.Launcher/Utility/UrlFallbackSet.cs @@ -109,7 +109,8 @@ private static async Task AttemptConnection( cancel ).ConfigureAwait(false); - response.EnsureSuccessStatusCode(); + if ((int)response.StatusCode >= 500) + throw new HttpRequestException($"Server returned {response.StatusCode} for {message.RequestUri}"); return response; }