Skip to content

fix(data-objectstack): uploads send through the injected fetch, and the bearer ratchet reads four more spellings - #38173

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-iryzkt
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-iryzkt

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Fixes #37505
Fixes #37506
Fixes #37507
repo:objectstack#3 · os-tesla · session_01L9qic11DcdSCqDBNNUAXcb

Clause-②: no
Metadata-protocol: none

维护者速读

  • 嵌入或云租户里只靠令牌登录的用户:数据适配器的两个上传方法以前只带 cookie,现在和其他请求一样带上令牌;控制台界面没有变化。
  • 属于「纯令牌登录和分源部署下请求都带上身份」专题:补全检查「同服务器请求必须带令牌」的那条测试,它以前漏数四种写法。
  • 只换了上传用哪个请求通道,地址、内容和连接状态都不变;有问题可以直接撤回。顺带发现标准服务端上这两个上传地址本身不存在,已另立卡,本次没有修。
  • 无

What changes

Not here: #38101 (the same test file's scan time) is claimed by another seat; whichever lands second merges main.

Tests

  • New uploadTransport-37506.test.ts: the injected fetch adds a bearer and records what reached the network; the global fetch is stubbed to record and refuse (the control, the pre-fix transport). uploadFile and uploadFiles each send exactly one POST to the upload URL carrying the bearer, and never touch the global fetch; a refused upload leaves the connection state at connected with no event.
  • The ratchet: the detector case table gains 15 rows for the four spellings and one row flips from 0 to 1 (credentials: 'same-origin' on an /api/ path); one new case for REGISTERED_CHANNELS.
Readings (base origin/main 581ae76)
  • Premise, before any change: a port of the detector run over the whole ui tree (2466 files) matched ALLOWED exactly (15 rows, 21 calls); with the four spellings on, the only new hits were the two uploads in data-objectstack (uploadFile and uploadFiles, fetch(url, …)).
  • uploadTransport-37506.test.ts: Tests 3 passed (3). Ablation (both uploads put back to the global fetch, fix committed first, restored with git 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 global fetch reds "every bare cookie-only call is a counted row" with exactly the two upload lines; dropping the + branch, the URL-const lookup, the same-origin reading or the spread reading each reds the detector case for that spelling.
  • eslint on the three changed .ts files: 0 errors; the warnings are the existing no-explicit-any ones in index.ts, none on a changed line.
  • @object-ui/data-objectstack type-check (tsc --noEmit) exit 0, after a build of its dependency closure.
  • dispatch-gates --commands at 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):

  1. data-objectstack/src/index.ts: the uploadTransport field, its assignment in the constructor, and the two this.uploadTransport(url, …) calls.
  2. The ratchet's credentialsOf and namesApiPath, 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.ts passes; put either upload call back to fetch(url, { and both files red.


Generated by Claude Code

…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>
@objectstack-fleet
objectstack-fleet Bot requested a review from os-tesla November 28, 2026 05:13
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T05:40Z

L1-a: ACCEPT at 96332e47e5

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-28T05:44Z · zone o3-ux (seat card thread)
Head-sha: 96332e47e5abe19edba36ee3ca01d4b6a232f2af

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 05:45
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46113586285 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (2/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ a member on no slate is refuse
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ [#33690] the approver's call d
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ [#33690] the submitter's recal
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/mcp-system-object-action-exposure.dogfood.test.ts > [#27681, #27900] sys_user identity actions over MCP: what each bucket's declaration lets an agent 
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/mcp-system-object-action-exposure.dogfood.test.ts > [#27681, #27900] sys_user identity actions over MCP: what each bucket's declaration lets an agent 
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 38 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants