Commit cce1735
committed
fix(service-storage): stop handing out
Three call sites built `${basePath}/_local/file/<key>`. No registrar has ever
mounted it, so anyone who followed one got a 404. The tranche-3 storage ledger
(#3636) recorded the URL as deliberately ABSENT and filed this; now nothing
builds it either.
Each site fixed according to what it could honestly do:
- LocalStorageAdapter.getPresignedUpload() omits `downloadUrl` (optional on
the descriptor). It CANNOT construct the real capability URL — that is
keyed by sys_file.id and an adapter only ever sees the storage key. Nothing
read the field, which is how it survived: the presigned-upload route builds
its own downloadUrl and ignores this one, and all three real readers of
`desc.downloadUrl` take it from getPresignedDownload, whose URL IS mounted.
- GET /files/:fileId/url and GET /files/:fileId answer 501 NOT_IMPLEMENTED
when the adapter has neither getPresignedDownload nor getSignedUrl, instead
of returning/redirecting to the unmounted URL. The caller learns the
adapter is the limitation rather than chasing a broken link.
Behaviour change is confined to adapters implementing neither capability;
LocalStorageAdapter and the S3 adapter both implement getPresignedDownload, so
no shipped path changes. A 200/302 pointing at a 404 becomes a 501 that says why.
Two conformance cases added, mutation-checked: restoring either dead URL fails
them.
service-storage: 198 passed (17 files), up from 196.
Note on typecheck: this package has no `typecheck` script and CI's TypeScript
gate runs `--filter @objectstack/spec` only. A bare `tsc --noEmit` here reports
39 pre-existing errors, 7 of them in test files this change never touches (the
repo-wide `.js`-extension style under node16 resolution). Not touched, and not
claimed as clean.
Co-Authored-By: Claude <noreply@anthropic.com>_local/file/:key, a URL nothing mounts (#3641)1 parent 6877e9a commit cce1735
5 files changed
Lines changed: 94 additions & 5 deletions
File tree
- .changeset
- packages/services/service-storage/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
225 | 251 | | |
226 | 252 | | |
227 | 253 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
271 | 284 | | |
272 | 285 | | |
273 | 286 | | |
| |||
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
547 | 551 | | |
548 | 552 | | |
549 | 553 | | |
| |||
583 | 587 | | |
584 | 588 | | |
585 | 589 | | |
586 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
587 | 597 | | |
588 | 598 | | |
589 | 599 | | |
| |||
0 commit comments