cloudflare/vinext

App Router: metadata streaming protocol (slow-to-body, dedup, UA rules, bot 307) not implemented

Chiusa

#1451 aperta il 22 mag 2026

 (0 commenti) (0 reazioni) (0 assegnatari)TypeScript (371 fork)github user discovery
adapter-api-e2ehelp wanted

Metriche repository

Star
 (8563 stelle)
Metriche merge PR
 (Merge medio 1g 1h) (462 PR mergiate in 30 g)

Descrizione

This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-22).

Problem

vinext's metadata renderer does not implement the streaming variant of the App Router metadata protocol. Specifically: (1) slow metadata is not delayed and emitted into <body> (it appears in <head> instead, or is duplicated); (2) metadata.streamingMetadata UA rules that should disable streaming for headless-browser bots are not respected; (3) html-limited bot user agents that hit a server-component redirect() should receive a blocking HTTP 307, but vinext returns 200 because the streaming path swallows the redirect.

delay the metadata render to body: Expected: 0 Received: 1 (head)
dynamic api: render metadata to body Expected: 0 Received: 1
should load the initial html without slow metadata during navigation: Expected: "slow page" Received: "index page"
should send streaming response for headless browser bots: Expected: 0 Received: 1
html limited bots access redirect: Expected: 307 Received: 200

Estimated Impact

~8 test failures across the deploy suite.

Affected Test Suites

  • test/e2e/app-dir/metadata-streaming/metadata-streaming.test.ts (7 failures)
  • test/e2e/app-dir/metadata-streaming/metadata-streaming-customized-rule.test.ts

Recommendation

  1. Reproduce first in vinext's own test suite. Add tests for (a) slow generateMetadata being rendered into <body> rather than <head>, (b) a custom UA rule disabling streaming for headless bots, (c) a redirect inside generateMetadata returning 307 for an html-limited bot UA. Confirm each fails.

  2. Study Next.js metadata streaming. Search .nextjs-ref/packages/next/src/server/app-render/metadata.tsx and related files for the streaming protocol: when metadata is split between head and body, the bot detection table, and the redirect-blocking logic.

  3. Implement streaming, dedup, UA rules, and redirect blocking. Stream slow metadata into <body> with a deduplication marker, respect metadata.streamingMetadata rules to disable streaming for specific UAs, and emit a blocking 307 when an html-limited bot hits a redirect() inside metadata.

  4. Add coverage for parallel routes and edge runtime. Confirm the streaming path works alongside #1341 (parallel-routes metadata) and the edge runtime path that owns vary headers.

Guida contributor