Skip to content

Unify NotFound behavior across render modes #62153

Open
@ilonatommy

Description

@ilonatommy

Problems that we would like to solve:

  • re-execution takes precedence over NotFound rendering,
  • url of page is changed when we're streaming, having the blazor's router,
  • not enough tests for each case, especially custom router tests.

This table presents current implementation for each combination of settings (Description) and actions to fix them (ToDo):

Application Interactivity Content render mode Default router Description ToDo
Global SSR non-streaming With Renderer is setting the status code to 404 and stopping the rendering. Router tries to render 404 fragment but the component invoker decides to finish rendering early and not to flush the response because it expects re-execution. The only way to show 404 page is to re-execute, otherwise we would see a default browser’s not found page: We should flush the response during rendering in component invoker regardless of returned code and re-execution middleware settings.
Per-component SSR non-streaming With Same situation as global interactivity. Row 1 solves it.
Global SSR streaming With We use client side navigation that is same as typical client-based redirection but does not change the browser history if the request came with enhanced navigation switched on. We could investigate different scenarios of 404 on POST request.
Per-component SSR streaming With Same situation as global interactivity. Row 3 solves it.
Global Interactive With Same situation as 1st and 2nd scenario. Row 1 solves it.
Per-component Interactive With Impossible combination. We cannot render interactive page, not having interactivity registered for the application. -
Any SSR non-streaming Without The only way to render 404 page is to re-execute. No action needed.
Any SSR streaming Without Custom Router has to pass NotFoundPageRoute to NavigationManager. Mechanism of passing the route is internal only, enable it publically.

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor Components

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions