Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

BlazorWebTemplate_ConditionalPasskeyRegistration reads response body after navigation

Open Beginner friendly
#69,494 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, playwright
Domain
testing-qa

Research direction

Start in src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorWebTemplateTest.cs around line 266 and inspect BlazorWebTemplate_ConditionalPasskeyRegistration. Read the response text immediately after upgradeResponseTask completes, before waiting for or triggering later navigation, then use the retained text for the existing assertions. Run the affected Blazor template test and confirm the intermittent Network.getResponseBody failure is gone.

Written by the indexing model from the issue text.

Description

area-identity feature-playwright 🎭 test-failure

Description

BlazorWebTemplate_ConditionalPasskeyRegistration intermittently fails on Windows because the test reads a Playwright IResponse body after the page has navigated away from that response.

The generated application appears to complete the passkey flow correctly. The failure occurs later while the test inspects the captured HTML response.

Failure

Microsoft.Playwright.PlaywrightException: Protocol error (Network.getResponseBody): No resource with given identifier found
Response body is not available for a response that was navigated away from. Read response.body() before triggering any navigation.

   at Microsoft.Playwright.Core.Response.BodyAsync()
   at Microsoft.Playwright.Core.Response.TextAsync()
   at BlazorTemplates.Tests.BlazorWebTemplateTest.BlazorWebTemplate_ConditionalPasskeyRegistration(...)
      in /_/src/ProjectTemplates/test/Templates.Blazor.Tests/BlazorWebTemplateTest.cs:line 266

The failing line is:

var redisplayedPage = await upgradeResponse.TextAsync();

Observed failures

Build PR Theory case
1610717 #69441 Failure / Success
1610395 #69461 DatabaseFailure / Success
1608370 #67553 Failure / Success
1607585 #69422 Failure / Unsupported

For builds 1610395 and 1608370, the published Templates.Blazor.Tests_net11.0_x64.xml contains 27 tests with 26 passing and this as the only failure.

Cause

The test captures the first /Account/PasskeyUpgrade response, but does not read its body immediately:

var upgradeResponseTask = page.WaitForResponseAsync(...);
await page.GetByRole(...).ClickAsync();
var upgradeResponse = await upgradeResponseTask;
await page.WaitForURLAsync(returnUrl, ...);

The browser then performs another upgrade request and navigates back to returnUrl. The test performs additional page and server-state checks before finally calling upgradeResponse.TextAsync(). Chromium can discard the original response body once navigation occurs, producing Network.getResponseBody: No resource with given identifier found.

A representative successful server sequence before the exception is:

POST /Account/PasskeyUpgrade -> 200 text/html
POST /Account/PasskeyUpgrade -> 302
GET /auth?... -> 200 text/html
GET /test/passkeys -> 200 application/json
Network.getResponseBody fails while reading the earlier 200 response

This test and ordering were introduced in #68194. The affected builds belong to unrelated PRs, supporting that this is a shared test race rather than a product regression in those PRs.

Suggested fix

Read and retain the response text immediately after upgradeResponseTask completes and before waiting for or triggering subsequent navigation. Use the retained string for the later assertions.

Dominant language
C#
Stars
38.5k
Forks
12.5k
Avg merge
2d 4h
Merged PRs (30d)
217

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/aspnetcore

All issues in dotnet/aspnetcore

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.