Skip to content

Refactor workflow history ownership and decouple timeline consumers - #4131

Closed
tegan-temporal wants to merge 23 commits into
mainfrom
tegan/fe-1484-implement-chain-overview-page
Closed

tegan-temporal wants to merge 23 commits into
mainfrom
tegan/fe-1484-implement-chain-overview-page

Conversation

@tegan-temporal

@tegan-temporal tegan-temporal commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Give each workflow execution its own history buffer and loading controller instead of relying on shared singleton state. The run layout owns the controller lifecycle, and a keyed history provider supplies it to route-facing views through Svelte context. Reusable timeline, event, activity, and worker components receive their data and execution identity explicitly.

https://linear.app/temporal/issue/FE-996/timeline-data-refactoring

Behavior

  • Keep history, loading state, full-history requests, and live-poll cursors isolated per execution. Abort obsolete work and ignore stale responses when switching runs or refreshing.
  • Load history from both ends, pause the initial fetch until a view requests the full history, and let a healthy cursor continue if the other direction fails. If history remains incomplete, retain loaded events and show an inline error with Retry.
  • Preserve live updates, pause/resume controls, pending activity metadata, and the final history tail when a workflow closes. Surface processing failures through the history error UI.
  • History fetching and live polling fail independently, so an error in one does not stop the other. Retry retains loaded events and the acknowledged live-poll cursor while rescanning history from both ends.
  • Resolve individual events and their groups through indexed buffer lookups rather than regrouping the entire history as pages arrive. Support request-ID links and previous/next navigation as history grows.
  • Keep timeline selection local to each graph and clear the main detail panel on navigation. Parent and child timelines remain independent.
  • Pass execution identity and activity actions explicitly through event renderers, and supply SDK information to worker tables from the current execution. Imported and archived histories use their own data without depending on active run state.

Implementation

  • Use an instance-owned grouped event buffer with a reactive view and per-group materialization caching.
  • Share one bidirectional cursor loop and deduplicate events at buffer ingestion. Remove unused fetch statistics, callback arguments, mirrored version stores, and obsolete shared state/components.
  • Document history ownership, loading, and rendering in the timeline architecture guide.

Validation

  • Unit coverage for buffer isolation and indexed lookups, bidirectional pagination and recovery, controller lifecycle, and live-poll cursor continuity.
  • Desktop/mobile browser coverage for run navigation, refresh, full-history loading, partial-history errors and retry, timeline selection, and live event-detail updates.
  • Unit tests, type checking, linting, and the history/timeline browser regression suite pass. Type checking and linting retain existing warnings.

Consumer compatibility

Packaged consumers must update their UI dependency and pass SDK information explicitly to workflow worker tables. The single-event page now takes only the event ID; execution identity comes from its history controller.

Cloud UI consumer updates: https://github.com/temporalio/cloud-ui/pull/3578 (draft; waits for these changes to be merged and packed).

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
holocene Ready Ready Preview Nov 17, 2026 6:22pm UTC

Request Review

# Conflicts:
#	src/lib/components/workers/workers-table/workers-table.svelte
…nt-chain-overview-page

# Conflicts:
#	src/lib/components/event/pending-nexus-summary-row.svelte
#	src/lib/components/lines-and-dots/event-type-filter.svelte
#	src/lib/components/lines-and-dots/timeline-graph/graph-widget.svelte
#	src/lib/components/lines-and-dots/timeline-graph/timeline-graph-row.svelte
#	src/lib/components/lines-and-dots/timeline-graph/timeline-graph.svelte
#	src/lib/layouts/workflow-history-layout.svelte
#	src/lib/layouts/workflow-timeline-layout.svelte
#	src/lib/services/grouped-event-buffer.svelte.ts
#	src/lib/services/grouped-event-buffer.test.ts
#	src/lib/services/grouped-event-buffer.ts

@laurakwhit laurakwhit 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.

Nothing critical to address here! Just need to fix the integration tests and looks like we'll need a Cloud PR to be merged with this one for some breaking changes. Main concern is probably the errors in the live-poll never reaching the controller.

FYI I ran this through the /winston:pr-review skill.

Comment thread src/lib/services/live-poll.ts Resolved
Comment thread src/lib/services/fetch-bidirectional.ts Resolved
…nt-chain-overview-page

# Conflicts:
#	src/lib/layouts/workflow-timeline-layout.svelte
#	src/lib/services/grouped-event-buffer.svelte.ts
#	src/lib/services/grouped-event-buffer.test.ts
#	src/lib/services/grouped-event-buffer.ts
- Surface non-retryable live-poll errors to the history controller
- Keep the pause when one bidirectional cursor fails; stop and reject instead of draining
- Gate the workflow-task-failed banner on fetchComplete
- Clear the run error on a successful refresh and pause live polling while it shows
- Update integration test event filter selectors
- Let the healthy cursor keep loading after a failure when the pause is released immediately
- Expect the workflow-task failure banner to stay hidden while history is partial
- Scroll the virtualized timeline into view before finding rows on mobile
- Use the event-type-filter selectors in the smoke spec
- Fix type errors in the history errors spec
@tegan-temporal

Copy link
Copy Markdown
Contributor Author

Superseded by #4195.

This branch was successfully deployed

1 active deployment
Preview — 37ff107e Deployed Nov 17, 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.

2 participants