Skip to content

Commit b641a77

Browse files
authored
Merge pull request LykosAI#354 from ionite34/accounts-fixes
2 parents 493c3ec + 6e54919 commit b641a77

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8+
## v2.7.0-dev.2
9+
### Fixed
10+
- Fixed InvalidOperation errors when signing into accounts shortly after signing out, while the previous account update is still running
11+
812
## v2.7.0-dev.1
913
### Added
1014
- Accounts Settings Subpage

StabilityMatrix.Avalonia/Services/AccountsService.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ public async Task RefreshAsync()
141141

142142
private async Task RefreshLykosAsync(Secrets secrets)
143143
{
144-
if (secrets.LykosAccount is not null)
144+
if (
145+
secrets.LykosAccount is not null
146+
&& !string.IsNullOrWhiteSpace(secrets.LykosAccount?.RefreshToken)
147+
&& !string.IsNullOrWhiteSpace(secrets.LykosAccount?.AccessToken)
148+
)
145149
{
146150
try
147151
{
@@ -157,6 +161,10 @@ private async Task RefreshLykosAsync(Secrets secrets)
157161
{
158162
logger.LogWarning("Timed out while fetching Lykos Auth user info");
159163
}
164+
catch (InvalidOperationException e)
165+
{
166+
logger.LogWarning(e, "Failed to get authentication token");
167+
}
160168
catch (ApiException e)
161169
{
162170
if (e.StatusCode is HttpStatusCode.Unauthorized) { }
@@ -165,6 +173,10 @@ private async Task RefreshLykosAsync(Secrets secrets)
165173
logger.LogWarning(e, "Failed to get user info from Lykos");
166174
}
167175
}
176+
catch (Exception e)
177+
{
178+
logger.LogError(e, "Unknown error while refreshing Lykos account status");
179+
}
168180
}
169181

170182
OnLykosAccountStatusUpdate(LykosAccountStatusUpdateEventArgs.Disconnected);

StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ApplicationManifest>app.manifest</ApplicationManifest>
99
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
1010
<ApplicationIcon>./Assets/Icon.ico</ApplicationIcon>
11-
<Version>2.7.0-dev.1</Version>
11+
<Version>2.7.0-dev.2</Version>
1212
<InformationalVersion>$(Version)</InformationalVersion>
1313
<EnableWindowsTargeting>true</EnableWindowsTargeting>
1414
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

0 commit comments

Comments
 (0)