Skip to content

Circuit not disconnect on all app exit scenarios #23015

Closed
@captainsafia

Description

@captainsafia

The Blazor Server client is configured to disconnect the circuit when the user navigates away from a page.

Previously, this disconnect happened on the browser's unload event, but this event isn't dispatched in all scenarios. it was changed to beforeunload but that was dispatched on too many scenarios.

We need to figure out a reliable event to listen to that strikes a balance between:

  • Being dispatched reliably on all browsers
  • Not being dispatched in false positive scenarios (e.g. triggering a download)
Previous issue description The ClosingTheBrowserWindow_GracefullyDisconnects_WhenNavigatingAwayFromThePage test fails.

Ref: https://dev.azure.com/dnceng/public/_build/results?buildId=689837&view=ms.vss-test-web.build-test-results-tab

Output:

Assert.Contains() Failure\r\nNot found: (Debug, CircuitTerminatedGracefully)\r\nIn value: List<ValueTuple<LogLevel, String>> [(Debug, CircuitDisconnectStarted), (Debug, CircuitNotActive), (Information, ExecutedEndpoint), (Information, RequestFinished)]

   at Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests.CircuitGracefulTerminationTests.ClosingTheBrowserWindow_GracefullyDisconnects_WhenNavigatingAwayFromThePage() in /_/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs:line 87
--- End of stack trace from previous location ---

Metadata

Metadata

Assignees

Labels

affected-mostThis issue impacts most of the customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-serverfeature-circuit-lifecycleIssues to do with blazor server lifecycle eventsseverity-majorThis label is used by an internal tool

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions