fix: respect metadata streaming policy in Edge SSR (#99128)
## Summary Edge App Router SSR always enabled streaming metadata, so requests matching the default HTML-limited bot list could receive an initial `<head>` without their delayed metadata. Use the same user-agent-based metadata policy as Node SSR so matching requests receive their metadata before `</head>`. Add regression coverage asserting the default streaming and blocking behavior in both Edge and Node runtimes. Twitterbot and TelegramBot receive their metadata in the initial head; ChatGPT-User, GPTBot, ClaudeBot, and browser requests continue to stream metadata. Also verify that delayed metadata eventually arrives in both runtimes. The default bot list is unchanged, and the tests do not override `htmlLimitedBots`. Related to #98748; this addresses the Edge runtime bug without making assumptions about how these bots consume streamed responses. ## Verification - Production regression suite: 14 tests passed with Webpack and 14 with Turbopack. - Full native bootstrap failed at `cargo metadata`; JavaScript build succeeded. Tests used the installed SWC 16.4.0-canary.38 binary with Next.js 16.4.0-canary.40. <!-- NEXT_JS_LLM -->
Showing
Please
register
or
sign in
to comment