Skip to content

Commit 9d12d8f

Browse files
committed
fix(metadata-protocol): chunkedUpload 改用与 files 同一的可服务性判据(#5672)
同一 slot(file-storage)的两个词表键此前判据不同:files 走可服务性、 chunkedUpload 只看注册存在。后果有二:自声明 stub 的存储实现会被广告出 chunkedUpload: true —— 而该 builder 本就不给它广告 routes.storage;更要紧的 是 runtime dispatcher 对同一键答的是 hasFiles(可服务性),两个生产者会对同 一宿主的同一键给出相反答案 —— 正是本单要消除的方言。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
1 parent affc529 commit 9d12d8f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

packages/metadata-protocol/src/protocol.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2798,7 +2798,18 @@ export class ObjectStackProtocolImplementation implements
27982798
cron: registeredServices.has('job'),
27992799
search: registeredServices.has('search'),
28002800
export: registeredServices.has('automation') || registeredServices.has('queue'),
2801-
chunkedUpload: registeredServices.has('file-storage'),
2801+
// [#5672] Serveability-gated, was presence-only. Two reasons, and
2802+
// the second is the binding one:
2803+
// 1. `declared === enforced` — a self-declared stub file-storage
2804+
// mounts no HTTP surface, so this builder already withholds
2805+
// `routes.storage` from it; advertising chunked upload anyway
2806+
// promised an upload endpoint that cannot exist.
2807+
// 2. the runtime dispatcher answers this key `hasFiles`, i.e.
2808+
// `isServiceServeable(filesSvc)`. Leaving this one on presence
2809+
// would make the two producers give the SAME host opposite
2810+
// answers for the SAME key — a new dialect inside the
2811+
// vocabulary this issue exists to unify.
2812+
chunkedUpload: capabilityServed('file-storage'),
28022813
// Atomic cross-object batch (#3298 / #1604 / ADR-0034 item 4): the
28032814
// REST /batch endpoint runs its ops inside `engine.transaction()`,
28042815
// which only opens a real (all-or-nothing) transaction when the

0 commit comments

Comments
 (0)