Repository navigation
fix(console): ask a requiresObject and a packaged app's off-package lookup target by name only once the host serves it - #34299
Merged
Conversation
…y name only once the presence read answers it served Claude-Session: https://claude.ai/code/session_01ADHkmRxEQg2W4PJKcnZzTr Co-authored-by: Claude <noreply@anthropic.com>
…ge lookup targets Claude-Session: https://claude.ai/code/session_01ADHkmRxEQg2W4PJKcnZzTr Co-authored-by: Claude <noreply@anthropic.com>
…ckage lookup targets Claude-Session: https://claude.ai/code/session_01ADHkmRxEQg2W4PJKcnZzTr Co-authored-by: Claude <noreply@anthropic.com>
… required objects Claude-Session: https://claude.ai/code/session_01ADHkmRxEQg2W4PJKcnZzTr Co-authored-by: Claude <noreply@anthropic.com>
…bjects Claude-Session: https://claude.ai/code/session_01ADHkmRxEQg2W4PJKcnZzTr Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#2 · os-steve · session_01ADHkmSzhXR4yUAgwq1bQRi 维护者速读
席位意见一个存在性读取供所有读者共享,是根修,不是给每个读者各补一次判断。 席位核对 — ACCEPT · domain:ui#2 · head c9f6b80 · 2026-11-16T05:03Z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #34244
Clause-②: no
Metadata-protocol: none
维护者速读
requiresObject」不再直接按名字读对象定义,而是先用一次GET /meta/object?names=问服务端有没有,只有存在的才按名字读。路由、侧栏闸门、视图项读取、命令面板和nav:menu积木共用同一个判断函数。sys_approval_request)按名字读,每次打开页面都会 404,cloud#4300 的 staging 噪音多半就是这个。ui/packages/app-shell/src/console/appObjectScope.ts(readObjectPresence、servedByName)、ui/packages/app-shell/src/hooks/useNavMemberGates.ts(侧栏闸门改读存在性答案)、ui/packages/app-shell/src/views/nav-menu-renderer.tsx。cd ui && pnpm exec vitest run packages/app-shell/src/console/__tests__/appObjectScope-12811.test.tsx packages/app-shell/src/console/__tests__/AppContent.packagelessReads-29416.test.tsx,预期全部用例通过,且没有任何object/gone_obj、object/cloud_billing请求。What changes
One rule for both app arms, in one exported helper,
readObjectPresence(ui/packages/app-shell/src/console/appObjectScope.ts): a name a reader would otherwise ask by name is asked first in ONEGET /meta/object?names=read, which leaves an absent name out. In a packaged app the names the package list holds are registered and asked nothing more. A name joins a by-name scope only once that read answers it served (servedByName, the generalisation of #34188'sservedLookupTargets, which skipped the package arm).readPageObjectScope/readObjectRouteNames): now go through the presence read; package-held targets read as before.requiresObjecthad several by-name readers, not one, so the claim's surface was amended on the card by the seat:appObjectScope.ts, object, page, record and dashboard arms) asks only the served required names (servedRequiredObjectNames), and the command palette's navigation objects drop an entry object that is required and not served (paletteObjectNames);hooks/useNavMemberGates.ts): a package-less app asks itsrequiresObjectunion in the one?names=read inside an app too (it asked by name there); a packaged app reads the same presence answer as the route for its own required names, so it still hides an entry the answer leaves out;hooks/useServedViewItems.ts, package-less arm): a required object, including an entry that opens the object it requires, is asked by name only once served;nav:menublock (views/nav-menu-renderer.tsx): reads the package list plus the same presence answer, never by name.nav:menupass the same names to the helper, so the provider's batched names scope asks them once.Request counts (measured,
AppContent.packagelessReads-29416harness: real provider,AppContentand sidebar gate)/apps/notes/noteobject/gone_obj)/apps/app.crm/crm_account/apps/app.crm/page/crm_onlyRaw request sequences
Fixture: the harness's
CRM_APPwith the tworequiresObjectentries this PR adds (sys_user,gone_obj), both runs.One presence read or one per reader? For one set of names, one: the route, the sidebar gate, the served view items and
nav:menuall ask the same required names throughreadObjectPresence, and the provider asks a name of the batched scope once (the packaged rows above: one?names=sys_user,gone_objserves the route and the gate). A packaged page with an off-package lookup AND an off-packagerequiresObjectmakes two presence reads (pinned inappObjectScope-12811): the app's required names as the package list lands, then the route object's lookup targets once its definition lands. Folding them into one would hold the sidebar gate's answer until the page's bound object answers; not done. In the package-less arm the gate asks the app list's wholerequiresObjectunion (the bell's cross-app roster) while the route asks its own app's names, so the rest of the union is a separate?names=read (the?names=crm_accountabove).nav:menusharing the request: by construction and by the fake-context pin inpageObjectReads-12980; NOT MEASURED against the real provider (mountingnav:menuneeds the page renderer).Tests
appObjectScope-12811: "objectstack#34244 — a packaged app asks an off-package lookup target or a requiresObject by name only once it is served" (page and object route arms: noobject/sys_approval_request, noobject/cloud_billing, the exact two presence reads; the command palette open asks no unregistered entry object by name) + CONTROL (registered off-packagesys_userstill asked by name and in scope).AppContent.packagelessReads-29416(e): in a package-less and a packaged app,gone_objonly in a?names=read and its entry hidden by the real sidebar gate; CONTROL: a registered off-packagerequiresObjectis shown and asked by name.packagelessChromeScope-12980: the served view items ask an entry's required object the host lacks only in the presence read.scripts/ablation-replace.mjs, restore verifiedblob == HEAD,git diff HEADempty; ui vitest reads@object-ui/*fromsrc/, no build leg):servedByNamereturns every candidate: 7 red (both 34188 pins, both new 12811 pins, 29416 (a) and both (e)).missing(useNavMemberGates.ts): 2 red (29416 (e) packaged + its CONTROL, which waits on the hidden entry).paletteObjectNamesreturns every opened object: 2 red (both palette pins).useServedViewItems.ts): 1 red (new chrome pin).nav:menudrops the presence answer'smissing: 1 red (pageObjectReads-12980nav:menu pin).appObjectScope-12811: the card's named CONTROLthe same lookups drawn ask every target by nameflipped to… ask every registered target by name, once one presence read has answered them; four package-arm sequences gainobject?names=sys_user(root prefetch, record drawer, Console: a packaged app's object route reads the whole /meta/view list when a lookup target is outside its bundle #29551 bundled, health reports the wrong version, and the member record page logs meta/object 404s for sys_business_unit and sys_comment_reaction #33343 hidden lookup); the Console: a packaged app's object route reads the whole /meta/view list when a lookup target is outside its bundle #29551 bundled adapter double learnsoptions.names(it answered a?names=ask as the whole list).AppContent.packagelessReads-29416(a):object/crm_accountandobject/gone_objno longer by-name calls (the card's flip); the ConsoleLayout mock adds auser-entryprobe;CRM_APPgains tworequiresObjectentries for (e).AppContent.emptyPackageScope-13046(a), (b), CONTROL;AppContent.objectScope-12811(2);AppContent.packagelessRecordRelated-29552(3);AppContent.pageRouteObjects-12980(b): the expected sequences gain the presence reads, andcloud_onlymoves from by-name to?names=.navGateUnionScope-12980: (a) the union is asked in?names=reads, each name once, none by name; (b) rewritten from "a by-name read that fails" to "a presence read that fails leaves its entries shown" (newfailNamesReadbehaviour on the double); (c) and CONTROL (d): the off-package name in the presence read.packagelessChromeScope-12980(a),packagelessServedViews-29416: the presence read of the required names appears in the call list.pageObjectReads-12980nav:menu: the gate reads{ packageId, views: false }plus{ names: ['cloud_only'], views: false, batch: true }, nevercloud_onlyby name.AppContent.recordDrawerKeepsScope-27626deep link: before the held registry lands the list drawscrm_account,crm_contact;sys_userjoins once it lands (see Acceptance notes).13046,packagelessRoot-29552,pageRouteObjects-12980,recordDrawerKeepsScope-27626,packagelessChromeScope-12980,packagelessServedViews-29416) learnoptions.names, as Console: a page's lookup targets are asked one name at a time, and a target the host does not register answers 404 #34188's doubles did; without it a?names=ask read as the whole list.AppContent.*harnesses gain the module-topimport '@objectstack/lint';thatcheck:test-source-aliasrequires of an edited file reachingAppContent.Acceptance notes
MetadataProvider.readObjectScope). On a deep link to a drawer, the drawer starts the registry before the presence read, so a packaged list's off-package lookup target (its link in a lookup cell) now appears when the registry lands, not before; the list itself still draws on its scope before the registry. A package-less app's lookups have waited the same way since Console: a page's lookup targets are asked one name at a time, and a target the host does not register answers 404 #34188. Not changed here: asking during an in-flight registry read would add a request beside it.?names=read inside an app as well. Its old comment kept the in-app union by name so the route object's by-name read was shared with the record form (objectui#13044); the route still reads its object by name, so that sharing is unchanged.packagelessChromeScope-12980(a):object?names=note).Verification
Final head
c9f6b80b(main01598d93merged in; no overlap with this diff).ui/packages/app-shell/srcandui/apps/console/srcthat name a changed module,requiresObject,readObjectScope,AppContent,ConsoleLayout,UnifiedSidebar,ObjectVieworAppHeader:Test Files 375 passed (375),Tests 3344 passed (3344), lock VERDICT command-exit 0. Narrowed from the whole package (CI's Test UI shards run it).@object-ui/app-shelltype-check and the 37 derived gates (dispatch-gates --commands, reconciled with--ran): verdicts in the os-dev-report on Console: a packaged app's off-package lookup target, and a page's requiresObject, are still read by name and answer 404 when the host does not register them #34244.Generated by Claude Code