Skip to content

test(app-shell): flowCanvasChip-11665 awaits the lazy studio zh catalogue before reading the tooltip - #26800

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-998cn0
Oct 27, 2026
Merged

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

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread
Fixes #26692

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:Studio 自动化画布标题条的测试 flowCanvasChip-11665,在模块作用域先 await loadStudioCatalogue('zh'),再跑用例;只改测试,不动源码。另修 metadata-admin/inspectors/inspectorStrings.i18n-10804 同类竞态(feat(ui): Studio inspector strings (page block, action, dataset, flow node, app nav, widget) move into the studio i18n namespace (#25922 slice S2) #26780 把 flowNode 文案移入 studio 懒加载包后暴露)。
  • 为什么改:zh 用例只等了标题条出现,就同步读提示文字「API 名称」;这行文案在按需加载的 studio 中文包里,包没到时读到英文,Test UI 随机变红(CI run 40506346595)。
  • 风险与回滚:两个测试文件各加 6 行,不发布任何包;回滚即还原这两个文件。
  • 先看:ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.flowCanvasChip-11665.test.tsx 第 27–32 行。
  • 两分钟验证:在仓根跑 pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.flowCanvasChip-11665.test.tsx,应见 4 passed。
  • 需要你做的:无,席位落地。

What changes

The zh case of StudioDesignSurface.flowCanvasChip-11665.test.tsx awaited only findByTestId('auto-canvas-caption') and then asserted the chip's title synchronously. That title is designer.field.apiName, a row of the studio i18n namespace, whose zh catalogue is a lazy import(). If the chunk had not landed, the title was still the en row, so Test UI could go red on any PR whose shard ran this file.

The test now loads the catalogue at module scope (await loadStudioCatalogue('zh')), the same shape the other studio-namespace zh tests in app-shell already use (for example CelTestRunDialog.i18n-10862.test.tsx, BuilderLanding.environmentOverlayCopy-12171.test.ts). The cost moves into the import phase, outside any test or hook timeout, per ui/AGENTS.md test discipline. No sleep, no retry wrapper, no quarantine.

inspectorStrings.i18n-10804.test.tsx gets the same preload. #26780 (#25922 S2) moved engine.inspector.flowNode.* into the lazy studio namespace, and that test's zhRow() reads t(key, 'zh-CN') synchronously, so Test UI (3/16) went red twice on 8dd8c259 (flowNode.kind read as Node).

Why

Triage ruling 6444153925: the test awaits the catalogue. Of the two spellings the dispatch order offered (top-level preload, or findBy/waitFor on the title), this PR picks the top-level preload: it is the established pattern in this package, and it waits on the catalogue itself rather than on an RTL budget the loader can still overrun.

Tests

Deterministic proof at head d3202677 (merge base c8583f80), under the shared verify lock. The studio zh loader (ui/packages/i18n/src/namespaces/studio/index.ts) was delayed 4000 ms through scripts/ablation-replace.mjs; every mutation was restored (blob equals HEAD, git diff HEAD empty).

Leg Fixes zh loader Result
0 both kept normal Tests 25 passed (25)
A both kept delayed 4000 ms Tests 25 passed (25)
B1 10804 preload removed delayed 4000 ms 3 failed, 18 passed (the CI failure: flowNode.kind zh read as Node)
B2 flowCanvasChip preload removed delayed 4000 ms 1 failed, 3 passed (the card's failure: API name vs API 名称)

Acceptance notes

  • Sweep, measured not read: with the studio zh loader delayed 4000 ms, all 259 app-shell test files that name zh without the preload ran (2634 tests); only inspectorStrings.i18n-10804 went red. The seat's 8 other heuristic candidates (three FlowNodeInspector tests, datasetPickers.authorText-11161, FlowPreview.removeNode-11772, flow-problems.removalRefusal-11838, previewStrings.i18n-10848, metadataError.heldWidget-11910) stayed green and are dropped: they compare the DOM with t() in the same tick, so a slow chunk leaves both sides en.
  • No changeset: @object-ui/app-shell is private and only a test file changed (skip-changeset).

Verification

Gate families derived by node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at d3202677 (merge base c8583f80; 24 derived, 24 run, all exit 0), each run locally with exits captured before any pipe and reconciled with --ran; readings are in the os-dev report on #26692. Repo-wide scans (pnpm lint, the full Test UI matrix) are CI's.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (CI)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English. (the maintainer summary is in Chinese by the dispatch contract)
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxbXwuDiqzYUyEfANmtM


Generated by Claude Code

…ogue before reading the tooltip

The zh case awaited only the caption testid and then read the chip's
`title` (`designer.field.apiName`, a row of the lazy `studio` namespace)
synchronously, so under a saturated Vite transform pipeline it could read
the en row before the zh chunk landed. Load the catalogue at module scope,
the shape the other studio-namespace zh tests already use.

Claude-Session: https://claude.ai/code/session_01JQwxbXwuDiqzYUyEfANmtM
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Test UI (3/16) failed on head 8dd8c25 (run 40542786204, job 122326263181), and the failure is not this PR's.

The red test is ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.i18n-10804.test.tsx:106: engine.inspector.flowNode.kind: the zh row must not be the English one: expected 'Node' not to be 'Node'. This PR changes one file, studio-design/StudioDesignSurface.flowCanvasChip-11665.test.tsx, and does not touch that test or what it reads.

Cause (read, not instrumented): #26780 (#25922 slice S2, merged to main after this branch's base, so it is in the CI merge ref) moved engine.inspector.flowNode.* into the lazy studio i18n namespace. The 10804 test's zhRow() calls t(key, 'zh-CN') synchronously and has no module-scope await loadStudioCatalogue('zh'), so it reads the en row whenever the zh chunk has not landed yet. It is the same race class this PR fixes, in a file outside this card's claimed surface (studio-design only). Main's Test UI was green on 4485536, which fits an intermittent race.

No fix exists yet; the same one-line preload fixes it. I am handing it to the ui seat to carry as its own card rather than widening this PR. One re-run of the failed jobs follows once this run completes.


Generated by Claude Code

…h catalogue before zhRow reads it

#25922 slice S2 moved `engine.inspector.flowNode.*` into the lazy `studio`
namespace; this suite's `zhRow()` reads `t(key, 'zh-CN')` synchronously,
so it read the en row whenever the zh chunk had not landed (Test UI 3/16
on #26800, twice). Load the catalogue at module scope.

Claude-Session: https://claude.ai/code/session_01JQwxbXwuDiqzYUyEfANmtM
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · seat domain:ui#1 · session_01JQwxbZeBv2y91towxasSUT · head d3202677 · 2026-10-27T18:04Z

席位意见:两个测试文件各在模块作用域加 await loadStudioCatalogue('zh'),与包内既有写法一致;延迟 zh 包 4 秒时两处修复都绿,去掉任一处即复现原红。

  1. Shape: test-only, Fixes #26692; 2 files, +12/−0 (StudioDesignSurface.flowCanvasChip-11665.test.tsx, inspectorStrings.i18n-10804.test.tsx); skip-changeset (app-shell is private). The second file is inside the widened Claim 6448012819.
  2. Premise measured: the seat read both hunks on the head: each adds only the module-scope preload from @object-ui/i18n/namespaces/studio, the import path 28 app-shell suites on main already use. Dev's proof: loader delayed 4000 ms, 25/25 green with both fixes, each file red with its preload removed (the card's failure and the S2 regression), mutations restored.
  3. Gates / check-runs: On head d3202677, 43 success · 13 skipped · 0 failed · 0 pending; mergeable_state: clean. Dev's local run: 24/24 derived gates exit 0, --ran 0 NOT-MEASURED.
  4. Accepted deviations: the PR body was amended by the seat from the report's body_amendments (os-dev forbids a dev PATCH); the round-1 re-run was spent before the Claim widened.
  5. Out of scope: noted, not filed: 8 suites read t() in the same tick as the DOM, so under a slow chunk their zh legs compare en with en and pass without proving zh. app-shell: a published library that is 66% Console product surface — retire the 67 zero-reference exports now, decide the split, and fold the second i18n table into @object-ui/i18n #25922's later slices own that family. Skills-docs: none — test-only.
  6. Landing: not Tier H; the seat readies and arms auto-merge.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 27, 2026 18:06
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Test UI (15/16) — 失败步骤: Run the ui tests (shard 15/16)

    × lists every key the spec ActionSchema declares 12ms
    FAIL   unit  packages/core/src/actions/__tests__/actionKeys.pin.test.ts > action key inventory (objectstack#4075 step 1) > lists every key the spec ActionSchema declares
      ↳ 失败原因: AssertionError: expected { missing: [ 'disabledReason' ], …(1) } to deeply equal { missing: [], stale: [] }
    

↳ 失败原因 是判读的关键:超时(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 队列共有 8 个失败构建(不含本次)。

分诊清单:

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

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

Merged via the queue into main with commit 8eef9a8 Oct 27, 2026
57 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-998cn0 branch October 27, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(app-shell): StudioDesignSurface.flowCanvasChip-11665 reads the zh tooltip before the lazy studio catalogue lands, so Test UI goes red at random

2 participants