-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[release/10.0] [browser] Generate boot config with hash field instead of integrity #122391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/10.0
Are you sure you want to change the base?
Conversation
# Conflicts: # src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
There was a problem hiding this 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
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 |
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.