next.js
95b167e7 - [segment cache]: fix interception route handling (#84497)

Commit
85 days ago
[segment cache]: fix interception route handling (#84497) With `clientSegmentCache` enabled, if you are already on a route that was intercepted/could have been intercepted, and then you navigated to it again, the router would get stuck in a state where it was infinitely suspended on data it would never receive. When no prefetch is available, we assume that the FlightRouterState sent by the server contains everything that is needed to describe the rendering shape of the page. However this isn't quite true: in `walk-tree-with-flight-router-state` (the function that populates prefetch responses), we skip sending down the `__DEFAULT__` segment. As a result, the client would get into a state where it thinks it needs to request data from the server. This updates the code to not special-case `__DEFAULT__` segments. We should separately see how we can restore this optimization to keep those payloads as small as possible, but it causes problems with back/forward nav that need to be investigated.
Author
Parents
Loading