Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

BrowserDimensionWatcher.DisposeAsync lets JS-interop cancellation escape, surfacing a benign TaskCanceledException as an unhandled circuit error

Closed Beginner friendly
#6,011 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start with MeshWeaver.Portal/Resize/BrowserDimensionWatcher.cs, especially DisposeAsync() around line 157; review OnAfterRenderAsync around line 97 for the related pattern. Check how the component disposes its JS object reference and handle cancellation or disconnection as described in the issue. Done when teardown no longer lets those exceptions escape; verify with the relevant component tests, if present.

Written by the indexing model from the issue text.

Description

bug sev:L

What is failing

The portal's BrowserDimensionWatcher component fails its circuit teardown: its DisposeAsync disposes a JSObjectReference via JS interop, and when the circuit is already being torn down (client disconnect / tab close), that call surfaces as a TaskCanceledException that Blazor logs as a fatal unhandled circuit error (CircuitHost event 111).

Probable cause

High confidence. BrowserDimensionWatcher.DisposeAsync() (BrowserDimensionWatcher.cs, line 157) calls JSObjectReference.DisposeAsync() without catching cancellation. When the SignalR connection is gone, the pending InvokeVoidAsync is canceled by the circuit's token and the exception escapes DisposeAsync, which the renderer treats as an unhandled asynchronous disposal error. This is the exact case the Blazor guidance covers: JS interop in DisposeAsync must catch JSDisconnectedException / OperationCanceledException. The defect is ours — unlike the sibling incident for this log category (7439658a1a28dfa0, filed as Systemorph/MeshWeaver#5362), the top application frame here is portal code, not the framework's RemoteNavigationManager, so this is not a duplicate of that ticket. The same component has form for throwing during JS interop: Ops/Logs/memex-cloud-1790087318865198321-4645f8-8pdzb (2026-09-22) shows it throwing out of OnAfterRenderAsync (line 97).

Impact

None in practice — a single occurrence on one pod, in a circuit that was already being disposed because the client left. No data loss, no user-visible failure beyond the disconnect itself. Worth fixing because the fix is trivial and it keeps the noisy CircuitHost[111] channel clean for real errors; alternatively, if the team prefers, this shape could be suppressed at the log-filter level instead.

Where to look

MeshWeaver.Portal/Resize/BrowserDimensionWatcher.cs — DisposeAsync() at line 157 (and, for the same pattern, OnAfterRenderAsync around line 97). Wrap the JSObjectReference.DisposeAsync() call in a try/catch for OperationCanceledException and JSDisconnectedException, per the standard Blazor Server disposal pattern.


Evidence
Fingerprint 160407785cd655f5
Category Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost
Severity Error
Exception System.Threading.Tasks.TaskCanceledException
Top frame MeshWeaver.Blazor.Portal.Resize.BrowserDimensionWatcher.DisposeAsync()
Namespace memex-cloud
Pods memex-portal-deployment-546888968f-9fx75
Occurrences 1
First seen 2026-10-03 06:27:35Z
Last seen 2026-10-03 06:27:35Z
Routing not determined — no configured route matches the category Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost. This repository is the configured fallback, not a finding about who owns the fault; the category names the LOGGER, which may not be the subject.
Recent log lines
2026-10-03 06:27:35Z memex-portal-deployment-546888968f-9fx75 fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit '0jKRXVKmiBdRPvxB3Vpi_hbJJCFhDAkK1B0V8pYEjZM'.
      System.Threading.Tasks.TaskCanceledException: A task was canceled.
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, JSCallType callType, Object[] args)
         at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
         at Microsoft.JSInterop.Implementation.JSObjectReference.DisposeAsync()
         at MeshWeaver.Blazor.Portal.Resize.BrowserDimensionWatcher.DisposeAsync() in /home/runner/work/MeshWeaver/MeshWeaver/plugins-repo/src/MeshWeaver.Blazor.Portal/Resize/BrowserDimensionWatcher.cs:line 157
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.<ProcessDisposalQueueInExistingBatch>g__GetHandledAsynchronousDisposalErrorsTask|99_0(Task result)

Opened automatically from Admin/_LogIncident/160407785cd655f5. Recurrences are folded into this issue rather than opening new ones.
It also stands for the whole log site d85dd830f4de07a8: other fingerprints of this site fold in here as comments rather than opening tickets of their own.

Dominant language
C#
Stars
12
Forks
5
Avg merge
5h 57m
Merged PRs (30d)
967

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Systemorph/MeshWeaver

All issues in Systemorph/MeshWeaver

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.