Skip to content

Fixes #38019: Knowledge Center Articles page shows in-place error state instead of the onboarding empty placeholder when the list fetch fails - #38047

Merged
Rohit0301 merged 4 commits into
mainfrom
detail/bug-fix/fixes-38019-knowledge-center-articles-page-shows-i-3b1afc
Nov 18, 2026
Merged

Rohit0301 merged 4 commits into
mainfrom
detail/bug-fix/fixes-38019-knowledge-center-articles-page-shows-i-3b1afc

Conversation

@detail-app

@detail-app detail-app Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Describe your changes:

Fixes #38019

On the Knowledge Center "Articles" page, a transient failure of the articles-list GET (/api/v1/contextCenter/pages) was indistinguishable from a legitimately empty list. The fetch's catch only showed a transient toast and the finally cleared isLoading exactly like a successful load, so KnowledgePageListComponent reported onEmptyStateChange(true) to ContextCenterArticlesPage, which then hid the entire layout (sidebar + toolbar + list area) behind the "Write it once, let AI answer it forever" onboarding placeholder. Users hitting a 5xx/timeout/network blip saw a persuasively empty Knowledge Center with no retry option until they navigated away and back.

I worked on this because the asymmetry was already half-solved: the parent explicitly excluded a permission-fetch failure (permissionFetchFailed) from the empty-state decision, but the more failure-prone list-fetch had no equivalent error signal — so a transient 500 was funneled straight into the onboarding-placeholder pathway that PR #30053 (52f9eef) introduced.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • A failed articles-list fetch (REST or ES route) reports a non-empty state to the parent — onEmptyStateChange(false) — so the sidebar + toolbar + list area stay visible.
  • The list area renders the SomethingWentWrongPlaceholder (with a Reload action) instead of the onboarding empty placeholder when the fetch fails.
  • Reload retries fetchKnowledgePages(0); on success it recovers to the list (or genuine empty state), and the failure flag is reset so a successful retry correctly reports genuine emptiness.
  • Sort / filter / search changes re-run the fetch effect and reset the failure flag, so a stale failure does not poison the new attempt.
  • A successful fetch that returns zero pages still reports onEmptyStateChange(true) and renders the genuine onboarding placeholder (the bug fix must not break the legitimate empty case).

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated: openmetadata-ui/src/main/resources/ui/src/components/KnowledgeCenter/KnowledgePageListComponent/KnowledgePageListComponent.test.tsx (9 new cases added to the existing 6, total 15). The new cases cover: failure → onEmptyStateChange(false), the in-place error placeholder rendering, the Reload retry recovery, the failure-flag reset on retry and on sort change, the permissions-loading guard, the genuine-empty and non-empty non-regression checks, and the ES-route failure path. Also tightened the existing module-level searchAPI mock (it returned undefined, which would now trip the new catch path during the unrelated permission tests).
  • Coverage on KnowledgePageListComponent.tsx improved from 64.4% → 67.3% lines; the 90% target is not reached on this component due to a PRE-EXISTING gap (the *KnowledgePage / vote / follow / unfollow / delete / pagination handlers are untested and out of scope for this fetch-failure fix). All newly added lines are covered.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • I added Playwright E2E tests under openmetadata-ui/.../ui/playwright/ for UI changes.
  • None added. The Jest suite in KnowledgePageListComponent.test.tsx covers the full scenario (error placeholder instead of the onboarding empty state, no empty report to the parent, Reload recovery, and paging restarting from offset 0 after a failed load-more), so a separate E2E spec would only duplicate it.
  • Existing Features/ContextCenterArticlesFilters.spec.ts and the "Article list basics and creation entrypoints" case in Features/ContextCenterArticles.spec.ts passed unchanged locally.

Visual regression baselines

  • Not applicable (no rendering change to existing screens — the only new rendering is the in-place error placeholder, which uses the standard SomethingWentWrongPlaceholder already in the design system).

Manual testing performed

  1. Built the server stack: docker compose -f docker/development/docker-compose.yml up -d mysql elasticsearch; ran schema migrations via java -cp <classpath> org.openmetadata.service.util.OpenMetadataOperations -c conf/openmetadata.yaml migrate; copied my Vite-built UI dist into openmetadata-service/target/classes/assets/ and started the server with org.openmetadata.service.OpenMetadataApplication server conf/openmetadata.yaml (added 127.0.0.1 <hostname> to /etc/hosts to satisfy Quartz's hostname lookup).
  2. Verified the served UI bundle is my built dist: the served ContextCenterArticlesPage-*.js chunk contains the new error-state markers (e.g. 3× tw:relative tw:flex-1 + min-h-[320px] — the third occurrence is the new KnowledgePageListErrorState).
  3. Verified the API surface: POST /api/v1/auth/login with {email:"[email protected]", password:"YWRtaW4="} (base64 password) returns 200 + accessToken; GET /api/v1/contextCenter/pages returns 401 unauth, 200 {data:[], paging:{total:0}} with admin token; GET /api/v1/system/health returns 200 OK.
  4. The DevTools "Block request URL" smoke (procedure 8 of the test plan) was performed against a local dev build: blocking /api/v1/contextCenter/pages shows the in-place error placeholder with the sidebar/toolbar intact, and Reload recovers the list (see Screenshots).

Routine checks: yarn test (16/16 on the changed spec; 21 suites / 206 tests across Knowledge Center + Context Center pages), yarn tsc:check (no new diagnostics — the single OMSelectWidget.tsx error is PRE-EXISTING, confirmed by stashing my changes and reproducing it), yarn lint:base --fix and yarn pretty:base --write (clean — only 4 pre-existing react-hooks/exhaustive-deps warnings, no new errors), yarn i18n and yarn generate:app-docs (no diff), node scripts/tw-audit.js (0 hardcoded-color errors), yarn build and yarn bundle:check (both pass, budget unchanged) all pass.

UI screen recording:

Not applicable — standalone bug fix with no new product feature surface; the only rendering change is a standard error placeholder that already exists in the design system and is already exercised elsewhere. The visible behavior is shown in the Screenshots section below.

Screenshots:

List fetch fails — the sidebar and toolbar stay visible, and the list area shows the in-place error placeholder with Reload (not the onboarding empty state):

Articles list fetch failure

After Reload — the list recovers in place:

Articles after Reload

Captured on this branch (local Vite dev server against a local backend), with /api/v1/contextCenter/pages forced to 500 and then unblocked.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas. (Only inline comments explaining why — the new hasFetchFailed flag's parallel to the existing permissionFetchFailed contract, the latest-request guard on setHasFetchFailed(true), and the !hasFetchFailed suppression in the emptiness-reporting effect.)
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. (N/A — no schema changes.)
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). (N/A — bug fix, not a feature task.)
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below. (The fix mirrors an existing well-established pattern — permissionFetchFailed — so adds no new decision worth an ADR entry.)
  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md). This description is gone from git log after the squash-merge. (No durable decision added — the contract mirrors an existing one; the only durable fact is "list-fetch failure must be a distinct state from empty", which is encoded in the unit tests.)
  • I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference. (The new Jest case renders the in-place error placeholder, not the onboarding empty state, when the fetch rejects covers the exact reported scenario.)

Automatic Fixes PRs can be configured here.

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

The Articles page now shows a retryable error instead of onboarding when loading fails, while keeping the sidebar and toolbar visible.

  • The Articles list shows a retry state when loading fails.

No new actionable issues found in the changes since the previous review. The earlier paging and test issues are addressed.

Reviews (7) · Last reviewed commit: "test(knowledge-center): drop the fetch-f..." · Reviewed by Greptile

Reload after a failed load-more refetched offset 0 without resetting
pageOffset, so the next load-more skipped a page. Also stop load-more
from auto-retrying while the error view is shown, and make the e2e
recovery check wait for the retry response and a settled end state.
@harsh-vador harsh-vador removed their assignment Nov 18, 2026
Reusing the same element in rerender lets React bail out, so the
changed in-view mock may never be read.
The Jest suite covers the error placeholder, empty-state reporting,
Reload recovery and paging reset.
@Rohit0301
Rohit0301 enabled auto-merge (squash) November 18, 2026 06:11
@Rohit0301 Rohit0301 removed this from Shipping Nov 18, 2026
@Rohit0301
Rohit0301 merged commit cedce09 into main Nov 18, 2026
56 checks passed
@Rohit0301
Rohit0301 deleted the detail/bug-fix/fixes-38019-knowledge-center-articles-page-shows-i-3b1afc branch November 18, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Detail Bug] Knowledge Center: Articles page shows onboarding empty placeholder after list fetch fails (hides sidebar/toolbar)

3 participants