Using route constraints throws NullReferenceException when reloading multiple pages at the same time #17101
Labels
area-blazor
Includes: Blazor, Razor Components
bug
This issue describes a behavior which is not expected - a bug.
Servicing-consider
Shiproom approval is required for the issue
Milestone
Describe the bug
I'm using custom reconnectionHandler in Blazor server-side to automatically reload a page when the connection is lost (like on server restart).
When I open two pages that have some route constraints (like
@page "/{Id:int}"
) in two different tabs and do something that causes a server restart, both tabs reload at the same time and usually at least one fails with the following exception:To Reproduce
There seems to be some race condition in the code handling constraints. If I remove the constraints and keep the route (
@page "/{Id}"
instead of@page "/{Id:int}"
) it works fine.Further technical details
The text was updated successfully, but these errors were encountered: