Commit 317d407
fix(evidence-export): tighten S3 missing-object check to specific error codes
The blanket `httpStatusCode === 404` fallback in `isS3MissingObjectError`
misclassified `NoSuchBucket` (bucket misconfigured) as a per-attachment
missing object. That would have produced an export that completed
"successfully" with nothing but `_MISSING_*.txt` placeholders — worse than
failing outright, because the customer would have no idea their bundle
contains none of the actual evidence.
Now we only treat the specific error codes `NoSuchKey` and `NotFound` as
missing; everything else (including other 404s like `NoSuchBucket`) rethrows
and aborts the archive.
Added a regression test asserting NoSuchBucket aborts the archive rather
than producing a placeholder.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3814e33 commit 317d407
2 files changed
Lines changed: 45 additions & 12 deletions
File tree
- apps/api/src/tasks/evidence-export
Lines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
270 | 306 | | |
271 | 307 | | |
272 | 308 | | |
| |||
0 commit comments