-
Notifications
You must be signed in to change notification settings - Fork 10.3k
CreateInboundActivityHandler override in .net 8 RC2 not being called #51934
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
Comments
Confirmed this is a bug, specifically for Blazor Web Apps. It's caused by the fact that in Blazor Web, the initial circuit handlers array is empty by the time the inbound activity dispatcher gets built. However, even after the Blazor Web circuit handlers are retrieved later from DI, we don't build the inbound activity handler. The easy fix would be to call |
… (#53313) # Dispatch inbound activity handlers in Blazor Web apps Fixes an issue where inbound activity handlers were not getting invoked in Blazor Web apps. ## Description Inbound activity handlers were a new feature introduced in .NET 8 to allow Blazor Server apps to monitor circuit activity and make services available to Blazor components that wouldn't otherwise be accessible. However, we also introduced a new "Blazor Web" app model that didn't incorporate this new feature correctly. This PR fixes the issue by: * Building the inbound activity pipeline in Blazor Web apps just after circuit handlers are retrieved * Invoking inbound activity handlers in web root component updates Fixes #51934 ## Customer Impact Multiple customers have indicated being affected by this issue. Since this is a new feature in .NET 8, customers expect it to work in Blazor Web apps, which we recommend for new projects. Without this fix, the functionality only works in traditional Blazor Server apps. ## Regression? - [ ] Yes - [X] No This is a new feature in .NET 8. ## Risk - [ ] High - [ ] Medium - [X] Low The fix is simple and applies to a well-tested area of the framework, so our E2E tests are likely to catch issues with this change. ## Verification - [X] Manual (required) - [X] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [X] N/A
Is there an existing issue for this?
Describe the bug
CreateInboundActivityHandler introduced in .net 8 preview 3, as seen in the dotnet blog post linked below, does not appear to work in .net 8 release candidate 2.
https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-3/#monitor-blazor-server-circuit-activity
Within the same circuit handler the overrides for circuit open, circuit closed, connection up and connection down work as expected.
Are there any situations which would cause the CreateInboundActivityHandler to not be called when UI events fire in an interactive server component that is functioning as expected?
Expected Behavior
The CreateInboundActivityHandler is called when any user interface events within a blazor component are activated, e.g. the changing of text, the click of a button.
Steps To Reproduce
Repo: https://github.com/Thomas-Explc/CreateInboundActivityHandler_Bug_Example
Go to counter page, use the button and enter test in the input field, no UI events cause function to fire.
Logger in CreateInboundActivityHandler is not hit, no breakpoints within that function are reached.
Exceptions (if any)
None, issue is logical.
.NET Version
8.0.100-rc.2.23502.2
Anything else?
Visual Studio 2022, 17.8.0 Preview 6.0.
The text was updated successfully, but these errors were encountered: