Skip to content

[browser][wasm] Fix buffered symbol asset loading#127087

Open
elringus wants to merge 1 commit intodotnet:mainfrom
elringus:fix/symbols-buffer
Open

[browser][wasm] Fix buffered symbol asset loading#127087
elringus wants to merge 1 commit intodotnet:mainfrom
elringus:fix/symbols-buffer

Conversation

@elringus
Copy link
Copy Markdown

This fixes SymbolsAsset.buffer handling in the browser runtime and adds a WBT regression test for buffered runtime assets:

  • Fixed the browser loader so symbols assets supplied via buffer are handled correctly, instead of effectively requiring pendingDownload
  • Kept the symbols path working with the existing text-based symbol map loading flow
  • Added BufferedAssetsTest to WasmBasicTestApp that supplies these runtime assets via buffer:
    • dotnetwasm
    • assemblies
    • pdbs
    • symbols
  • Added a matching ModuleConfigTests.BufferedAssetsTest integration test

The 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.

Copilot AI review requested due to automatic review settings April 17, 2026 17:42
@elringus elringus requested a review from pavelsavara as a code owner April 17, 2026 17:42
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 17, 2026
Copy link
Copy Markdown
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

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 symbols assets when provided via buffer (and enabled buffered-response .text() decoding).
  • Added a BufferedAssetsTest scenario to WasmBasicTestApp that assigns buffer for wasm/assemblies/pdbs/symbols during onConfigLoaded.
  • Added a matching ModuleConfigTests.BufferedAssetsTest publish-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.

Comment thread src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js
@elringus
Copy link
Copy Markdown
Author

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?

Found unknown files in C:\helix\work\workitem\e\wbt artifacts\ModuleConfigTests_BufferedAssetsTest_Debug_False_0zxtutco_2je_鿀蜒枛遫䡫煉\App\bin\Debug\net11.0\publish\wwwroot_framework:
dotnet.native.8o3vuf3rfy.js.symbols
Add these to GetAllKnownDotnetFilesToFingerprintMap method

@pavelsavara pavelsavara self-assigned this Apr 18, 2026
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture os-browser Browser variant of arch-wasm labels Apr 18, 2026
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

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 community-contribution Indicates that the PR has been added by a community member os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants