Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

console open: a nav entry and a page element bound to the same API dataSource read it twice — the page does not reuse the answer the nav gate already read #13323

Closed

Description

@hotlong

Filing-gate category: ① a reproduced defect (reach: below), and ③ directed by the maintainer on cloud#3103:

「在 objectui 立卡修重复读(导航门读到的结果给页面元素复用),挂 pm:queue。」

Reader: the domain:ui lane, through pm:queue. The change is in two files:

  • packages/react/src/element-data-source/useElementApiDataSource.ts (readElementApi);
  • packages/app-shell/src/hooks/useNavMemberGates.ts.

It reaches cloud through a cloud pin move. Cloud's console-boots (pin-smoke, verify-console-pin.mjs, the cloud#2914 call budget) then measures it.

Dedupe: gh api search/issues, counting closed cards. Nothing open covers it.

#13029 is the closest: it added the nav entry's read. Its scope said "The reader reuses useElementApiDataSource, with no second fetch". Its contract review set the request count at "once per distinct binding per hook instance, sharing in flight" (comment). The duplicate below is outside that bound. This card asks for the next property: one read per open, across the nav gate and the page.

What happens

A nav entry declares an API dataSource, and the page it opens binds the same read on an element. Two things then happen:

  1. The nav gate reads the URL first (useNavMemberGates → readElementApi).
  2. About 300 ms later, the page element reads it again (useElementApiDataSource → readElementApi).

readElementApi shares a request only while it is in flight: .finally(() => IN_FLIGHT.delete(url)). When the nav read has settled before the page element mounts, a second GET goes out for an answer the console already holds.

reach: measured on cloud's control-plane console

Setup:

  • objectui 56cf4d8e (production console build).
  • The cloud rig: run-stack.sh --seed --with-ui --prod-console.
  • An ordinary organization owner, warm opens, zh-CN, 1299×1119.

The bindings in cloud:

  • The sidebar entry nav_environments declares dataSource: { provider: 'api', read: { url: '/api/v1/cloud/home' }, path: 'data' } (cloud#3002, cloud packages/app-cloud/src/cloud.app.ts).
  • The welcome and pricing pages bind the same read on their root element (HOME_SUMMARY_BINDING).

Readings, 8 opens per page, counted from the page's performance entries and from a window.fetch tracer:

page/welcome page/pricing
as served GET /api/v1/cloud/home ×2 on 8 of 8 opens ×2 on 8 of 8
only nav_environments.dataSource stripped from /api/v1/meta/app in the browser ×1 on 8 of 8 ×1 on 8 of 8

The tracer's two stacks:

  • the first GET from the nav gate's effect, readElementApi via useNavMemberGates;
  • the second from useElementApiDataSource's effect.

Cloud CI (console-boots) failed twice on it: run 39755148162, run 39759792471. The failures:

  • page/welcome (home): 1 URL(s) asked more than once: …/api/v1/cloud/home x2
  • page/pricing (billing): 23 API calls, budget 22

The maintainer waived console-boots once, for cloud#3150 only. Every later cloud pin PR's console-boots stays red on this until it lands.

Expected

On one console open, a nav entry's API dataSource and a page element bound to the same read make one request. The page element takes the answer the nav gate already read.

Renderer only: no spec or contract change. Both bindings are already the spec's ElementApiDataSource.

These hold as today:

Acceptance notes

  • A test in packages/app-shell or packages/react: an app whose nav entry and whose page's element bind the same { provider: 'api', read: { url } } mounts and settles. It records exactly one call of the host apiFetch for that URL, including when the nav read settles before the page element mounts (the case IN_FLIGHT misses).
  • Ablation: without the reuse, 2 calls.
  • A second test: a later open (a new route visit), or the element's refresh, makes a new call.
  • The consumer reading: cloud's console-boots on the pin PR that carries the fix shows page/welcome with no duplicate URL, and page/pricing within its budget of 22. The budget is not moved.

Suggested priority: p2. The cost is one extra control-plane request per open of these pages, and a red console-boots on each cloud pin PR until this lands.

Activity

  1. added
    bugSomething isn't working
    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seat
    on Oct 22, 2026
  2. added
    area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobs
    and removed on Oct 22, 2026
  3. objectstack-fleet commented on Oct 22, 2026

    @objectstack-fleet
    Contributor

    Claim: PM loop round 1 · 2026-10-22T15:51Z
    Session: session_01Nb7Hm9kSvmuJQ8Gs9n7QPL (the card session that implements; dispatched by this project's coordinator. The seat that writes this claim is domain:ui seat 1, session_01WJozybDmRH8z2c5SD7vJkj)
    Account: os-sales (the seat's linked user; the card's assignee)
    Branch: claude/issue-13323-reuse-nav-read
    Worktree: objectui-issue-13323
    Domain: domain:ui
    Seat: domain:ui#1
    File surface: packages/react/src/element-data-source/** (readElementApi's one-open reuse and its tests), packages/app-shell/src/hooks/useNavMemberGates.ts and its tests, possibly the console's open-boundary wiring in apps/console/src/**, the two packages' READMEs, the matching content/docs/guide/** page, .changeset/ (stop on breach; explain in the report)
    Container & model: M, mode:thread (a card session of the Sales account's project, base origin/main 74ebad0), model: opus (default; dispatch-gates --tier --repo objectstack-ai/objectui answered "no path-derived mandate"), effort: high
    Clause-②: yes
    Responsibility: objectui's readElementApi, whose in-flight sharing (.finally deletes the IN_FLIGHT entry) lets a settled nav-gate read be fetched again by the page element | no platform path covers it: #13029's contract bound the count per hook instance, not per open | cloud's console-boots pin smoke reaches it on every cloud pin PR (two red runs on the card); every console app whose nav entry and page bind the same API read pays one extra request per open
    Thread-read: none
    Serial constraints cleared: none (no open pm:dispatched card or open PR of this lane names packages/react/src/element-data-source/** or useNavMemberGates.ts; objectui#13324's PR #13326 touches packages/permissions and apps/console/src/AppContent.tsx only, and objectui#13183 is on list bulk actions)

    Why Clause-②: yes although no spec moves: marking "one open" may need a new export from @object-ui/react for @object-ui/app-shell to consume, which widens the public surface. The declaration has to survive a route the implementer has not chosen yet, so it is yes when unsure. If the delivered diff adds no export reachable from either package's entry, the report says so with the reading, and the seat's review records it.

  4. objectstack-fleet commented on Oct 22, 2026

    @objectstack-fleet
    Contributor

    File surface revised · domain:ui seat 1 · session_01WJozybDmRH8z2c5SD7vJkj · 2026-10-22T15:55Z · amends claim 6345071397, same session and branch.

    The implementer reported the breach before writing it: the one-open boundary is wired in packages/app-shell/src/console/ConsoleShell.tsx (ConnectedShellInner, where apiFetch is injected and the language remount lives), not in apps/console/src/**, plus one new internal file in packages/app-shell for the boundary component. Accepted; the revised file surface is:

    packages/react/src/element-data-source/**, packages/react/src/index.ts (the new ElementApiOpenScope export, which keeps Clause-②: yes), packages/app-shell/src/hooks/useNavMemberGates.ts, packages/app-shell/src/console/ConsoleShell.tsx and one new internal file beside it, their tests, the two packages' READMEs, the matching content/docs/guide/** page, .changeset/.

    Same lane (domain:ui), same packages family; no other open claim of this lane names these files.

  5. objectstack-fleet commented on Oct 22, 2026

    @objectstack-fleet
    Contributor

    LANDED · domain:ui seat 1 · session_01WJozybDmRH8z2c5SD7vJkj · 2026-10-22T18:06Z

    reading value
    PR #13328 merged through the merge queue at 2026-10-22T17:51:28Z, merge commit b911ebb4e6ed19ac43e87d00304861718a636679 (head a295d34)
    origin/main content packages/react/src/element-data-source/useElementApiDataSource.ts at main declares export function ElementApiOpenScope 1 time(s) (0 at 1aa88519)

    State: the card closed on the merge; pm:dispatched comes off in this stroke. The card's consumer reading (cloud console-boots: page/welcome with no duplicate URL, page/pricing within 22) belongs to the next cloud pin PR that carries b911ebb; this lane cannot read objectstack-ai/cloud.

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

Metadata

Metadata

Assignees

Labels

area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobsbugSomething 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