mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
916fcf0833
The dev HMR log line for a rebuild is written at classification time, before the (potentially multi-second) rebuild runs. A reader counting lines in a window has no way to tell 'quiet' from 'rebuild in flight with queued events behind it', and the e2e HMR tests count lines in exact windows: on CI, where rebuilds take 5-12s, a write from a previous test case (or a teardown restore) can still be rebuilding when the next window opens, and its legitimate rebuild lines land inside that window - observed on main as the fuzz test failing both retry attempts with 'expected 2 to be 1'. The dev server now also logs 'workflow dev hmr: rebuild complete' when a rebuild finishes processing (in a finally, so an erroring rebuild cannot wedge readers; behind WORKFLOW_DEV_HMR_LOGS like every hmr line). The e2e suite uses it to drain to quiescence - every started rebuild completed, plus a short quiet window covering watcher latency and the flush debounce - before taking a log cursor. Every cursor call site writes only after taking its cursor, so draining there cannot swallow lines a test means to count. Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
128 B
128 B
@workflow/next
| @workflow/next |
|---|
| patch |
Dev HMR logging (WORKFLOW_DEV_HMR_LOGS=1) now also logs workflow dev hmr: rebuild complete