Repository navigation
fix(data-objectstack): uploads send through the injected fetch, and the bearer ratchet reads four more spellings - #38173
Conversation
…he global one The two upload methods called the global fetch, which carries the cookie alone; under a bearer-only session they went out anonymous while every other request of the adapter was signed in. They now call the host's injected fetch as given, still outside the connection-state observer. Claude-Session: https://claude.ai/code/session_01L9qic11DcdSCqDBNNUAXcb Co-authored-by: Claude <noreply@anthropic.com>
…ion, same-origin and spread inits A same-server call whose URL is held in a const or built with +, whose init spells credentials: 'same-origin', or whose init spreads a const of the file, used to pass the ratchet uncounted. Each spelling now has a pin, and the react host channels and the createAuthClient self-heal retry are registered with their reasons. Claude-Session: https://claude.ai/code/session_01L9qic11DcdSCqDBNNUAXcb Co-authored-by: Claude <noreply@anthropic.com>
…fetch Claude-Session: https://claude.ai/code/session_01L9qic11DcdSCqDBNNUAXcb Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a: ACCEPT at
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T05:44Z · zone
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46113586285 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Tesla · project thread
Fixes #37505
Fixes #37506
Fixes #37507
repo:objectstack#3 · os-tesla · session_01L9qic11DcdSCqDBNNUAXcb
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
@object-ui/data-objectstack(data-objectstack:上传文件和 metadata-client 绕过注入的 fetch,纯令牌会话下被当匿名(接 #37225) #37506):uploadFileanduploadFilescall the host's injectedfetchas given (uploadTransport, kept aside in the constructor), not the globalfetch. The console handscreateAuthenticatedFetch(), so an upload under a bearer-only session now carries the stored bearer like every other request of the adapter. Both stay outside the connection-state observer (observeServerAnswer), so an upload's outcome still does not move the connection state, as the README says; only the README's "call the globalfetch" wording changes. URL, body and headers are unchanged.metadata-clienthas no bare call left on main, so nothing changes there.sameServerFetch.bearer.ratchet.test.ts, 同服务器令牌棘轮:别名、拼接 URL、spread 参数等写法数漏,react 宿主回退仍走裸 fetch(接 #37225) #37505) now reads four spellings that used to pass uncounted:constof the file (const url =+ template naming/api/), and a+concatenation with an/api/part;credentials: 'same-origin'spelled out (the default: the cookie alone);constof the file ({ ...COOKIE_INIT, method: 'POST' }), with later keys overriding, as at run time. A spread of anything else ({ ...init }) stays unknown and uncounted; a credentials value written before such a spread is kept.ALLOWEDlist is unchanged: on the widened detector the whole tree matches it row for row.REGISTERED_CHANNELS(同服务器令牌棘轮:别名、拼接 URL、spread 参数等写法数漏,react 宿主回退仍走裸 fetch(接 #37225) #37505, @object-ui/auth:createAuthClient 里 3 处同服务器请求不带令牌,逐个判定(接 #37225) #37507): three calls that read like a bare fetch and are not one, each with its reason, and a case that fails once a file no longer holds the registered spelling or the scan starts counting a call in it:reactuseDatasetDimensionLabelsanduseElementApiDataSource:apiFetch ?? fetch, the host's channel offSchemaRendererContext.authcreateAuthClient: the stale-bearer self-heal retry ofget-session, token-less on purpose. Every other request of that client already goes throughbearerFetch, so @object-ui/auth:createAuthClient 里 3 处同服务器请求不带令牌,逐个判定(接 #37225) #37507 needs no production change.patchchangeset for@object-ui/data-objectstack.Not here: #38101 (the same test file's scan time) is claimed by another seat; whichever lands second merges main.
Tests
uploadTransport-37506.test.ts: the injected fetch adds a bearer and records what reached the network; the globalfetchis stubbed to record and refuse (the control, the pre-fix transport).uploadFileanduploadFileseach send exactly onePOSTto the upload URL carrying the bearer, and never touch the global fetch; a refused upload leaves the connection state atconnectedwith no event.credentials: 'same-origin'on an/api/path); one new case forREGISTERED_CHANNELS.Readings (base origin/main 581ae76)
uitree (2466 files) matchedALLOWEDexactly (15 rows, 21 calls); with the four spellings on, the only new hits were the two uploads indata-objectstack(uploadFileanduploadFiles,fetch(url, …)).uploadTransport-37506.test.ts:Tests 3 passed (3). Ablation (both uploads put back to the globalfetch, fix committed first, restored withgit checkout HEAD):Tests 3 failed (3).sameServerFetch.bearer.ratchet.test.ts:Tests 5 passed (5). Ablations, one at a time against the committed file: uploads back to the globalfetchreds "every bare cookie-only call is a counted row" with exactly the two upload lines; dropping the+branch, the URL-const lookup, thesame-originreading or the spread reading each reds the detector case for that spelling.eslinton the three changed.tsfiles: 0 errors; the warnings are the existingno-explicit-anyones inindex.ts, none on a changed line.@object-ui/data-objectstacktype-check(tsc --noEmit) exit 0, after a build of its dependency closure.dispatch-gates --commandsat 96332e4: 40 families derived, 40 run, every one exit 0 (--ran: 0 NOT-MEASURED, a derived zero),pnpm --dir ui exec vitest run scripts/included (Tests 5144 passed | 2 skipped).overlap-check: clean against origin/main 33a0d4f and against test(app-shell): skip fetch-free files before parsing in the bearer ratchet scan #38148 (the scan-time change in the same test file). The ratchet with both changes merged (git merge-file, not committed here):Tests 5 passed (5).Acceptance notes
Verification
Read first (by risk):
data-objectstack/src/index.ts: theuploadTransportfield, its assignment in the constructor, and the twothis.uploadTransport(url, …)calls.credentialsOfandnamesApiPath, and the new rows of the detector case table.Two-minute check:
pnpm --dir ui exec vitest run packages/data-objectstack/src/uploadTransport-37506.test.ts packages/app-shell/src/sameServerFetch.bearer.ratchet.test.tspasses; put either upload call back tofetch(url, {and both files red.Generated by Claude Code