mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
eee5695968
- Blocking round-trip fix: full snapshot metadata now survives postgres and vercel via the snapshot envelope (see the world-side commit on quickjs-vm-snapshots) — the load gate no longer rejects every snapshot on production worlds. - world.snapshots is optional: the entrypoint feature-detects and forces the threshold to 0 when absent (pure full replay, always correct). - Engine-build pin: quickjs-wasi's version is baked into the generated assets module, stamped into snapshot metadata (engineVersion), and compared on load — the QJSS heap header is identical across builds, so a cross-build restore would execute as undefined behavior (live hazard mid-rollout). Mismatch = clean miss. - Deterministic clock high-water (clockMs) persists in metadata and primes the restored VM's clock — Date.now() no longer regresses to run-creation time until the first delta event. - Snapshot compression truly off the response path: the waitUntil IIFE yields past the current tick before touching bytes, and compress() gains preferAsync (zstd via the libuv threadpool with sync fallback; identical output bytes) so a multi-MB heap no longer blocks the loop. - restoredEventCount resets when a restore fails and the fallback refetches the full log — the ceiling no longer double-counts pre-snapshot events, and the next save no longer stamps an inflated eventCount. - Size-ceiling latch: a run whose heap once exceeded MAX_SNAPSHOT_PLAINTEXT_BYTES skips future captures outright (linear memory never shrinks), instead of re-paying two full heap copies per suspension to discard the result.
@workflow/world
Core interfaces and types for Workflow SDK storage backends.
This package defines the World interface that abstracts workflow storage, queuing, authentication, and streaming operations. Implementation packages like @workflow/world-local and @workflow/world-vercel provide concrete implementations.
Used internally by @workflow/core and world implementations. Should not be used directly in application code.