Skip to content

Conversation

@MackinnonBuck
Copy link
Member

@MackinnonBuck MackinnonBuck commented Jun 9, 2023

[Blazor WASM] Don't apply hot reload deltas if Blazor has not been initialized

Backport of #33122.

Fixes an issue where hot reload fails if the browser receives hot reload deltas before Blazor WebAssembly initializes.

Description

If this bug occurs when debugging with Visual Studio, an exception message like the following gets shown:

screenshot

This forces the customer to restart the app for hot reload to continue working.

The fix simply ignores the received deltas if Blazor has not been initialized to the point where it's ready to apply hot reload updates. Blazor already has logic to apply all previously received hot reload updates upon initialization, so the changes will take effect anyway as soon as Blazor completes its boot procedure.

Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1779975

Customer Impact

Moderate. This exception can be triggered easily when debugging web apps that load Blazor WebAssembly only on specific pages. For apps completely written in Blazor WebAssembly, the exception is more difficult to encounter.

If the bug is encountered, a full app restart is required to use hot reload again.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

The fix is straightforward and unlikely to introduce a new regression.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@MackinnonBuck MackinnonBuck added Servicing-consider Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch labels Jun 9, 2023
@MackinnonBuck MackinnonBuck requested a review from mkArtakMSFT June 9, 2023 23:46
@ghost
Copy link

ghost commented Jun 9, 2023

Thanks for your PR, @MackinnonBuck.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@ghost ghost added the untriaged Request triage from a team member label Jun 9, 2023
@mkArtakMSFT mkArtakMSFT added Servicing-approved and removed Servicing-consider untriaged Request triage from a team member labels Jun 12, 2023
@MackinnonBuck MackinnonBuck merged commit f949be7 into release/6.0.4xx Jun 13, 2023
@MackinnonBuck MackinnonBuck deleted the mbuck/backport-33122-to-6.0.4xx branch June 13, 2023 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch Servicing-approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants