fix: mpa navigate on ppr dynamic data mpa navigation #75013
+23
−27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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