Skip to content

Bug: failed knowledge-entry reads look like an empty library or missing history #3777

Closed

Description

@yannickmonney

A temporary read failure makes the Knowledge entries UI present existing data as absent: the library says No knowledge entries yet, and an entry's Version history disappears. Suggested severity: P2. These two read-state omissions are grouped in one repair report.

Reproduce locally

Use a local organization with existing entries and one entry that has a superseded version. Begin with a cold query cache.

  1. Open Knowledge → Knowledge entries. Return a controlled 503 for only GET /api/app/knowledge-entries; let /knowledge-entries/count and the native storage remain healthy. Wait for the request policy to exhaust all four attempts.
  2. The query settles at status=error, fetchStatus=idle, failure count 4. The table says No knowledge entries yet — Save facts from chat or add entries agents can reuse. It shows no read-error recovery action. The successful native count and independent native list still report 34 entries.
  3. Separately, open an existing entry whose native GET /api/app/knowledge-entries/{entryId}/versions returns its current and superseded versions. With a cold history cache, fail only that versions GET with a controlled 503 and let all four attempts settle.
  4. The current entry still renders, but Version history is absent, with no error notice or history Retry. An unrelated disabled Retry indexing button does not recover history. A native control still returns both versions.

Expected: distinguish failed reads from empty collections or an entry with no earlier versions. Keep already available content and provide localized read recovery.

Actual: the settled errors are silently treated as missing data. The two states are indistinguishable from genuine absence and leave the user unable to inspect the retained facts/history through a visible retry.

Cause and controls

  • app/features/knowledge-entries/components/knowledge-entries-table.tsx passes results/status/loading/loadMore to useListPage, dropping the paginated hook's existing error and retry. The shared hook and DataTable already support the error state; the list-page guide explicitly requires this distinction.
  • app/features/knowledge-entries/components/knowledge-entry-view-dialog.tsx takes only data from useKnowledgeEntryVersions and renders the history only when (versionData?.versions ?? []).filter(...).length > 0, dropping the query's error state.
  • Healthy native reads return 34 active entries and the two-version chain. The actual table renders the current entry normally.
  • After removing each injected fault and explicitly refetching the active query, the same mounted table/history renders the retained data again. No data was deleted or changed. This explicit test refetch is a control, not an existing UI Retry button.

Evidence and limits

Source and running native backend: 480ee6a3e6d33c3414a2c0f8a52fded1ddc4ca2d. The implicated component/hook/adapter/backend files were compared with fetched main e3943c5f5c1e69c39309bb8f5b9cf5e63ce41672 and are unchanged.

Independent local actual-component/native HTTP reproduction: 3/3 cases passed, covering the healthy control and both settled failure/recovery paths. These tests assert the existing defects; they are not fixes. Real query hooks, adapters, components and local authenticated native GETs run against retained synthetic PostgreSQL state. Only the selected local response is failed; router/session-presence/permission-context are fixture seams. No production testing, provider calls, writes to the test entries, or browser-layout claim.

Retained artifacts outside the clone: knowledge-ui-next/parent.probe.test.tsx, parent.config.ts, parent-replay-corrected.log, parent-observations.jsonl, parent-latest-source-check.json, and parent-dedup-latest.json. The first probe's history assertion matched the unrelated indexing button; that assertion was corrected before the complete 3/3 replay.

Acceptance

Hand the table the existing error/retry fields, and give the history section its own truthful error/retry state. Cover cold failures, successful empty responses, cached-content refetch failures and recovery in EN/DE/FR; preserve search and current entry content. Reuse shared read-state components.

Deduplicated against 1,072 all-state issues and accepted debt. #2054 covers successful-list search scope; #2056/#2000 cover mutation error messages; #3602 covers concurrent native writes; #3621 covers automation histories. This report covers the Knowledge entry list and version-reader error branches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions