Skip to content

fix(web-shared): stop event payload stub flash in events view - #3951

Merged
VaguelySerious merged 1 commit into
mainfrom
ms/event-payload-stub-flash-fix
Sep 10, 2026
Merged

VaguelySerious merged 1 commit into
mainfrom
ms/event-payload-stub-flash-fix

Conversation

@mitul-s

@mitul-s mitul-s commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Problem

In the events view, opening an event's payload flickered: a partial JSON document flashed first, then a skeleton, then the full payload (with the Decrypt button on encrypted fields).

Root cause: list endpoints resolve events with resolveData: 'none', which strips the ref/payload fields (input, result, error, …) via stripEventDataRefs and leaves a partial eventData stub (stepName, timings, …). EventRow treated that stub as displayable payload, rendering it during the load window even though a full-payload fetch was already in flight.

Fix

Only trust inline eventData when it can't be a stub:

  • when there is no onLoadEventData loader (inline data is all there is), or
  • when the event type carries no ref fields (stripEventDataRefs never strips those, so inline data is already complete — e.g. wait_created, attr_set). Those now render immediately and skip the redundant fetch.

Verification

Reproduced end-to-end against a local world with encryption enabled (recorded DOM state transitions via MutationObserver):

  • Before: json(stub, missing result) → skeleton → json+decrypt-btns; same flash when already decrypted.
  • After: skeleton → json+decrypt-btns (encrypted), skeleton → json (decrypted), ref-less events render instantly, decrypt transition swaps encrypted → decrypted content with no flash.

@workflow/web-shared typecheck + 225 tests pass.

List endpoints resolve events with resolveData: 'none', which strips the
ref/payload fields (input, result, error) and leaves a partial eventData
stub. EventRow treated that stub as displayable payload, so expanding an
event first flashed an incomplete JSON document (missing the payload
fields), then swapped to a skeleton, then to the full payload (with the
Decrypt button on encrypted fields) once the fetch resolved.

Only trust inline eventData when it can't be a stub: when there is no
loader, or when the event type carries no ref fields (its eventData is
never stripped). Ref-less event types now render their complete inline
data immediately and skip the redundant fetch.
@mitul-s
mitul-s requested a review from a team as a code owner September 3, 2026 01:52
@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7d6c2b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@workflow/web-shared Patch
@workflow/web Patch
@workflow/cli Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/core Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch

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

@vercel

vercel Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
example-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-astro-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-express-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-fastify-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-hono-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-nitro-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-python-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workbench-vite-workflow Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workflow-docs Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workflow-swc-playground Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workflow-tarballs Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC
workflow-web Ready Ready Preview, v0 Sep 3, 2026 1:55am UTC

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 world-sim scenario book — 1 fail of 41 total

fence=per-spec

scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 6 0ms ok 0
✅ hook-at-step-started completed 12 0ms ok 0
✅ hook-at-step-completed completed 12 0ms ok 0
✅ hook-at-hook-created completed 12 0ms ok 0
✅ deadline-hook-wins completed 7 1.0h ok 0
✅ deadline-expires completed 7 1.0h ok 0
✅ long-sleep completed 11 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 10 2.0s ok 0
✅ parallel-steps completed 9 0ms ok 0
✅ hook-on-execution-state completed 12 0ms ok 0
✅ peek-hook-before-branch completed 12 0ms ok 0
✅ peek-hook-after-branch completed 12 0ms ok 0
✅ peek-hook-at-registration completed 12 0ms ok 0
✅ race-hook-before-probe completed 12 0ms ok 0
✅ race-hook-after-probe completed 12 0ms ok 0
✅ race-duplicate-delivery completed 13 0ms ok 0
✅ attr-hook-before-step completed 11 0ms ok 0
✅ attr-hook-after-step completed 11 0ms ok 0
✅ attr-from-step-body completed 13 0ms ok 0
✅ fork-hook-after-timeout completed 14 1.0m ok 0
✅ fork-hook-before-timeout completed 14 1.0m ok 0
✅ count-hook-after-timeout completed 17 1.0m ok 0
✅ count-hook-before-timeout completed 20 1.0m ok 0
✅ stale-read-step-count-fork completed 20 1.0m ok 0
✅ stale-read-equal-step-counts completed 14 1.0m ok 0
✅ step-vs-step-fork completed 12 0ms ok 0
✅ step-vs-step-fork-fenced completed 12 0ms ok 0
✅ fence-catches-benign-direction completed 12 5ms ok 0
✅ in-flight-before-decision completed 17 1.0m ok 0
❌ in-flight-before-decision-counted completed 17 1.0m ok 0
✅ in-flight-after-decision completed 19 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 20 1.0m ok 0
✅ fork-hook-wins completed 13 1.0m ok 0
✅ fork-timeout-wins completed 13 1.0m ok 0
✅ unclaimed-payload-under-fork completed 17 1.0m ok 0
✅ claimed-payload-under-fork completed 17 1.0m ok 0
✅ writers-independent-step-bodies completed 12 0ms ok 0
✅ writers-scripted-tempo completed 12 0ms ok 0
✅ cancel-mid-step cancelled 7 0ms skipped 0

Full trace: world-sim.txt

@alangenfeld alangenfeld left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@mitul-s
mitul-s marked this pull request as draft September 3, 2026 02:36
@VaguelySerious
VaguelySerious marked this pull request as ready for review September 10, 2026 22:06
@VaguelySerious
VaguelySerious merged commit a5694d3 into main Sep 10, 2026
67 checks passed
@VaguelySerious
VaguelySerious deleted the ms/event-payload-stub-flash-fix branch September 10, 2026 22:06
github-actions Bot added a commit that referenced this pull request Sep 10, 2026
Signed-off-by: Mitul Shah <mitulxshah@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #4088. Merge conflicts were resolved by AI — please review carefully. (backport job run)

pranaygp added a commit that referenced this pull request Sep 10, 2026
…ry-2

* origin/main:
  [core] Log pending consumers in divergence diagnostics (#4021)
  fix(web-shared): stop event payload stub flash in events view (#3951)
  fix: order the 429 check before the 4xx check in the workflow skill (#3915)
  test(swc-plugin): verify class-name preservation at runtime (#4015)
  (chore) Update Next.js to 16.3.4 in the workbench apps and @workflow/next (#4026)

This branch was successfully deployed

18 active deployments
Preview – workflow-swc-playground — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workflow-docs — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-nuxt-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-sveltekit-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – example-nextjs-workflow-webpack — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-vite-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – example-nextjs-workflow-turbopack — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-nestjs-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workflow-tarballs — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – example-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-nitro-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-hono-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-tanstack-start-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-fastify-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-astro-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-express-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workflow-web — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Preview – workbench-python-workflow — 7d6c2b5f Deployed Sep 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants