Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a Blazor application and Firefox, upon closing the window/application, CircuitHandler OnCircuitClosedAsync is not called. #57996

Closed
1 task done
HowardFedTec opened this issue Sep 20, 2024 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved

Comments

@HowardFedTec
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

While running a Blazor application, upon opening a new window in MS Edge, Chrome, and Firefox, the OnCircuitOpenedAsync method is called in the CircuitHandler.

However, the problem is that the CircuitHandler method OnCircuitClosedAsync method is NOT called when you close a firefox window/application. The other browsers closing action causes the method to be called.

Expected Behavior

Upon closing Firefox window/browser the OnCircuitAsync method should be called to nofity of the circuit closure.

Steps To Reproduce

In Visual Studio, Set a breakpoint on OnCircuitOpenedAsync and OnCircuitClosedAsync method. Run the application. Open Firefox and access the application. Notice that OnCircuitOpenedAsync is called. Close Firefox browser. Observe OnCircuitClosedAsync is never called.

Exceptions (if any)

None

.NET Version

8.0.401

Anything else?

Visual Studio 2022 Enterprise Version 17.11.4

dotnet --info
.NET SDK:
Version: 8.0.401
Commit: 811edcc344
Workload version: 8.0.400-manifests.251308be
MSBuild version: 17.11.4+37eb419ad

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.401\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
[android]
Installation Source: VS 17.11.35312.102
Manifest Version: 34.0.113/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.113\WorkloadManifest.json
Install Type: FileBased

[maui-windows]
Installation Source: VS 17.11.35312.102
Manifest Version: 8.0.82/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.82\WorkloadManifest.json
Install Type: FileBased

[maccatalyst]
Installation Source: VS 17.11.35312.102
Manifest Version: 17.5.8030/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.5.8030\WorkloadManifest.json
Install Type: FileBased

[ios]
Installation Source: VS 17.11.35312.102
Manifest Version: 17.5.8030/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.5.8030\WorkloadManifest.json
Install Type: FileBased

[wasm-tools-net6]
Installation Source: VS 17.11.35312.102
Manifest Version: 8.0.8/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net6\8.0.8\WorkloadManifest.json
Install Type: FileBased

[wasm-tools-net7]
Installation Source: VS 17.11.35312.102
Manifest Version: 8.0.8/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.net7\8.0.8\WorkloadManifest.json
Install Type: FileBased

[wasm-tools]
Installation Source: VS 17.11.35312.102
Manifest Version: 8.0.8/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.8\WorkloadManifest.json
Install Type: FileBased

[aspire]
Installation Source: VS 17.11.35312.102
Manifest Version: 8.1.0/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.1.0\WorkloadManifest.json
Install Type: FileBased

Host:
Version: 8.0.8
Architecture: x64
Commit: 08338fcaa5

.NET SDKs installed:
8.0.400 [C:\Program Files\dotnet\sdk]
8.0.401 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.33 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Sep 20, 2024
@HowardFedTec HowardFedTec changed the title Using Firefox, upon closing the window/application, CircuitHandler OnCircuitClosedAsync is not called. Using a Blazor application and Firefox, upon closing the window/application, CircuitHandler OnCircuitClosedAsync is not called. Sep 20, 2024
@wtgodbe wtgodbe added area-blazor Includes: Blazor, Razor Components and removed area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework labels Sep 24, 2024
@javiercn
Copy link
Member

@HowardFedTec thanks for contacting us.

The handler is called when the circuit is terminated, that can happen sometime after the window closes if the window doesn't trigger the unload event, which we use to optimistically indicate to the server that the session is over as opposed to a regular disconnection.

@javiercn javiercn added question ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. labels Sep 25, 2024
Copy link
Contributor

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants