BlazorWebTemplate_ConditionalPasskeyRegistration reads response body after navigation
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
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
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/aspnetcore
-
area-networking
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dotnet/aspnetcore#69671 · 1 comment ·
Maintainers usually reply within 1 day
-
.NET 10 OpenAPI emits an object constraint for floating-point valuesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
dotnet/aspnetcore#69604 · 1 comment ·
Maintainers usually reply within 1 day
-
Clarify Copilot guidance for framework-only invariants vs user-reachable validationPossibly taken @javiercn claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/aspnetcore#69586 ·
Maintainers usually reply within 1 day
-
`EF Core UserStore.CreateUserPasskey` does not set `Aaguid`, so it's lost on passkey creationPossibly taken @MuhammadBilal64 claimed this 5 days ago. Openarea-identity
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
dotnet/aspnetcore#69495 · 1 comment ·
Maintainers usually reply within 1 day
-
Blazor reconnect modal uses white instead of the system Canvas colorPossibly taken @oroztocil claimed this 15 days ago. Openarea-blazor feature-accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dotnet/aspnetcore#69387 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in dotnet/aspnetcore
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
MicrosoftLearning/PL-400_Microsoft-Power-Platform-Developer#231 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
joinrpg/joinrpg-net#5313 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day