Skip to content
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

fix: mpa navigate on ppr dynamic data mpa navigation #75013

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

bradleydsmith
Copy link

@bradleydsmith bradleydsmith commented Jan 17, 2025

What?

Allow dynamic segments in a prefetched PPR page to force an MPA navigation

Why?

Normally when a flight stream encounters an error or an updated build ID in fetchServerResponse it sets the flightData to the page URL which causes a hard MPA navigation in navigate-reducer through the use of handleExternalUrl

However when a page has been prefetched there may be an error when navigating to the page or the build ID may have been updated from a rebuild between the time of prefetching the page and the navigation happening. This causes the flightData to be a string of the URL but it is prevented from doing anything by just early returning in listenForDynamicRequest. This causes all the suspended components to stay in their fallback state and never render the data

How?

Alter the early return in listenForDynamicRequest to abort the task causing a MPA navigation. The case in comment about going from an app router page to a pages page is already handled within navigate-reducer

Resolves #75047

@ijjk
Copy link
Member

ijjk commented Jan 17, 2025

Allow CI Workflow Run

  • approve CI run for commit: 9cd854f

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@bradleydsmith bradleydsmith force-pushed the fix-ppr-navigation-dynamic-mpa-navigation branch from 5e732fa to 0828ea8 Compare January 17, 2025 03:22
@bradleydsmith bradleydsmith force-pushed the fix-ppr-navigation-dynamic-mpa-navigation branch from 0828ea8 to 9cd854f Compare January 17, 2025 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefetched PPR page segments stay suspended when navigated to after a rebuild
2 participants