Repository navigation
Description
Detail Bug Report
Introduced in #28014 by @harshach on May 25, 2026
Summary
- Context: Hovering/focusing an entity card in Explore prefetches the entity via React Query so the detail page that follows renders instantly from a warm cache slot (
rest/queries/pipelineQuery.ts, wired incomponents/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx). - Bug: The prefetch writes its cache slot under a field string with no spaces after commas, while the pipeline detail page reads its slot using
defaultFieldsfromutils/PipelineDetailsUtils.tsx, which contains spaces — so the two React Query keys can never be equal and the prefetch slot is never consumed. - Actual vs. expected: Every hover/focus on a pipeline Explore card issues a full
GET /api/v1/pipelines/name/{fqn}?fields=...whose response is never read, and navigating to the pipeline detail page always renders from the network with a cold cache; expected — the prefetch populates the exact slot the page queries, giving an instant paint. - Impact: The entire pipeline hover-prefetch feature is dead code: one full-entity API call per hover whose response is never consumed (the hover fetch itself matches the working Topic/Table design; only its result goes unused), and the "perceived-latency" optimization it was designed for (instant paint on click) never happens for pipelines.
Code with Bug
// rest/queries/pipelineQuery.ts — prefetch side (inlined list, bare commas)
const PIPELINE_DEFAULT_FIELDS = [
TabSpecificField.FOLLOWERS,
TabSpecificField.TASKS,
// ...
].join(','); // <-- BUG 🔴 bare commas, no spaces
const PREFETCH_PIPELINE_FIELDS = `${PIPELINE_DEFAULT_FIELDS},${TabSpecificField.USAGE_SUMMARY}`;
export const prefetchPipeline = (queryClient: QueryClient, fqn: string) =>
prefetchPipelineByFqn(queryClient, fqn, PREFETCH_PIPELINE_FIELDS);// utils/PipelineDetailsUtils.tsx — page side (defaultFields used by the page's query key)
export const defaultFields = `${TabSpecificField.FOLLOWERS}, ${TabSpecificField.TAGS}, ${TabSpecificField.OWNERS},${TabSpecificField.TASKS}, ${TabSpecificField.PIPELINE_STATUS}, ${TabSpecificField.DOMAINS},${TabSpecificField.DATA_PRODUCTS},${TabSpecificField.VOTES},${TabSpecificField.EXTENSION}`;
// ^-- BUG 🔴 stray spaces after some commas// pages/PipelineDetails/PipelineDetailsPage.component.tsx — page reads the cache with this key
const pipelineFields = useMemo(() => {
let fields = defaultFields; // spaces preserved
if (viewUsagePermission) {
fields += `,${TabSpecificField.USAGE_SUMMARY}`;
}
return fields;
}, [viewUsagePermission]);
const pipelineCacheKey = useMemo(
() => pipelineQueryKey(decodedPipelineFQN, pipelineFields), // <-- BUG 🔴 never equal to prefetch key
[decodedPipelineFQN, pipelineFields]
);Explanation
React Query query keys are hashed by exact equality of key elements. Both prefetch and page use pipelineQueryKey(fqn, fields) (i.e., ['pipeline', fqn, fields]), but they build fields strings with different whitespace.
Backend tolerance for whitespace is irrelevant: both fields variants return identical payloads, but they populate different React Query cache slots, so the detail page never hits the prefetch-populated slot.
Codebase Inconsistency
rest/queries/pipelineQuery.tsexplicitly states intent with a "Keep this list in sync with PipelineDetailsUtils.defaultFields" comment, but uses a whitespace-free joined list whileutils/PipelineDetailsUtils.tsxincludes spaces.- Siblings demonstrate the intended working pattern: Topic shares the exact same constant between prefetch and page; Table uses a space-free fields constant on both sides.
Recommended Fix
Normalize whitespace at the query-key boundary (or derive both from one shared source) so logically-equivalent field lists map to the same cache slot:
// rest/queries/pipelineQuery.ts
export const normalizeFields = (fields: string) => fields.replace(/\s+/g, '');
export const pipelineQueryKey = (fqn: string, fields: string) =>
['pipeline', fqn, normalizeFields(fields)] as const; // now both sides agree (for a given permission state)History
This bug was introduced in commit 38f32a6 (PR #28014, "Perceived-latency P1: ETag/304, deferred tab fetches, lazy widgets", 2026-05-25). The commit added prefetchPipeline with an inlined comma-joined field list (no spaces) that could not match the pre-existing space-containing PipelineDetailsUtils.defaultFields, so the prefetch slot has never been consumed.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone ✅
Activity
Fixes open-metadata#38348: normalize pipeline query key so hover-pref…
Fixes #38348: normalize pipeline query key so hover-prefetch warms de…