Surface a Request ID in the run sidebar attribute panel - #3293
Conversation
…anel Renders an analytics event's `vercelId` in the Metadata list as a copyable "Request ID" — the flow-function invocation grain, finer than the `computeInstanceId` already shown, and the value Vercel Logs indexes by (this panel's View Logs button is where a reader takes it next). The key is `vercelId` rather than `requestId`: world-vercel renames the SDK's `requestId` to `vercelId` crossing the wire, and AnalyticsEvent's sibling `requestId` field is declared but never written, so reading it would always be empty. It needs an explicit AttributeKey entry because, like `computeInstanceId`, it is analytics-only and not `keyof Event`. Also route both provenance ids through a nullish-safe display fn. The analytics schemas type them nullable and the panel only drops a row whose display fn returns null, so the previous bare String() rendered the literal text "null" beside the label when the backend left the field empty. Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
…er last `sortByAttributeOrder` guarded `indexOf` with `|| 0`, but a miss returns -1, which is truthy — so the fallback never fired and any key absent from `attributeOrder` sorted ahead of every listed key. Rank misses as `attributeOrder.length` instead. `errorCode`, `isWebhook`, and `isSystem` render but were missing from the list, so they were the keys hitting that path: a failed step showed Error Code above its own name and module. Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
🦋 Changeset detectedLatest commit: 1b48598 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 |
karthikscale3
left a comment
There was a problem hiding this comment.
We shouldn't need 2 changesets I think. Otherwise lgtm
Both targeted @workflow/web-shared and so merged into a single version bump anyway. The ordering fix is cosmetic row placement in a detail panel and would not be backported on its own, so it does not need its own changelog entry or a separate patch bump to preserve. Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
|
No backport to This commit mixes feature work with a fix: adding a new To override, re-run the Backport to stable workflow manually via |
Summary & Motivation
One warm compute instance serves many invocations, so the Compute Instance ID already in this panel can't distinguish steps that ran inline within a single flow-function invocation — sibling steps sharing a Request ID did. It's also the value Vercel Logs indexes by, and this panel's View Logs button is where a reader takes it next.
The key is
vercelId, notrequestId: that's the name world-vercel stores the SDK's request id under crossing the wire, and AnalyticsEvent's siblingrequestIdfield is declared but never written. Nothing in this repository populatesvercelIdon the object the panel receives yet — only AnalyticsEvent carries it, and grouping steps by invocation needs a step-level aggregation in workflow-server first — so the row ships as forward-compatible plumbing in the slot next to Compute Instance ID.The second commit is an independent fix:
sortByAttributeOrderguardedindexOfwith|| 0, but a miss returns -1, which is truthy, so any key absent fromattributeOrdersorted ahead of every listed key. It can be dropped on its own.Test Plan
Unit tests added; the two ordering assertions fail against the unfixed comparator. The new row could not be verified by hand — no local code path populates it.