Skip to content

Unhandled TaskCanceledException on App Exit with Avalonia 11.2.3 and WebView 3.120.8 #381

@Jackhammer88

Description

@Jackhammer88

Description:

When using Avalonia 11.2.3 with WebView 3.120.8, an unhandled exception occurs on application exit. The issue happens in a basic scenario — simply opening a page in WebView and then closing the app.

Steps to Reproduce:

  1. Create a basic Avalonia app with WebView (e.g., Avalonia 11.2.3 and WebView 3.120.8).
  2. Add WebView to MainWindow and open any webpage.
  3. Close the application.

Expected Behavior:

The application should close gracefully without errors.

Actual Behavior:

The application crashes with the following error:

Unhandled exception. System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at Avalonia.Threading.DispatcherOperation.Wait(TimeSpan) + 0x1bc
   at Avalonia.Threading.Dispatcher.InvokeImpl(DispatcherOperation, CancellationToken, TimeSpan) + 0x186
   at Avalonia.Threading.Dispatcher.Send(SendOrPostCallback, Object, Nullable`1) + 0xcb
   at Avalonia.Threading.AvaloniaSynchronizationContext.Send(SendOrPostCallback, Object) + 0x4a
   at Tmds.DBus.Protocol.DBusConnection.Observer.Dispose(Exception, Boolean) + 0x60
   at Tmds.DBus.Protocol.DBusConnection.Dispose() + 0x241
   at Tmds.DBus.Protocol.Connection.Disconnect(Exception, DBusConnection) + 0xc8
   at Tmds.DBus.Protocol.DBusConnection.<HandleMessages>d__38.MoveNext() + 0x77d
Aborted (core dumped)

Environment:

Avalonia: 11.2.3
WebView: 3.120.8
OS: ALT Linux Starterkit 11 (Salvia)
.NET: 8

Additional Context:

The stack trace indicates the issue is related to Tmds.DBus.Protocol during the disposal process, suggesting an unhandled asynchronous operation (TaskCanceledException).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions