Skip to content

Conversation

@maraf
Copy link
Member

@maraf maraf commented Dec 10, 2025

Backport of #122353 to release/10.0 to fix #121876

/cc @maraf

Customer Impact

  • Customer reported
  • Found internally

Requests to WebAssembly resources were missing integrity attribute, which is in our case used as a safety mechanism against stale cache. Since by default all assets are fingerprinted, we do not rely on the integrity validation, but we still have it in the public API for asset loading.

Regression

  • Yes
  • No

Caused by #116300

Testing

Automated and manual test.

Risk

Low. The change renames generated field from unexpected value to a correct one. Since the content is embedded in the file from runtime pack, there is no room for inconsistency due to stale cache.

# Conflicts:
#	src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs
@maraf maraf added this to the 10.0.x milestone Dec 10, 2025
@maraf maraf self-assigned this Dec 10, 2025
@maraf maraf requested a review from ilonatommy as a code owner December 10, 2025 16:34
Copilot AI review requested due to automatic review settings December 10, 2025 16:34
@maraf maraf added Servicing-consider Issue for next servicing release review arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm labels Dec 10, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a backport from the main branch that corrects a regression in WebAssembly boot configuration generation. The change renames the integrity field to hash in boot config asset definitions to properly support integrity checking for WebAssembly resource requests.

Key Changes:

  • Renamed integrity property to hash in three asset classes (WasmAsset, GeneralAsset, VfsAsset)
  • Updated all property assignments in the boot JSON builder to use the new field name
  • Added a new test case to verify that non-.js and non-.json assets have hash values populated

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonData.cs Renamed integrity property to hash in WasmAsset, GeneralAsset, and VfsAsset data contract classes
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs Updated all property assignments from integrity to hash when constructing asset objects
src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js Added new "AssetIntegrity" test case that logs integrity values for all loaded assets
src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs Added AssetIntegrity test that validates non-.js/non-.json assets have non-empty integrity/hash values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Build-mono os-browser Browser variant of arch-wasm Servicing-consider Issue for next servicing release review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants