Repository navigation
fix(ui): show loader on User Metadata tab while decoding - #4209
Open
ShilpThapak wants to merge 2 commits into
Open
ShilpThapak wants to merge 2 commits into
ShilpThapak wants to merge 2 commits into
Conversation
|
Someone is attempting to deploy a commit to the Temporal Team on Vercel. A member of the Team first needs to authorize it. |
Add userMetadataLoading flag to workflow-run store (mirroring workersLoaded), decode user metadata without blocking first render, and render <Loading /> on the User Metadata page until decoding finishes. Guards the async write with a run-identity check so a stale decode cannot overwrite a newly navigated-to run. Fixes temporalio#4208
ShilpThapak
force-pushed
the
fix/user-metadata-loader
branch
from
November 23, 2026 08:23
ddd325b to
cdffb6f
Compare
The __temporal_workflow_metadata query can take seconds (it executes against the workflow worker), but workflow-current-details rendered an empty Markdown in the meantime — the local loading flag was never wired into the markup. Render <Loading /> while loading with nothing to show yet; keep showing stale content on R-refresh instead of flashing a spinner. Add an integration test with a delayed query mock carrying sample currentDetails: asserts the loader appears while pending and the sampled content renders after.
Author
|
Reviewers, I have limited understand of this codebase. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4208.
Problem
Opening
Workflows > <workflow> > User Metadatashows no loading indicator while its data is being fetched:workflow-run-layout.svelteawaiteddecodeWorkflowUserMetadata()before setting$workflowRun.workflow, so a slow codec server blocked the entire workflow page behind the generic skeleton. The store also initialiseduserMetadataas{ summary: '', details: '' }, indistinguishable from "loaded empty".__temporal_workflow_metadataquery (executed against the workflow worker, can take seconds — e.g./api/v1/namespaces/<ns>/workflows/<id>/query/__temporal_workflow_metadata) rendered an empty Markdown while pending:workflow-current-details.svelteowned aloadingflag but never wired it into the markup.Impact
On Temporal Cloud this path is slow, and without a loader it is impossible to tell "still loading" from "no metadata available" — so you keep waiting instead of moving on. Spinner means wait; the empty state means there is genuinely nothing there.
Fix
src/lib/stores/workflow-run.ts: adduserMetadataLoading: booleantoWorkflowRunWithWorkers(mirrors existingworkersLoaded),trueininitialWorkflowRun.src/lib/layouts/workflow-run-layout.svelte: setworkflowimmediately and decode user metadata in the background (void decode…), merging results and clearing the flag infinally, guarded by a namespace/workflow/run identity check so a stale decode can't overwrite a newly navigated-to run.src/lib/pages/workflow-user-metadata.svelte: render<Loading />whileuserMetadataLoading, matching the{#await …} <Loading />pattern used bybatch-operations.svelte.src/lib/components/workflow/metadata/workflow-current-details.svelte: render<Loading />whileloading && !currentDetails— loader only while data is actually loading; an R-refresh keeps showing stale content instead of flashing a spinner.Out of scope (possible follow-up):
standalone-activity-metadata.svelteandstandalone-nexus-operation-metadata.svelteuse{#await decodeMetadata …}with no pending slot and show blank while decoding. The layout also firesgetWorkflowMetadatain addition to the component's own fetch (double query) — left as is.Before / After
Recorded against the integration mock workflow with sample Current Details data and a simulated 1.5s query delay.
Before — page renders, Summary/Details show, but the Current Details panel sits blank until the query resolves:
before-current-details-loading.mp4
After — the Current Details panel shows the loader until the query resolves, then renders the sample content:
after-current-details-loading.mp4
Verification
pnpm check: 0 errorspnpm eslinton touched files: 0 errorspnpm vitest run src/lib/stores/favicon.test.ts src/lib/utilities/decode-payload.test.ts: 32 passedPW_MODE=integration pnpm playwright test tests/integration/workflow-metadata.spec.ts: 8 passed (incl. newShows loader on Current Details while metadata query is pending, which fails on the pre-fix code)This PR was generated with the help of AI.