Skip to content

plugin-form test flake: masterDetailDetailsMembers-8071 case 1 reads the captured grid before it exists #36500

Closed

Description

@objectstack-fleet

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Found on 2026-11-22 by two seat 7 threads: on PR #36437 (Test UI shard 12/16, job 137238402480) and on PR #36438 (Test UI shard 2/16, the same case red on its re-run too). Neither PR touches plugin-form. Filed by the seat.

What happens

ui/packages/plugin-form/src/__tests__/masterDetailDetailsMembers-8071.test.tsx, case 1 ("each member is its own section, in AUTHORED order…"), fails intermittently with Cannot read properties of undefined (reading 'field') at the gridOf('Lines').field read (around line 259). The case waits for the section headings, then reads gridOf('Lines') straight away, before the grid's props have been captured. Cases 2 and 2b in the same file wrap their gridOf reads in waitFor, and they do not flake.

The #36437 thread measured it locally: 2 of 3 runs failed at that PR's head, it also failed on the merge base 85a995452, and it passed once on origin/main c9b0a2305. So the race is on main, not in either PR.

What should happen

Case 1 waits for the grid capture the same way cases 2 and 2b do, so it passes on every run.

Done when

  • Case 1 reads gridOf('Lines') and gridOf('Line Items') inside a waitFor (or after waiting on the captured grid props), the same pattern as cases 2 and 2b.
  • The file passes 20 runs in a row locally (vitest run --repeat or a loop), with the run count in the PR body.
  • The sibling *Members-8071 files in the same folder are checked for the same read-after-headings pattern, and any that have it are fixed in the same PR.

Activity

  1. added
    bug
    priority:p2
    domain:ui
    on Nov 22, 2026
  2. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

    Scope note from the seat (read-only check of the file at origin/main, nothing run). The fix is wider than one line:

    • Cause: MasterDetailForm.tsx draws each section's heading before its columns load, so headings can exist while a grid is still on "Loading columns…". gridOf (about line 203) returns gridProps.slice(-sections)[index], which is undefined until every section's grid has been captured.
    • Case 1 makes two bare reads after the heading wait (about lines 259 and 262). Both assertions belong inside waitFor.
    • The same latent pattern (wait on the first section, then read later sections bare) sits at about lines 370, 393, 399 and 496.
    • slice(-sections) assumes whole render passes, and a single-grid re-render misaligns it. A lookup keyed by section title (or by the captured field.name) is sturdier than the index.
    • The sibling *Members-8071 files do not define or use gridOf/gridProps, so they are not affected.

    It is now red on three open PRs that do not touch plugin-form: #36437 (Test UI 12/16), #36438 (2/16) and #36461 (14/16).

  3. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

    Claim: PM loop, maintainer exception
    Session: session_01QsR2jTeURPvEm465RcoYEC
    Account: zhuangjianguo
    Branch: claude/project-thread-bm91dz (the seat container's one push branch)
    Worktree: objectstack-issue-36500
    Domain: domain:ui
    Seat: repo:objectstack#7
    Area: f7-seat (a single-file test fix run from the seat)
    File surface: ui/packages/plugin-form/src/__tests__/masterDetailDetailsMembers-8071.test.tsx only (the bare reads named in comment 7081127197; the gridOf lookup made sturdy); no product code, no changeset (test-only)
    Container & model: S, os-dev subagent of the seat, default tier, effort: medium
    Clause-②: no — test file only, nothing published moves
    Metadata-protocol: none
    Responsibility: n/a — test race, no product defect
    Thread-read: 7081127197
    Premise: holds (measured red on main by two threads; the race reads gridProps before every section's grid is captured)
    Serial constraints cleared: overlap-check before push; three open PRs (#36437, #36438, #36461) wait on this, none touches this file.
    Pre-claim lane: maintainer exception to the seat's in-hand-only rule, chosen on the seat thread at 2026-11-22T15:19Z (option 「席位 7 例外修掉 #36500」).
    Pre-claim deps: none open.
    Prior rulings read: none on the card.
    Resume-from: none (fresh from origin/main)

  4. added
    pm:dispatched
    on Nov 22, 2026
  5. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: area set to area:fleet (a test; it had no area); pm:dispatched and p2 stand as filed. rationale: Bug · masterDetailDetailsMembers-8071 case 1 reads the captured grid before it exists and fails intermittently on unrelated PRs (Test UI shards 12/16 and 2/16) · size XS.

  6. added a commit that references this issue on Nov 23, 2026
    316f757
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:fleetbugdomain:uipm:dispatchedpriority:p2tests

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions