Commit 372fe78
fix(webapp): logs download for buffered runs returns a placeholder line, not 404
The dashboard's "Download logs" button on a run-detail page generates
`/resources/runs/{runFriendlyId}/logs/download`. For a buffered run
(no PG row yet) the loader's `prisma.taskRun.findFirst` returned null
and the route 404'd. The customer just triggered the run and got back
its id, so a 404 here reads as "your run vanished" — when the truth
is just "the run hasn't executed, so there are no logs yet."
When the PG lookup misses, verify the entry exists in the mollifier
buffer and the requesting user belongs to its org. Then stream a
gzipped log file containing a single informational line in the same
`<timestamp> <task> <level> <message>` shape `formatRunEvent` emits
elsewhere in this route:
2026-05-29T07:58:56.839Z hello-world INFO Run is queued, has not
started executing yet — no logs to download.
A meaningful one-liner beats a 0-byte file when a customer is grepping
the download for a clue. The line uses INFO (not TRACE) so it doesn't
look like an execution span.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e08dfcd commit 372fe78
1 file changed
Lines changed: 55 additions & 0 deletions
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
33 | 88 | | |
34 | 89 | | |
35 | 90 | | |
| |||
0 commit comments