Commit 30181d9
fix(webapp): hide admin Debug-Run button for buffered runs + break SpanRun type cycle
Two coupled changes that must land together:
1. The Debug Run dialog's loader (resources.taskruns.$runParam.debug.ts)
looks up the run by friendlyId in PG, so it returns 404 for buffered
runs and the dialog renders the global "404: Page not found" view
instead of the debug surface. Until the debug loader gains its own
buffered-aware path, gate the button on the synthetic SpanRun's new
`isBuffered` flag — set true in the buffer fallback, false on the PG
path, checked at the AdminDebugRun render site in the spans route.
2. Introducing the `isBuffered` literal would alone trigger the
long-standing SpanRun circular type alias error: SpanRun is inferred
from `SpanPresenter.call`'s return, which routes through
`buildSyntheticSpanRun` on the mollifier-buffered branch — and that
helper is annotated `Promise<SpanRun>`. The literal narrowing made
the cycle TS-visible ("Type alias 'Result' circularly references
itself", surfacing as 7 cascading errors across SpanPresenter and
the spans route).
Fix the cycle by grounding SpanRun in the PG-path `getRun` method
(the canonical source for the shape) so the synthetic helper's
annotation no longer feeds back into SpanRun's definition. Span
continues to be derived off `call` because its path through
`#getSpan` has no synthetic indirection and no cycle.
Squashed because applying step 1 without step 2 leaves the branch
typecheck-broken.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b295552 commit 30181d9
3 files changed
Lines changed: 16 additions & 2 deletions
File tree
- apps/webapp/app
- presenters/v3
- routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam
- v3/mollifier
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
77 | 90 | | |
78 | 91 | | |
79 | | - | |
80 | 92 | | |
81 | 93 | | |
82 | 94 | | |
| |||
406 | 418 | | |
407 | 419 | | |
408 | 420 | | |
| 421 | + | |
409 | 422 | | |
410 | 423 | | |
411 | 424 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
1100 | | - | |
| 1100 | + | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| |||
0 commit comments