mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What Client-side transitioning to a page that triggered a loading boundary with async metadata would cause the transition to stall, potentially getting stuck in a refetch loop. ### Why In layout-router, we trigger a "lazy fetch" when we encounter a segment that we don't have cache nodes for. This calls out to the server and suspends until the data fetch is resolved, and applied to the router tree. However after suspending but before updating the client router, we set `childNode.lazyData` to null. When we unsuspend from the server patch action, `childNode.rsc` might still be missing and clearing `lazyData` means we've blown away the reference to the fetch we already had pending, triggering a refetch loop. ### How This removes the logic that mutates the cache node in render, as this is not concurrent safe, and doesn't appear to be needed for anything. Fixes #61117 Closes NEXT-2361 --------- Co-authored-by: Jiachi Liu <[email protected]>
19 lines
438 B
JavaScript
19 lines
438 B
JavaScript
import React from 'react'
|
|
|
|
// ensure this page is dynamically rendered so we always trigger a loading state
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
export default function page() {
|
|
return <div id="page-content">Content</div>
|
|
}
|
|
|
|
async function getTitle() {
|
|
return await new Promise((resolve) =>
|
|
setTimeout(() => resolve('Async Title'), 1000)
|
|
)
|
|
}
|
|
|
|
export async function generateMetadata() {
|
|
return { title: await getTitle() }
|
|
}
|