Repository navigation
[release/17.0] Keep dashboard views removed while they initialize from ending the circuit - #22058
Conversation
…he circuit Fluent UI's FluentDataGrid can resume OnAfterRenderAsync after it's disposed and call into the JavaScript module that disposal released (microsoft/fluentui-blazor#5580). FluentJSModule.Imported stays true after the module is disposed, so the grid's own check doesn't catch it. The ObjectDisposedException escapes OnAfterRenderAsync, and Blazor Server ends the circuit, which stops every view in the browser tab. It happens when a grid with resizable or reorderable columns is removed right after it rendered, for example by a layout change, and shows up in the dashboard's Playwright runs on main. AspireFluentDataGrid, which every dashboard grid uses, now ignores that exception when it comes from a grid whose disposal has started. The same exception from a grid still in use still surfaces. The workaround points to the issue and says what to remove once Fluent UI fixes it. Tests: a bUnit test removes a resizable grid while its JavaScript initialization is pending, then completes it, and checks that nothing reaches the renderer. A second test does the same with Fluent UI's FluentDataGrid and expects the exception, so it fails once a Fluent UI update fixes the bug, as the signal to remove the workaround.
Twelve grids used FluentDataGrid directly, so they bypassed the workaround in AspireFluentDataGrid: the resource details' five grids, the span details' two, the property grid, the metric table and its filters, the exemplars dialog and the legacy metrics page. The resource details are recreated when the viewport crosses the desktop breakpoint, so their grids hit the race that ends the circuit. The workaround moves to DisposalSafeFluentDataGrid, which AspireFluentDataGrid derives from and those grids now use. They don't use AspireFluentDataGrid itself: it also turns header titles into dashboard tooltips and adds a loading view, which would change those grids beyond this fix. The class's remarks say what to undo once Fluent UI is fixed. The tests move to DisposalSafeFluentDataGridTests and cover both grids.
…hile loading Switching from Metrics to Traces right after opening an instrument could end the circuit (#21714). MeterOverview's first render imports its module and then asks it to observe the cards. When the overview is removed during the import, its container is gone by the time the module arrives: Blazor passes it to observeCards as null, querySelectorAll throws, and the JSException escapes OnAfterRenderAsync. Disposal also had nothing to release yet, so the module and observer leaked. - observeCards returns an observer that does nothing when it gets no container. - MeterOverview remembers that it was disposed, and releases a module or observer that arrives after disposal instead of observing cards that are gone. A bUnit test removes the overview while its module loads, and checks that the module is released without observing cards and that nothing reaches the renderer. It fails without the fix.
…sposed Fluent UI stops the grid's JavaScript controller when the grid is disposed, but only a controller that has arrived. When disposal ran while the grid's Initialize call was pending, the controller arrived afterwards and kept the removed grid registered in the browser, with its click, mousedown and keydown listeners on document.body. That happened whether or not the late render then failed. DisposalSafeFluentDataGrid runs Fluent UI's controller cleanup, DisposeAsync(IJSObjectReference), again once a render that resumed after disposal completes. The cleanup stops and releases the controller once and does nothing after that. Tests: the shared TestJSObjectReference can return a value from a call, so Initialize returns a controller. The tests check that the late controller is stopped and released, with and without resizable columns, and the Fluent UI test checks that FluentDataGrid alone leaves it running.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22058Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22058" |
Tests selector13 / 101 PR test projects · 2 PR jobs, from 14 changed files. Selected PR test projects (13 / 101)
Selected PR jobs (2)
How these were chosen — grouped by what changed
🔧 📦 affected project 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
51e27e7
into
release/17.0
|
✅ No documentation update needed. excluded → head_branch_is_backport, title_release_prefix, body_backport_marker (also base_branch_is_release). Backport of #21995 to release/17.0; docs belong to the original PR. Triggered signals: |
Backport of #21995 to release/17.0
/cc Sébastien Ros (@sebastienros)
Customer Impact
Testing
Risk
Regression?