Skip to content

[release/17.0] Keep dashboard views removed while they initialize from ending the circuit - #22058

Merged
Jose Perez Rodriguez (joperezr) merged 4 commits into
release/17.0from
backport/pr-21995-to-release/17.0
Nov 11, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 4 commits into
release/17.0from
backport/pr-21995-to-release/17.0

Conversation

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Backport of #21995 to release/17.0

/cc Sébastien Ros (@sebastienros)

Customer Impact

Testing

Risk

Regression?

…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.
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22058

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22058"

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

13 / 101 PR test projects · 2 PR jobs, from 14 changed files.

Selected PR test projects (13 / 101)

Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 11 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/Components/Controls/Chart/ChartFilters.razor.

🔧 src/Aspire.Dashboard/Components/Controls/Chart/ChartFilters.razor (changed source)
→ 11 via the project graph: Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/DisposalSafeFluentDataGridTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/MetricsTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Shared/TestJSObjectReference.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Components/Controls/Chart/ChartFilters.razor, src/Aspire.Dashboard/Components/Controls/Chart/MeterOverview.razor.cs, src/Aspire.Dashboard/Components/Controls/Chart/MeterOverview.razor.js, src/Aspire.Dashboard/Components/Controls/Chart/MetricTable.razor, src/Aspire.Dashboard/Components/Controls/Grid/AspireFluentDataGrid.cs, src/Aspire.Dashboard/Components/Controls/Grid/DisposalSafeFluentDataGrid.cs, src/Aspire.Dashboard/Components/Controls/PropertyGrid.razor, src/Aspire.Dashboard/Components/Controls/ResourceDetails.razor, src/Aspire.Dashboard/Components/Controls/SpanDetails.razor, src/Aspire.Dashboard/Components/Dialogs/ExemplarsDialog.razor, src/Aspire.Dashboard/Components/Legacy/Pages/Metrics.razor
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit 6c235d6.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit 51e27e7 into release/17.0 Nov 11, 2026
311 of 315 checks passed
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

✅ 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: new_public_type (AspireFluentDataGrid.cs / DisposalSafeFluentDataGrid.cs, internal dashboard implementation classes, not user-facing).

@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 11, 2026
@sebastienros
Sébastien Ros (sebastienros) deleted the backport/pr-21995-to-release/17.0 branch November 12, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants