Skip to content

Commit cebec16

Browse files
authored
Merge pull request #1613 from NeuralFault/notif-crash
2 parents f9e6f1c + 840d808 commit cebec16

3 files changed

Lines changed: 36 additions & 33 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+
## [Unreleased - v2.15.8]
9+
### Fixed
10+
- Fixed [#1608](https://github.com/LykosAI/StabilityMatrix/issues/1608) - Crash when cdn fetch fails due to error notification not being shown on UI Thread - thanks to @NeuralFault!
11+
812
## v2.15.7
913
### Added
1014
- Added single-instance window activation signaling so reopening the app restores and focuses the existing desktop window instead of launching a duplicate instance

StabilityMatrix.Avalonia/Services/NotificationService.cs

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ public void Initialize(
4141
notificationManager = new WindowNotificationManager(TopLevel.GetTopLevel(visual))
4242
{
4343
Position = position,
44-
MaxItems = maxItems
44+
MaxItems = maxItems,
4545
};
4646
}
4747

4848
public void Show(INotification notification)
4949
{
50-
notificationManager?.Show(notification);
50+
// Must marshal to UI thread - WindowNotificationManager requires it
51+
Dispatcher.UIThread.Invoke(() => notificationManager?.Show(notification));
5152
}
5253

5354
/// <inheritdoc />
@@ -94,25 +95,23 @@ bool isPersistent
9495
// Show app toast
9596
if (isPersistent)
9697
{
97-
Dispatcher.UIThread.Invoke(
98-
() =>
99-
ShowPersistent(
100-
notification.Title ?? "",
101-
notification.Body ?? "",
102-
key.Level.ToNotificationType()
103-
)
98+
Dispatcher.UIThread.Invoke(() =>
99+
ShowPersistent(
100+
notification.Title ?? "",
101+
notification.Body ?? "",
102+
key.Level.ToNotificationType()
103+
)
104104
);
105105
}
106106
else
107107
{
108-
Dispatcher.UIThread.Invoke(
109-
() =>
110-
Show(
111-
notification.Title ?? "",
112-
notification.Body ?? "",
113-
key.Level.ToNotificationType(),
114-
expiration
115-
)
108+
Dispatcher.UIThread.Invoke(() =>
109+
Show(
110+
notification.Title ?? "",
111+
notification.Body ?? "",
112+
key.Level.ToNotificationType(),
113+
expiration
114+
)
116115
);
117116
}
118117
return;
@@ -130,25 +129,23 @@ await nativeManager.ShowNotification(
130129
// Show app toast
131130
if (isPersistent)
132131
{
133-
Dispatcher.UIThread.Invoke(
134-
() =>
135-
ShowPersistent(
136-
notification.Title ?? "",
137-
notification.Body ?? "",
138-
key.Level.ToNotificationType()
139-
)
132+
Dispatcher.UIThread.Invoke(() =>
133+
ShowPersistent(
134+
notification.Title ?? "",
135+
notification.Body ?? "",
136+
key.Level.ToNotificationType()
137+
)
140138
);
141139
}
142140
else
143141
{
144-
Dispatcher.UIThread.Invoke(
145-
() =>
146-
Show(
147-
notification.Title ?? "",
148-
notification.Body ?? "",
149-
key.Level.ToNotificationType(),
150-
expiration
151-
)
142+
Dispatcher.UIThread.Invoke(() =>
143+
Show(
144+
notification.Title ?? "",
145+
notification.Body ?? "",
146+
key.Level.ToNotificationType(),
147+
expiration
148+
)
152149
);
153150
}
154151

StabilityMatrix.Core/Models/Packages/InvokeAI.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ IPipWheelService pipWheelService
5252
public override PackageDifficulty InstallerSortOrder => PackageDifficulty.Advanced;
5353

5454
public override Uri PreviewImageUri =>
55-
new("https://raw.githubusercontent.com/invoke-ai/InvokeAI/main/docs/assets/canvas_preview.png");
55+
new(
56+
"https://raw.githubusercontent.com/invoke-ai/InvokeAI/refs/heads/main/docs-old/assets/canvas_preview.png"
57+
);
5658

5759
public override IEnumerable<SharedFolderMethod> AvailableSharedFolderMethods =>
5860
[SharedFolderMethod.None, SharedFolderMethod.Configuration];

0 commit comments

Comments
 (0)