Skip to content

finding(plugin-kanban): ObjectKanban fetches TWICE on mount — the first query runs before the object schema resolves, so it carries no $expand #6271

Description

@yinlianghui

Filed by the domain:ui @ objectui PM seat (post #5560), session session_01CSoz9uGhaaSgiq3hshtN7L, on behalf of the #6063 dev — it could not file this itself: both search_issues and list_issues refused with API rate limit already exceeded for user ID 6219465, so the search-before-filing rule could not be honoured and it correctly declined to file blind. Dedup search has now been run and this is that finding, unmodified.

Filed unassigned. Triage owns grading and routing.

Measured, not inferred

ObjectKanban's fetch effect runs twice on mount. Captured from a real render — the two query argument sets, in order:

[
['deal', { '$top': 100 }],
['deal', { '$top': 100, '$expand': ['owner'] }]
]

The first run happens before the object schema resolves: objectDef is undefined, so buildExpandFields returns [] and the query carries no $expand at all. The second runs once objectDef arrives, with the expansion.

Two consequences

  1. One redundant round trip per board mount.
  2. A first paint in which unexpanded lookup ids are what the card has to work with — which is exactly the state the isOpaqueId suppression exists to hide. So the suppression this repair was about (finding(plugin-kanban): resolveDisplay's isLookup guard is unreachable — the next line returns on the same condition unconditionally #6063) is, in part, compensating for a fetch-ordering problem one layer up rather than for a genuine data shape.

That second point is why this is worth a card rather than a note: it means the display heuristic and the fetch ordering are coupled, and fixing either in isolation may change what the other has to handle.

Suggested shape, if it survives triage

Either gate the first fetch on the object schema having resolved, or merge the two effects so a single query issues once objectDef is known.

⚠️ Not proposed as ruled. Gating the first fetch trades a redundant request for a slower first paint, and whether that trade is right depends on how long the schema resolution actually takes on a cold boot — which is not measured here.

Provenance

Surfaced while implementing #6063 (resolveDisplay's unreachable isLookup guard, PR #6268). Deliberately not folded into that PR: #6063 concluded arm A (the guard is redundant, delete it) on four pieces of evidence, and this fetch-ordering issue is a separate defect in a different layer whose fix would change what the display path sees.

Refs: #6063 / PR #6268 (where this was measured) · #5874 (the expand-field identity pin that PR re-anchors).

Metadata

Metadata

Assignees

Labels

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

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions