Repository navigation
fix: Resolve the published dotnet.js from the endpoints manifest - #1098
Conversation
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Missing-manifest-asset handling can still select a stale runtime, and the required specification is absent.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Resolves stale dotnet.js selection by using the SDK endpoints manifest and adds validation coverage.
Changes:
- Adds manifest-based fingerprint resolution with fallback diagnostics.
- Adds unit, integration, and CI test coverage.
- Documents dirty publish-directory behavior.
| File | Description |
|---|---|
test-fingerprint.sh |
Tests repeated publishing. |
ResolvePublishedDotnetJsTask.cs |
Integrates manifest resolution with MSBuild. |
DotnetJsResolver.cs |
Implements fingerprint selection. |
Uno.Wasm.Bootstrap.targets |
Uses the resolver during publish. |
Uno.Wasm.Bootstrap.UnitTests.csproj |
Migrates to MSTest.Sdk. |
Given_DotnetJsResolver.cs |
Tests resolver behavior. |
features-dotnetjs-fingerprinting.md |
Documents resolution and diagnostics. |
stage-build-packages.yml |
Runs bootstrap unit tests in CI. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Publishing into a directory that wasn't cleaned leaves dotnet.*.js files from earlier publishes in _framework. The publish target globbed them and kept the last match, so uno-config.js could point at a previous build's runtime while the existence check still passed. Read the SDK's *.staticwebassets.endpoints.json instead, which every publish rewrites and which maps _framework/dotnet.js to the current file. Without a manifest, a single candidate is trusted; several produce UNOWASM003 and the newest is used. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N5azy6DU7ujLte16VPVYQs
Uno.Wasm.Bootstrap.UnitTests used the VSTest runner, which global.json's Microsoft.Testing.Platform setting rejects, and no pipeline ran it. Move it to MSTest.Sdk like the VersionChecker tests and run it in the packages stage. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N5azy6DU7ujLte16VPVYQs
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N5azy6DU7ujLte16VPVYQs
Fail when the mapped file is missing instead of using a stale candidate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
4208749 to
c6a1df4
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1098.eastus2.1.azurestaticapps.net |
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
A manifest left behind by a renamed project, or another project published to the same directory, could map dotnet.js to a stale file that still exists. The project's own manifest now wins when it maps dotnet.js; the others are only used otherwise, newest first. A manifest that isn't valid JSON is ignored with UNOWASM005 instead of failing the build. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-river-0087b630f-1098.eastus2.1.azurestaticapps.net |


Fixes #1089
What changed
Publishing into a folder that wasn't cleaned leaves
dotnet.*.jsfiles from earlier publishes in_framework._UnoUpdateDotnetJsFingerprintPublishOutputglobbed them and kept the last match, souno-config.jscould name a previous build'sdotnet.js. The app then ran the old runtime and assemblies, andUNOWASM002didn't catch it since the stale file exists.ResolvePublishedDotnetJsTask_v0reads the SDK's*.staticwebassets.endpoints.json. Every publish rewrites it, and it maps the_framework/dotnet.jsroute to the currentdotnet.<fingerprint>.js. In .NET 10 the nested AOT publish runs inside the publish pipeline, before the manifest is written, so it holds for AOT too.UNOWASM003and uses the newest, which is best effort only.Uno.Wasm.Bootstrap.UnitTestsused the VSTest runner, whichglobal.json's Microsoft.Testing.Platform setting rejects, and no pipeline ran it. It now usesMSTest.Sdk, like the VersionChecker tests, and runs in the packages stage. All 55 existing and new tests pass.UNOWASM003.Validation
New Test 9 in
test-fingerprint.sh: publish with-p:Version=2.0.0,1.0.0,3.0.0,1.0.0into the same folder, then assertuno-config.jsnames thedotnet.jsthe endpoints manifest maps. The sequence ends on a revert, whose unchanged file keeps an old timestamp, so a "newest file" heuristic would fail it too.uno-config.jsnameddotnet.ir6qu6j5lh.js, while the manifest mappeddotnet.cnla3mvfkt.js.Given_DotnetJsResolver) cover the manifest, base path routes, a missing file and unfingerprinted outputs.Related, not changed here: the WebWorker path has the same dirty-folder problem in the worker project's own publish folder. Its existing check fails the build with
UNOWA0011instead of picking a wrong file.🤖 Generated with Claude Code
https://claude.ai/code/session_01N5azy6DU7ujLte16VPVYQs