Skip to content

Capture passkey upgrade HTML before automatic navigation - #70362

Merged
mmitche merged 4 commits into
dotnet:mainfrom
mmitche:mmitche-ci-flakiness-triage
Nov 7, 2026
Merged

mmitche merged 4 commits into
dotnet:mainfrom
mmitche:mmitche-ci-flakiness-triage

Conversation

@mmitche

@mmitche mmitche commented Nov 6, 2026

Copy link
Copy Markdown
Member

Capture passkey upgrade HTML before automatic navigation

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Retain passkey upgrade HTML before its automatic continuation can navigate.

Description

BlazorWebTemplate_ConditionalPasskeyRegistration reads the first upgrade response after the page has submitted its continuation form and navigated away. Chromium can discard that response body, producing the Network.getResponseBody error documented in dotnet/aspnetcore#69494.

For the failure cases that inspect redisplayed HTML, fetch and retain the first POST response before fulfilling the original browser request. Do not follow redirects during capture; leave GETs and subsequent POSTs on the normal browser path. Preserve the existing status, request, cookie, credential, signaling, and final-navigation assertions. All eight existing theory rows remain; no production code, retry, delay, timeout, or quarantine changes.

Simply moving the body read after the login click would still race the page's automatic navigation. Capturing before delivery provides an explicit ordering guarantee.

Validation

  • node <session-files>\passkey-response-repro.cjs — passed using installed Edge/Chromium 155 and cached Playwright 1.61.0, a loopback server, and the actual template PasskeySubmit.razor.js. Baseline: 12/12 runs reproduced the body-read error. Capture: 12/12 passed, covering successful, rejected, pending, and unsupported signaling. Checked initial GET/query handling, continuation POST, cookie deletion, credential-field removal, original response status, redirect, and final page.
  • & <session-files>\validate-passkey-capture.ps1 — passed; the exact C# capture block compiles with nullable checks and warnings as errors against cached Playwright 1.61.0 and existing .NET 10 references.
  • git -c core.longpaths=true diff --check — passed.
  • . .\activate.ps1; dotnet --version — blocked: repository SDK 12.0.100-alpha.1.26531.102 is not installed. No tools were installed.
  • Not run: BlazorWebTemplate_ConditionalPasskeyRegistration in the generated ASP.NET application. The repository SDK and matching built product/template artifacts are unavailable. The browser reproduction does not validate persistence or the eight complete C# theory rows, and the API probe does not replace a project build against pinned Playwright 1.62.0. This draft does not claim verified CI remediation.

Tradeoff: a small test-only interception is justified by repeated documented failures and a reproduced browser-lifetime mechanism. It retains all failure detection instead of adding retries or weakening assertions. The added response-path complexity is bounded to one response in affected rows; complete generated-application validation remains required before treating the flake as fixed.

Originally prepared in mmitche/AspNetCore#8, now submitted against upstream main at the user's request. Implementation and review were assisted by GitHub Copilot.

Fixes #69494

Retain the first failed-persistence response before the browser can submit its continuation. Preserve the existing request, cookie, signaling, and navigation assertions.

Co-authored-by: Copilot App <[email protected]>
@github-actions github-actions Bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Nov 6, 2026
@mmitche
mmitche marked this pull request as ready for review November 6, 2026 16:32
@mmitche
mmitche requested review from wtgodbe and a balanced review from Copilot November 6, 2026 16:32

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

All eight generated-application theory rows remain unexecuted against pinned Playwright 1.62.0, so the new interception still needs human integration validation of cookie handling, continuation requests, and final navigation.

No open issues 🎉

What changed in this PR

Addresses #69494 by retaining passkey-upgrade response HTML before automatic navigation can make it unavailable to the Blazor template test.

Changes:

  • Intercepts the first upgrade POST in failure cases, captures its body without following redirects, then delivers the response to the browser.
  • Uses the retained HTML for assertions while preserving normal GET and subsequent POST handling, existing assertions, and all eight theory rows.

Full generated-application validation remains outstanding, as noted in the PR description.

File Description
src/​ProjectTemplates/​test/​Templates.Blazor.Tests/​BlazorWebTemplateTest.cs Captures upgrade HTML before delivery and uses it for later assertions.

Review effort: Balanced

@mmitche
mmitche enabled auto-merge (squash) November 6, 2026 22:56
@mmitche
mmitche merged commit 0f43247 into dotnet:main Nov 7, 2026
29 checks passed
@mmitche
mmitche temporarily deployed to copilot-pat-pool November 7, 2026 00:27 — with GitHub Actions Inactive
@mmitche
mmitche temporarily deployed to copilot-pat-pool November 7, 2026 00:27 — with GitHub Actions Inactive
@mmitche
mmitche temporarily deployed to copilot-pat-pool November 7, 2026 00:28 — with GitHub Actions Inactive
@mmitche
mmitche temporarily deployed to copilot-pat-pool November 7, 2026 00:30 — with GitHub Actions Inactive
@mmitche
mmitche temporarily deployed to copilot-pat-pool November 7, 2026 00:31 — with GitHub Actions Inactive
@mmitche
mmitche temporarily deployed to copilot-pat-pool November 7, 2026 00:31 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ No documentation PR was created.

Confidence that documentation is needed: 2%

No docs needed: test infrastructure change only (BlazorWebTemplateTest.cs); PR states no production code changes.

Documentation surfaces considered

  • Conceptual article: Not required — Only a project template test file changed; no user-visible behavior.
  • Migration guidance: Not required — No upgrade action for users.
  • Breaking change: Not required — No compatibility impact; test-only.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — a5f9b0e3 Deployed Nov 7, 2026 by mmitche via conclusion #231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BlazorWebTemplate_ConditionalPasskeyRegistration reads response body after navigation

3 participants