[release/10.0] [browser] Generate boot config with hash field instead of integrity#122391
Open
maraf wants to merge 3 commits intodotnet:release/10.0from
Open
[release/10.0] [browser] Generate boot config with hash field instead of integrity#122391maraf wants to merge 3 commits intodotnet:release/10.0from
maraf wants to merge 3 commits intodotnet:release/10.0from
Conversation
# Conflicts: # src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Contributor
There was a problem hiding this comment.
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
integrityproperty tohashin 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 |
pavelsavara
approved these changes
Dec 10, 2025
lewing
approved these changes
Dec 10, 2025
javiercn
approved these changes
Dec 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #122353 to release/10.0 to fix #121876
/cc @maraf
Customer Impact
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
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.