Repository navigation
Fix AutoPause JS initializer fingerprinting - #69927
Conversation
Pass SDK fingerprinting inputs to AutoPause static web asset discovery and cover packaged endpoints and browser import-map resolution. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8138bb5f-ffb4-4381-83e2-ac74a92bb4f4
Collect generated bundles before SDK discovery and skip collection during no-build packing to avoid raw NuGet content. Add package regression coverage. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8138bb5f-ffb4-4381-83e2-ac74a92bb4f4
There was a problem hiding this comment.
🔵 Needs a closer look
No confirmed defects were identified, but SDK discovery, packaging, and browser behavior remain unverified by execution.
No open issues 🎉
What changed in this PR
Enables SDK fingerprinting for the AutoPause JavaScript initializer, addressing repeated browser revalidation.
Changes:
- Replaces manual asset registration with SDK-discovered linked content.
- Excludes generated content during no-build packing.
- Adds package-layout and browser regression tests.
| File | Description |
|---|---|
| src/Components/WebView/test/StaticWebAssets/PackageLayoutTests.cs | Checks fingerprinted endpoints, cache headers, labels, and package contents. |
| src/Components/WebView/test/StaticWebAssets/Microsoft.AspNetCore.Components.WebView.StaticWebAssets.Tests.csproj | Includes AutoPause in package validation. |
| src/Components/test/E2ETest/ServerRenderingTests/ResourceCollectionTest.cs | Checks browser requests for the fingerprinted initializer. |
| src/Components/Server.AutoPause/src/Microsoft.AspNetCore.Components.Server.AutoPause.csproj | Uses SDK asset discovery with a no-build packing guard. |
Review effort: Balanced
Check resource timing entries directly for the fingerprinted initializer instead of parsing the import map. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8138bb5f-ffb4-4381-83e2-ac74a92bb4f4
Keep the physical fingerprinted static web asset assertion without pinning SDK-generated traits, endpoint metadata, or cache-header formatting. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8138bb5f-ffb4-4381-83e2-ac74a92bb4f4
|
@maraf @ilonatommy should we backport it? |
|
✅ No documentation PR was created. Confidence that documentation is needed: 5% No docs needed: build/packaging fix and tests only (csproj and PackageLayoutTests.cs). Documentation surfaces considered
|
|
/backport to release/11.0 |
|
Started backporting to |
|
@ilonatommy backporting to git am output$ git cherry-pick 6e62760191a731f63d79b49fad7eda0aaf855cf3
Auto-merging src/Components/Server.AutoPause/src/Microsoft.AspNetCore.Components.Server.AutoPause.csproj
Auto-merging src/Components/WebView/test/StaticWebAssets/Microsoft.AspNetCore.Components.WebView.StaticWebAssets.Tests.csproj
CONFLICT (content): Merge conflict in src/Components/WebView/test/StaticWebAssets/Microsoft.AspNetCore.Components.WebView.StaticWebAssets.Tests.csproj
Auto-merging src/Components/WebView/test/StaticWebAssets/PackageLayoutTests.cs
error: could not apply 6e62760191... Fix AutoPause JS initializer fingerprinting (#69927)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix AutoPause initializer fingerprinting
Using index info to reconstruct a base tree...
M src/Components/Server.AutoPause/src/Microsoft.AspNetCore.Components.Server.AutoPause.csproj
M src/Components/WebView/test/StaticWebAssets/Microsoft.AspNetCore.Components.WebView.StaticWebAssets.Tests.csproj
M src/Components/WebView/test/StaticWebAssets/PackageLayoutTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Components/Server.AutoPause/src/Microsoft.AspNetCore.Components.Server.AutoPause.csproj
Auto-merging src/Components/WebView/test/StaticWebAssets/Microsoft.AspNetCore.Components.WebView.StaticWebAssets.Tests.csproj
CONFLICT (content): Merge conflict in src/Components/WebView/test/StaticWebAssets/Microsoft.AspNetCore.Components.WebView.StaticWebAssets.Tests.csproj
Auto-merging src/Components/WebView/test/StaticWebAssets/PackageLayoutTests.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix AutoPause initializer fingerprinting
Error: The process '/usr/bin/git' failed with exit code 128 |
…69973) Backport merged commit 6e62760. Resolve the StaticWebAssets test-project conflict using release/11.0 reference and package-output conventions, without importing main-only packaging infrastructure. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 10877a46-ba03-475b-b1f1-13889c3a338a
Fix AutoPause JS initializer fingerprinting
Enable SDK fingerprinting for the AutoPause JavaScript initializer.
Description
AutoPause manually registered its generated JavaScript without the SDK's fingerprinting inputs, leaving the initializer with only a plain
no-cacheendpoint.Replace manual registration with linked Content so normal SDK discovery handles fingerprinting and endpoints. Skip collection during no-build packing, matching SDK discovery's condition and avoiding duplicate raw NuGet content.
Before:
After:
Tests check:
no-cacheendpoint.content/orcontentFiles/entries.Alternative fix considered
Keep the custom registration and pass the missing fingerprinting inputs to
DefineStaticWebAssets:This smaller change also passed the package and browser regression tests. We chose normal SDK discovery instead to avoid maintaining a separate asset/endpoint registration path and automatically inherit the SDK’s fingerprinting behavior.
Fixes #69912