Skip to content

[2.1] Fixes #38372: split per-fetch loading flags in KnowledgePageVersionPage (#38408) - #38508

Merged
sweta1308 merged 1 commit into
2.1from
backport/2.1/pr-38408-knowledge-page-version-loading
Nov 24, 2026
Merged

sweta1308 merged 1 commit into
2.1from
backport/2.1/pr-38408-knowledge-page-version-loading

Conversation

@sweta1308

@sweta1308 sweta1308 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #38408 to 2.1.

Fixes #38372

Describe your changes:

Cherry-pick of 38872db from main, applied cleanly with no conflicts.

The Knowledge Center version-history page (KnowledgePageVersionPage) used one loading flag for three concurrent fetches, so whichever fetch resolved first removed the skeleton and left a torn frame: a blank content area, or content beside an empty timeline.

  • Separate loading flags for the version list (full-page skeleton) and the version data (content-area skeleton).
  • A request id on the version-data fetch, so a stale response cannot overwrite the version the user switched to.
  • A failed article lookup clears both flags instead of hanging on the skeleton.
  • A failed version-data fetch shows a "No Version" placeholder, inside a positioned Box, instead of the previous version's content or a blank area.
  • Removed the loading prop from KnowledgePageVersion; its only caller always passed false.

Type of change:

  • Bug fix

Tests:

  • Jest on 2.1: KnowledgePageVersionPage.test.tsx and KnowledgePageVersion.test.tsx, 11/11 passing.
  • tsc --noEmit on 2.1: no errors in the changed files.
  • Checked that 2.1 has everything the change uses: the File06 icon, the NoDataPlaceholder icon/title props, the label.no-entity and label.version keys, and the Box and SkeletonParagraph APIs.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Splits loading state in KnowledgePageVersionPage so the timeline and article content wait for their own requests.

  • Version history waits for the right data and ignores late replies.

Review used source inspection; tests and browser checks were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Look up article] --> B{Lookup succeeds?}
  B -->|No| C[Clear loading flags 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 result]
  G -->|Yes, succeeds| I[Show version content]
  G -->|Yes, fails| J[Show empty state]
  F --> K[Keep content skeleton until version fetch finishes]
Loading

Reviews (1) · Last reviewed commit: "Fixes #38372: split per-fetch loading fl..." · Reviewed by Greptile

…ge to eliminate torn version-history frame (#38408)

* 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.

---------

Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
Co-authored-by: Sweta Agarwalla <[email protected]>
Co-authored-by: Sweta Agarwalla <[email protected]>
(cherry picked from commit 38872db)
@sweta1308
sweta1308 requested a review from a team as a code owner November 23, 2026 14:59
@sweta1308
sweta1308 requested review from harsh-vador and removed request for a team November 23, 2026 14:59
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Separating version-fetch states and ignoring stale responses changes page rendering; request failures or fetch timing may show an empty version placeholder.

Splits the single loading flag in KnowledgePageVersionPage into separate flags for the version list and version data, and ignores stale version-data responses via a request id. A failed article lookup now clears the skeleton, and a failed version fetch shows a "No Version" placeholder. No open issues found.

✅ 1 closed
Closed: Edge Case: Full-page skeleton never clears if a new FQN resolves to the same id

📄 openmetadata-ui/src/main/resources/ui/src/pages/KnowledgePageVersionPage/KnowledgePageVersionPage.tsx:94-106 📄 openmetadata-ui/src/main/resources/ui/src/pages/KnowledgePageVersionPage/KnowledgePageVersionPage.tsx:155-157 📄 openmetadata-ui/src/main/resources/ui/src/pages/KnowledgePageVersionPage/KnowledgePageVersionPage.tsx:196-198
fetchKnowledgePage now calls setIsVersionListLoading(true) on every FQN change, and on success it never clears the flag. It counts on fetchVersionsInfo to clear it, but that effect only re-runs when knowledgePage?.id changes (line 157). Suppose the FQN changes but resolves to the same article id, for example after a rename (old FQN → new FQN) or through a differently encoded or cased FQN for the same entity. Then fetchVersionsInfo never runs, isVersionListLoading stays true, and the page shows the full-page skeleton forever. Before this change, the finally block always reset loading. The fix is to raise the list-loading flag only inside fetchVersionsInfo, which already sets it, and drop it from fetchKnowledgePage. A second option is to clear it in fetchKnowledgePage when the resolved id equals the current one.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sweta1308
sweta1308 merged commit 01ef793 into 2.1 Nov 24, 2026
52 of 54 checks passed
@sweta1308
sweta1308 deleted the backport/2.1/pr-38408-knowledge-page-version-loading branch November 24, 2026 04:01
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.

2 participants