[browser][wasm] Fix buffered symbol asset loading#127087
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes buffered symbols runtime asset loading in the browser WASM loader, and adds a regression scenario in WBT to exercise supplying runtime assets via asset.buffer.
Changes:
- Adjusted asset instantiation flow to correctly handle
symbolsassets when provided viabuffer(and enabled buffered-response.text()decoding). - Added a
BufferedAssetsTestscenario toWasmBasicTestAppthat assignsbufferfor wasm/assemblies/pdbs/symbols duringonConfigLoaded. - Added a matching
ModuleConfigTests.BufferedAssetsTestpublish-and-run integration test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js | Adds the BufferedAssetsTest scenario that supplies runtime assets via asset.buffer. |
| src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs | Adds an integration test that publishes and runs the new scenario (with symbol map emission enabled). |
| src/mono/browser/runtime/loader/assets.ts | Fixes loader handling for buffered symbols assets and implements .text() for buffered-response shim. |
|
It seems the fingerprint stuff doesn't support file names with hashes. Is it somehow possible to generate the symbols file without the hash? Or maybe I should also patch the fingerprint resolver to ignore the hash on symbols?
|
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
|
|
The thing is, runtime/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs Lines 28 to 48 in 6f2ad2d |
|
I think the logic that asserts the files incorrectly finds where the fingerprint should be, see https://github.com/elringus/dotnet/blob/fix/symbols-buffer/src/mono/wasm/Wasm.Build.Tests/ProjectProviderBase.cs#L116 ( |
|
Would it be ok to add a special case for |
@maraf is that what you mean ? |
|
@maraf All green now. Let me know if any tweaks are required. |
maraf
left a comment
There was a problem hiding this comment.
Looks good to me 👍
Thank you for the contribution!
LGTM, thanks! @elringus |
|
/ba-g unrelated failures |

This fixes
SymbolsAsset.bufferhandling in the browser runtime and adds a WBT regression test for buffered runtime assets:symbolsassets supplied viabufferare handled correctly, instead of effectively requiringpendingDownloadBufferedAssetsTesttoWasmBasicTestAppthat supplies these runtime assets viabuffer:dotnetwasmModuleConfigTests.BufferedAssetsTestintegration testThe issue was discussed with @pavelsavara on .NET's Discord server.
Note: I was not able to run the browser test end-to-end in the local environment due local WBT/workload packaging setup issues. If anything fails on CI, I’ll follow up and fix the remaining issues there.