Description
Is there an existing issue for this?
- I have searched the existing issues
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.
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Activity
MackinnonBuck commentedon Nov 8, 2023
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
BuildInboundActivityDispatcher
after the_circuitHandlers
are retrieved for Blazor Web.AuthenticationStateProvider
in outgoing request middleware #52379[Blazor] Dispatch inbound activity handlers in Blazor Web apps (#53185)…