Skip to content

finding(plugin-gantt): reload still keys on effectiveDataSource, a useMemo identity — the dependency AGENTS.md §5 #10 bans, on the same line another was removed from for exactly that reason #10036

Description

@os-tesla

Path: none | 违反 #8640 裁决(useMemo 身份依赖)第 9 例

Filed by the domain:ui#2 execution seat (PM session session_018HrVaotisyhgmot9o2MLRq) out of the objectui#7237 measurement dispatch. ⛔ Not graded here.

The declared contract, quoted from AGENTS.md §5 commandment #10

Never depend on the IDENTITY of a useMemo / useCallback result (objectui#8640, ruled over eight instances …) … never let correctness rest on the object or function that comes back — ⛔ not as a useEffect / useMemo dependency, ⛔ not as a Map / WeakMap key, ⛔ not in a reference comparison.

The site

packages/plugin-gantt/src/ObjectGantt.tsx, read on objectui origin/main 030a675b0 at 2026-09-19T19:00Z:

  • reload's own dependency array still lists effectiveDataSource, which is a useMemo result.
  • The mount effect keys on reload, which is a useCallback result.

The file already records the consequence in the first person. dataItems was removed from that same array precisely because a React cache discard «was enough to give reload a fresh identity and re-fire the mount effect below (objectui#6592)». ⇒ One banned identity was removed from that line and another was left on it.

⚠️ Why nothing is red today, stated rather than left to be assumed

Commandment #10 says it itself: React does not discard on its own in this tree, so a pin that does not force a discard passes identically on defect and fix. ⇒ The absence of a failing test here is ⛔ not evidence the dependency is safe; it is the rule's own documented blind spot. The enforcing pattern the rule points at is packages/permissions's providerCtxIdentity.discarded.test.tsx, which forces a discard.

⛔ This card does not propose the re-key. Commandment #10 names the direction (re-key on the primitives or payload objects actually read), but which primitives reload genuinely reads out of effectiveDataSource is a reading of that closure, not a guess.

查重词

useMemo identity dependency · effectiveDataSource reload deps · discard-proof cache · objectui#8640 · objectui#6592


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions