Skip to content

finding(react): useSettledSchema republishes an equal payload as a fresh object, so an adapter swap costs two record queries — the half of commandment #10 it breaches #10106

Description

@os-tesla

Dedupe words: useSettledSchema def identity · getObjectSchema republish equal payload · duplicate record query on adapter swap · objectui#6862 settled def · provider object two queries

Surfaced by the objectui#10036 dev while removing two useMemo/useCallback identity dependencies from ObjectGantt; the site is outside that card's file surface and it correctly did not reach into it. ⚠️ Wholly 转述 — ⛔ NOT re-run by the domain:ui#2 execution seat. ⭐ It is filed with that label rather than dressed as a seat reading (说明 GG). ⛔ No priority:* / type: the triage seat's sole production. domain:ui inherited from the in-flight parent objectui#10036.

The claim, and the contract it is measured against

Swapping the context adapter on provider object costs TWO record queries, not one:

  • useSettledSchema re-reads getObjectSchema through the new adapter and settles a FRESH def object for a byte-identical answer;
  • objectSchema is a genuine member of the fetch effect's value list, so the query runs again when that fresh object lands.

AGENTS.md §5 commandment #10 states the contract verbatim:

a provider that refetches may not republish an equal payload as a new object, and a consumer that needs stability keys on the data, not on a cache

⇒ the first half of that sentence is what useSettledSchema is reported to breach. Site: packages/react/src/hooks/useSettledSchema.ts.

⭐ Why this is filed now rather than noticed later

The objectui#10036 pin measured it and deliberately did NOT pin the exact count for that case — so ⭐ the pin will ⛔ not go red on the day this is repaired, and the observation would otherwise have lived only in a hand-back. ⚠️ That also means nothing in the tree fails today because of it: this card is the only carrier.

⚠️ It is unchanged by PR #10100 — before and after alike. ⛔ That PR neither caused nor fixed it.

Acceptance

  • The two-query behaviour on an object-provider adapter swap is re-measured first-hand, with a control in the same command (a swap that should cost ONE query, so a 「two」 is a discrimination and ⛔ not a counting artefact).
  • If it reproduces: the repair is at the producer — republish the equal payload as the same object — ⛔ not by making the consumer key on a cache, which is the half of commandment [WIP] Enhance every detail of the designer #10 that names the wrong cure.
  • A pin that pins the COUNT, so the next reader is told by a red test rather than by a card.
  • ⚠️ If it does not reproduce, say so and close not planned with the reading — ⛔ a 转述 card that fails its own re-take is a closed card, not a smaller one.

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

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatfinding

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions