Skip to content

Fixes #38372: split per-fetch loading flags in KnowledgePageVersionPage to eliminate torn version-history frame - #38408

Merged
sweta1308 merged 7 commits into
mainfrom
detail/bug-fix/fixes-38372-split-per-fetch-loading-flags-in-knowl-518b29
Nov 23, 2026
Merged

sweta1308 merged 7 commits into
mainfrom
detail/bug-fix/fixes-38372-split-per-fetch-loading-flags-in-knowl-518b29

Conversation

@detail-app

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

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Describe your changes:

Fixes #38372

I worked on the Knowledge Center version-history page (KnowledgePageVersionPage), which flashed a torn frame on every load, because three concurrent fetchers (fetchKnowledgePage, fetchVersionsInfo, fetchActiveVersion) shared a single loading boolean and each cleared it in its own finally. Whichever fetch resolved first tore down the full-page skeleton while the others were still in flight — producing either a blank content area (timeline visible, no content, no skeleton) when the version-list response won the race, or the inverse (content visible beside an empty timeline shell with zero versions) when the version-data response won. On slow/unequal responses the blank frame persisted for the whole slow request; if version-data errored, it stayed blank permanently.

Type of change:

  • Bug fix

High-level design:

N/A — small change (one file plus its tests).

Tests:

Use cases covered

  • Initial page mount shows a single coherent full-page skeleton until the base page and the version list have both resolved (no blank frame, no empty timeline shell).
  • When the version-list response resolves before the version-data response, the timeline and version rail render alongside a per-region skeleton in the content area — never a blank content area, never committed previous content.
  • When the version-data response resolves before the version-list response, the full-page skeleton persists until the version list also resolves — never content visible with an empty timeline shell.
  • Version-only navigation does not re-fetch the base page or version list; only the version-data fetch re-runs; the timeline stays mounted and no stale previous-version content is committed.
  • Changing the FQN re-fetches the base page, version list, and version data, and renders the new article.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files updated: openmetadata-ui/src/main/resources/ui/src/pages/KnowledgePageVersionPage/KnowledgePageVersionPage.test.tsx
    • shows a per-region skeleton in the content area instead of a blank frame when the version list resolves before the version data on mount
    • keeps the full-page skeleton until the version list resolves even when the version data resolves first on mount
  • Both new tests fail on the pre-fix code with the exact torn-frame DOM described in the bug report (verified by stashing the source fix and re-running the suite), and pass with the fix. The four pre-existing tests remain green.

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.
  • Not added for this change: it is a single-page loading-state fix whose race conditions are deterministically reproducible in the Jest/jsdom infrastructure via deferred-promise mocks; the added unit tests cover both torn-frame scenarios end-to-end at the component level. Manual E2E steps to verify on a running stack: open a Knowledge Center article's version-history page on a throttled network and confirm a single skeleton (no blank frame, no empty timeline shell) followed by content + timeline together; click another version in the rail and confirm the content area transitions through a loading state while the timeline stays mounted.

Manual testing performed

  • Ran the page's Jest suite (6/6 pass) and confirmed the two new race tests deterministically reproduce the bug on the pre-fix source.
  • Ran the child component suite (KnowledgePageVersion.test.tsx, 3/3), the timeline suite (EntityVersionTimeline.test.tsx, 4/4), and a sibling page suite (DatabaseVersionPage.test.tsx, 3/3) — no regressions.
  • Ran the CI-parity UI checkstyle chain on the two changed files: organize-imports, lint:base --fix, pretty:base --write, license-header-fix — all clean; only the six pre-existing react-hooks/exhaustive-deps warnings the original file already carried.
  • Ran yarn tsc:check; no type errors in the changed file (one pre-existing unrelated error in src/utils/queryBuilderWidgets/OMSelectWidget.tsx is present on the unmodified baseline as well).

UI screen recording:

Not applicable — standalone loading-state bug fix for a non-feature page; no new UI feature or task with UI impact.

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.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • 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).
  • 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.
  • 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.
  • 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.

Automatic Fixes PRs can be configured here.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues remain.

Summary

Splits loading states in KnowledgePageVersionPage so one completed request cannot hide another request's loading screen.

  • The version-history page keeps its first screen together while requests finish.
  • Version changes show the latest article data or a clear empty state.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Fetch article] --> B{Article found?}
  B -->|No| C[Stop loading and show empty state]
  B -->|Yes| D[Fetch version list]
  B -->|Yes| E[Fetch selected version]
  D --> F[Show timeline]
  E --> G{Still the latest request?}
  G -->|No| H[Ignore response]
  G -->|Yes| I[Show version or empty state]
Loading

Reviews (6) · Last reviewed commit: "Merge branch 'main' into detail/bug-fix/..." · Reviewed by Greptile

@detail-app
detail-app Bot requested a review from a team as a code owner November 21, 2026 04:12
detail-app Bot and others added 3 commits November 21, 2026 05:54
Replaces  on the version-data skeleton Box
with the  Tailwind utility. The PR moved the skeleton into
a reusable const, which put the pre-existing inline style on a newly
added line and tripped the Antd + Less Deprecation Guard. The width is
unchanged.
…se fetch failure

Addresses greptile review feedback on PR #38408:
- Guard fetchActiveVersion state updates with a request id so a stale
  version-data response cannot overwrite a newer version's content when
  the user switches versions mid-flight.
- Clear isVersionDataLoading in fetchKnowledgePage's catch, since a
  failed base lookup leaves no knowledgePage to drive the version-data
  request and would otherwise hang the content skeleton.
- Add tests for both cases.
…fails to load

Clear the selected version on a failed version-data fetch so the page no
longer shows the previous version's content under the new version, or a
blank content area on first load. Drop the KnowledgePageVersion loading
prop, which its only caller always passed as false.
sweta1308 and others added 3 commits November 23, 2026 11:54
…t area

NoDataPlaceholder is absolutely positioned and fills its nearest positioned
ancestor. .version-data is not positioned, so the message centred across
the whole card, including the version rail. Wrap it in a relative Box with
a minimum height.
… Box

Replace the flex divs with a Box row. SkeletonParagraph is already a
full-width flex column, so it fills the space beside the avatar without
a wrapper.
@sweta1308
sweta1308 enabled auto-merge (squash) November 23, 2026 06:46
@sweta1308
sweta1308 disabled auto-merge November 23, 2026 06:51
@sweta1308
sweta1308 merged commit 38872db into main Nov 23, 2026
54 checks passed
@sweta1308
sweta1308 deleted the detail/bug-fix/fixes-38372-split-per-fetch-loading-flags-in-knowl-518b29 branch November 23, 2026 06:51
sweta1308 added a commit that referenced this pull request Nov 24, 2026
…ge to eliminate torn version-history frame (#38408) (#38508)

* fix(ui): split per-fetch loading flags in KnowledgePageVersionPage to eliminate torn version-history frame

* fix(ui): replace inline style with tw: utility to satisfy style guard

Replaces  on the version-data skeleton Box
with the  Tailwind utility. The PR moved the skeleton into
a reusable const, which put the pre-existing inline style on a newly
added line and tripped the Antd + Less Deprecation Guard. The width is
unchanged.

* fix(ui): guard stale version-data responses and clear data flag on base fetch failure

Addresses greptile review feedback on PR #38408:
- Guard fetchActiveVersion state updates with a request id so a stale
  version-data response cannot overwrite a newer version's content when
  the user switches versions mid-flight.
- Clear isVersionDataLoading in fetchKnowledgePage's catch, since a
  failed base lookup leaves no knowledgePage to drive the version-data
  request and would otherwise hang the content skeleton.
- Add tests for both cases.

* fix(ui): show a no-data placeholder when knowledge page version data fails to load

Clear the selected version on a failed version-data fetch so the page no
longer shows the previous version's content under the new version, or a
blank content area on first load. Drop the KnowledgePageVersion loading
prop, which its only caller always passed as false.

* fix(ui): contain the knowledge page version empty state in its content area

NoDataPlaceholder is absolutely positioned and fills its nearest positioned
ancestor. .version-data is not positioned, so the message centred across
the whole card, including the version rail. Wrap it in a relative Box with
a minimum height.

* refactor(ui): build the knowledge page version skeleton row with core Box

Replace the flex divs with a Box row. SkeletonParagraph is already a
full-width flex column, so it fills the space beside the avatar without
a wrapper.

---------




(cherry picked from commit 38872db)

Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
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: Version history page shows blank content or empty timeline due to concurrent loading-state race

3 participants