Skip to content

Fix AutoPause JS initializer fingerprinting - #69927

Merged
ilonatommy merged 4 commits into
mainfrom
ilonatommy-fix-autopause-initializer-fingerprinting
Oct 22, 2026
Merged

ilonatommy merged 4 commits into
mainfrom
ilonatommy-fix-autopause-initializer-fingerprinting

Conversation

@ilonatommy

@ilonatommy ilonatommy commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

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-cache endpoint.

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:

Image

After:

Image

Tests check:

  • The package contains the fingerprinted initializer, immutable endpoint, import-map label, and original no-cache endpoint.
  • The package contains no unintended content/ or contentFiles/ entries.
  • The browser resolves and requests the fingerprinted initializer through the import map.

Alternative fix considered

Keep the custom registration and pass the missing fingerprinting inputs to DefineStaticWebAssets:

FingerprintCandidates="$(StaticWebAssetsFingerprintContent)"
FingerprintPatterns="@(StaticWebAssetFingerprintPattern)"

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

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
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Oct 19, 2026
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@ilonatommy
ilonatommy marked this pull request as ready for review October 20, 2026 10:08
@ilonatommy
ilonatommy requested a review from a team as a code owner October 20, 2026 10:08
@ilonatommy
ilonatommy requested a review from maraf October 20, 2026 10:08
ilonatommy and others added 2 commits October 22, 2026 12:54
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
@ilonatommy
ilonatommy requested a review from maraf October 22, 2026 11:30
@ilonatommy
ilonatommy enabled auto-merge (squash) October 22, 2026 11:30
@ilonatommy
ilonatommy merged commit 6e62760 into main Oct 22, 2026
32 checks passed
@ilonatommy
ilonatommy deleted the ilonatommy-fix-autopause-initializer-fingerprinting branch October 22, 2026 12:34
@akoeplinger

Copy link
Copy Markdown
Member

@maraf @ilonatommy should we backport it?

@github-actions

Copy link
Copy Markdown
Contributor

✅ 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

  • Conceptual article: Not required — Internal MSBuild change to how AutoPause JS assets are registered for fingerprinting; no public API, config, or documented behavior change.
  • Migration guidance: Not required — No user action needed when upgrading.
  • Breaking change: Not required — No compatibility impact evident.

@ilonatommy

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

@ilonatommy backporting to release/11.0 failed, the patch most likely resulted in conflicts. Please backport manually!

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

Link to workflow output

wtgodbe pushed a commit that referenced this pull request Nov 3, 2026
…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
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — a08e37ed Deployed Oct 22, 2026 by ilonatommy via conclusion #87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AutoPause JS initializer has no fingerprinted endpoint, so it is revalidated on every page load

4 participants