Skip to content

Show all timeouts and current attempt elapsed time in Pending Activity view - #4077

Open
smoltafet wants to merge 1 commit into
temporalio:mainfrom
smoltafet:pending-activity-timeouts-elapsed
Open

smoltafet wants to merge 1 commit into
temporalio:mainfrom
smoltafet:pending-activity-timeouts-elapsed

Conversation

@smoltafet

Copy link
Copy Markdown

Description & motivation 💭

Fixes #4042. In the Pending Activities view of a workflow:

  1. Only explicitly set timeouts were visible. Unset ones (e.g. ScheduleToClose = 0s, meaning unlimited) could only be seen in the JSON view.
  2. There was no split between the current attempt's elapsed time and the total elapsed time across all attempts, so users mistook the total for the current attempt's time and thought StartToClose was about to be hit.

This PR updates the pending activity card to:

  • Always show all four timeouts (ScheduleToClose, ScheduleToStart, StartToClose, Heartbeat), with unset ones labeled "Not set / Unlimited". Values come from the activity's current activityOptions when populated, falling back to the ActivityTaskScheduled event attributes.
  • Show "Current Attempt Elapsed" and "Total Elapsed" as separate rows. Current attempt is measured from the last started time while an attempt is running, and from the last attempt's completion while the next attempt is waiting. Total is measured from the ActivityTaskScheduled event time.

The display logic lives in two new utilities (pending-activity-timeouts and pending-activity-elapsed) so it is unit-testable without rendering the card, following the pattern of activity-options-diff (including its duration parsing: the HTTP API sends protojson seconds strings, the proto types describe {seconds, nanos}, and a zero duration is treated as unset).

Screenshots (if applicable) 📸

No screenshot: I don't have a running Temporal server with a multi-attempt pending activity handy. The new rows appear in the card's left detail column directly under the Attempt row, in the same label/value style as the existing rows.

Design Considerations 🎨

  • Kept the timeout labels identical to the ones used by the updated-activity-options diff (workflows.schedule-to-close-timeout etc.) and reused the activities.heartbeat-timeout label.
  • Elapsed rows are hidden when no time anchor exists (e.g. the scheduled event is not in the event buffer and the activity carries no timestamps).

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

New unit tests cover:

  • getPendingActivityTimeouts: all four timeouts formatted in order; zero/missing durations left blank for the "Not set / Unlimited" label; proto object durations and seconds-string durations both parsed; the populated-options guard.
  • getPendingActivityElapsed: started attempt split from total; waiting attempt measured from the last attempt completion; first-attempt fallback to the scheduled time; fallback to the pending activity's scheduledTime when the scheduled event is unavailable; empty result with no anchors.

Suites run locally (Node 24, vitest): the two new test files plus pending-activities and activity-options-diff (37 tests), then the full src/lib/utilities, src/lib/i18n, grouped-event-buffer and src/lib/models suites: 139 files, 2010 tests passed, 1 skipped, 0 failed. svelte-check: 0 errors (63 pre-existing warnings in unrelated files). ESLint and Prettier clean on all touched files.

Steps for others to test: 🚶‍♂️🚶‍♀️

  1. Open a workflow with a pending activity that has some timeouts unset and more than one attempt.
  2. Open the Pending Activities tab: all four timeouts are listed, unset ones read "Not set / Unlimited", and "Current Attempt Elapsed" / "Total Elapsed" appear as separate rows.

Checklists

Draft Checklist

N/A

Merge Checklist

N/A

Issue(s) closed

#4042

Docs

Any docs updates needed?

No doc updates needed; this only adds display rows to an existing view.

@smoltafet
smoltafet requested a review from a team as a code owner October 25, 2026 22:33
@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

@smoltafet is attempting to deploy a commit to the Temporal Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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.

Pending Activity view: show all timeouts and current attempt elapsed time

2 participants