Commit d03a65b
authored
Update Show method to marshal to UI thread
Ensure notifications are shown on the UI thread.
Any caller that does notificationService.Show( ) or notificationService.TryAsync( ) from a background thread directly hits WindowNotificationManager.Show which hits line 48 raw with no UI thread marshalling. Leading to unhandled exception in Avalonia and crashes.
This follows the same pattern used by ShowAsyncCore which wraps every toast call in Dispatcher.UIThread.Invoke( ).
Without it, NotificationService.Show(INotification notification) on L48 is called from thread-pool threads (Polly continuations, Task.Run blocks) after HTTP failures exhaust retries and surface a notification.1 parent f9e6f1c commit d03a65b
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
| |||
0 commit comments