Skip to content

Auto mode can lead to running Server and WebAssembly in the page at the same time #50686

Closed
@SteveSandersonMS

Description

@SteveSandersonMS

Scenario:

  • Page starts and activates some Auto components. They resolve as Server.
  • In the background, wasm assets get downloaded
  • User does enhanced nav to another page. Some components are retained, and some new Auto ones are added.
  • The new Auto ones resolve as WebAssembly and start up on that runtime, and the retained Server components continue running on Server. So now both modes are in use in the page at the same time.

This could be a potential source of hard-to-repro and hard-to-fix bugs. For example, if the app uses an AppState-like pattern, where some DI service is used to broker messages/events across components, then now all the Server components will talk to each other, and all the WebAssembly components will talk to each other, but no messages/events will span the two silos. This is particularly confusing because the app will work fine if the user refreshes the page, or if their network is so slow it never downloads WebAssembly.

Possibly an even more concrete scenario:

  • HeadOutlet is Auto and resolves as Server
  • Some pages are Auto and initially resolve as Server but later resolve as WebAssembly, at which point the page title stops updating (at least, it can no longer update dynamically between navigations, e.g., when incrementing a counter)

Possible resolution

For as long as there's at least one live Server root component in the page, we could continue to resolve Auto as Server.

Metadata

Metadata

Labels

area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions