8000 Fix NotFoundSetOnFormSubmit_ResponseNotStarted_SSR test and enhanced navigation timing issue by Copilot · Pull Request #62541 · dotnet/aspnetcore · GitHub
[go: up one dir, main page]

Skip to content

Fix NotFoundSetOnFormSubmit_ResponseNotStarted_SSR test and enhanced navigation timing issue #62541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor
@Copilot Copilot AI commented Jul 2, 2025

This PR addresses a timing issue in enhanced navigation where NotFound calls made synchronously could reach the enhanced navigation code before proper initialization, causing undefined access errors.

Changes Made

1. Test URL Correction

Fixed NotFoundSetOnFormSubmit_ResponseNotStarted_SSR test to use the correct URL:

  • Before: /post-not-found-ssr-streaming (streaming enabled)
  • After: /post-not-found-ssr (streaming disabled)

The test name explicitly mentions "ResponseNotStarted" which should test non-streaming scenarios where the response hasn't started streaming yet.

2. Enhanced Navigation Timing Fix

The core issue was a race condition where synchronous NotFound calls could trigger performEnhancedPageLoad before navigationEnhancementCallbacks was initialized.

Root Cause: When forms submit and immediately call NotFound, the enhanced navigation code path executes before the boot function completes initialization.

Solution:

  • Moved enhanced navigation initialization earlier in the boot function
  • Changed navigationEnhancementCallbacks from direct assignment to a promise-based pattern
  • performEnhancedPageLoad now awaits the callbacks promise, ensuring they're available before use

Fixes #62540.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Contributor

Greetings human! You've submitted a PR that modifies code that is shared with https://github.com/dotnet/runtime . Please make sure you synchronize this code with the changes in that repo!

@github-actions github-actions bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Jul 2, 2025
…ce navigation timing

Co-authored-by: ilonatommy <32700855+ilonatommy@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Fix NotFoundSetOnFormSubmit_ResponseNotStarted_SSR test Fix NotFoundSetOnFormSubmit_ResponseNotStarted_SSR test and enhanced navigation timing issue Jul 2, 2025
@Copilot Copilot AI requested a review from ilonatommy July 2, 2025 13:52
Copilot finished work on behalf of ilonatommy July 2, 2025 13:52
…/else logic in NotFoundSetOnFormSubmit_ResponseNotStarted_SSR test

Co-authored-by: ilonatommy <32700855+ilonatommy@users.noreply.github.com>
@Copilot Copilot AI requested a review from ilonatommy July 2, 2025 14:09
Copilot finished work on behalf of ilonatommy July 2, 2025 14:09
@ilonatommy ilonatommy requested a review from pavelsavara July 2, 2025 14:15
@ilonatommy ilonatommy added area-blazor Includes: Blazor, Razor Components and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels Jul 2, 2025
@ilonatommy ilonatommy removed the request for review from pavelsavara July 3, 2025 08:26
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 Attention: Shared Code Modified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix NotFoundSetOnFormSubmit_ResponseNotStarted_SSR test
2 participants
0