Uh oh!
There was an error while loading. Please reload this page.
[core] Fix spurious "Event cursor missing after initial load" warning - #2056
Conversation
A World may legitimately return `{ data: [], cursor: null, hasMore: false }`
on a trailing empty page — e.g. when the previous page's DynamoDB query hit
`Limit` exactly and returned a `LastEvaluatedKey` "just in case". Overwriting
the cursor with null on that trailing page caused the V2 runtime to fall into
the "Event cursor missing after initial load" branch and do a full event
reload on every replay iteration.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
workflow with 1 step💻 Local Development
▲ Production (Vercel)
workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
workflow with 10 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
workflow with 25 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
workflow with 50 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
workflow with 10 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
workflow with 25 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
workflow with 50 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
Stream Benchmarks(includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
stream pipeline with 5 transform steps (1MB)💻 Local Development
▲ Production (Vercel)
10 parallel streams (1MB each)💻 Local Development
▲ Production (Vercel)
fan-out fan-in 10 streams (1MB each)💻 Local Development
▲ Production (Vercel)
SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
❌ Some benchmark jobs failed:
Check the workflow run for details. |
🧪 E2E Test Results✅ All tests passed Summary
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
✅ 📋 Other
|
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
🦋 Changeset detectedLatest commit: 96a9fc8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Uh oh!
There was an error while loading. Please reload this page.
…adation due to clobbered cursor (#2056) Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Backport PR opened against |
Summary
The V2 runtime's
loadWorkflowRunEventshelper paginates throughworld.events.listand overwrites itscursorvariable on every page. When the final page is empty (data: [], cursor: null, hasMore: false), the helper returnscursor: nulldespite having loaded events — which trips thecachedEvents≠ null +eventsCursor= null branch inruntime.ts, logsEvent cursor missing after initial load — falling back to full reload. This indicates a bug in the World implementation., and forces a full event reload on every subsequent replay iteration.The trailing empty page is a normal, contract-compliant response, not a World bug. workflow-server can produce it whenever an underlying DynamoDB
Queryhits itsLimitexactly — DynamoDB returnsLastEvaluatedKey"just in case", the server passes that through ashasMore: true, and the next call returns an empty page. This is observable in production (38 distinct runs in 24h onagents-vade-reviewalone, each logging the warning multiple times per invocation).Fix is one line: preserve the last non-null cursor across pages.
This mirrors how
runtime.ts:665andruntime.ts:811already treat incremental loads.Test plan
packages/core/src/runtime/helpers.test.ts— added regression tests covering the trailing-empty-page case, multi-page traversal, and incremental loads that return zero new events. Verified the new tests fail againstmain(cursor isnullinstead of the expected last cursor) and pass with the one-line fix.