perf(ui): fetch entity in parallel with permission on 3 more detail pages (W1 rollout) - #30870
perf(ui): fetch entity in parallel with permission on 3 more detail pages (W1 rollout)#30870harsh-vador wants to merge 1 commit into
Conversation
…ages (W1 rollout) Applies the DatabaseDetailsPage (#30867) template to the react-query permission-gated detail pages: the entity useQuery was enabled only after the permission fetch resolved, forcing two serial round-trips on mount. Each now fires the GET in parallel with the permission fetch. - SearchIndexDetailsPage: enabled gated on FQN only. Render already checks !viewPermission before the error state, and there is no forbidden redirect, so no other change is needed. - StoredProcedurePage: enabled gated on FQN only; the FORBIDDEN redirect now fires only on a genuine permission desync (viewBasicPermission true), so a no-permission user falls through to the inline PERMISSION placeholder. - APICollectionPage: enabled gated on FQN only; the 403 branch is nested so a no-permission 403 redirects only on desync and never falls through to the error toast. Render already checks permission before isError. Updated the two tests that asserted the old "no permission => no fetch" waterfall behaviour to assert the new intended behaviour: the fetch fires in parallel and render still gates on permission (placeholder shown). All 16 unit tests across the three pages pass; eslint clean. As with the template, the 403/permission UX is best also confirmed in a running app / Playwright. Ref: open-metadata/openmetadata-collate#5442 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
🔴 Playwright Results — workflow failedValidated commit ✅ 0 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky Pipeline and setup failures (6)
Performance⚪ Performance metrics unavailable; see the CI and reporting failures above.
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsFetches entity data in parallel with permissions across SearchIndexDetailsPage, StoredProcedurePage, and APICollectionPage to eliminate request waterfalls. Consider refining the loading states to prevent no-permission users from seeing a loader before the permission placeholder. 💡 Edge Case: No-permission users now see a loader before the placeholder📄 openmetadata-ui/src/main/resources/ui/src/pages/SearchIndexDetailsPage/SearchIndexDetailsPage.tsx 📄 openmetadata-ui/src/main/resources/ui/src/pages/StoredProcedure/StoredProcedurePage.tsx In SearchIndexDetailsPage ( 🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
Description
Applies the DatabaseDetailsPage template (#30867) to the other react-query permission-gated detail pages. Each entity
useQuerywasenabledonly after the permission fetch resolved (enabled: ...viewPermission && !permissionsLoading), forcing two serial round-trips on mount. Each now fires the GET in parallel with the permission fetch.enabledgated on FQN only. Render already checks!viewPermissionbefore the error state and there is no forbidden redirect, so no other change is needed.enabledgated on FQN only; the/forbiddenredirect now fires only on a genuine permission desync (viewBasicPermissiontrue), so a no-permission user falls through to the inline PERMISSION placeholder.enabledgated on FQN only; the 403 branch is nested so a no-permission 403 redirects only on desync and never falls through to the error toast. Render already checks permission beforeisError.Type of change
Tests
Verification note
Same as the template — the 403 / permission UX is best also confirmed in a running app / Playwright (Jest mocks permissions, not the real backend 403). Check: happy path loads; a no-permission user sees the inline placeholder and is not redirected to /forbidden.
Ref: open-metadata/openmetadata-collate#5442