Skip to content

fix(platform): show audit, erasure and guardrail read failures - #5087

Closed
tale-code-bot wants to merge 4 commits into
mainfrom
fix/governance-read-failures
Closed

tale-code-bot wants to merge 4 commits into
mainfrom
fix/governance-read-failures

Conversation

@tale-code-bot

Copy link
Copy Markdown
Collaborator

Summary

Four governance views stated something false when their read failed, and none offered Try again (#4834). Each one now names the failure and offers a retry. Successful empty reads and genuinely disabled policies look as before. Task: TALE-171.

View Before Now
Logs › Audit logs / Error logs (audit-log-table.tsx) A failed first page settled as an exhausted, empty listing: "No audit logs" / "No error logs" useListPage gets the listing's error and retry, so a failed first page shows the table's error with Try again. A failed later page keeps the rows, names the failure above them (logs.{audit,errors}.refreshFailed), and the footer says the rest couldn't be loaded
Logs › Chain integrity (audit-integrity-panel.tsx) "Not yet checked" + "No automated integrity check has run yet", hiding any alert the status carries Status read through readStateOf. A status that never answered shows logs.integrity.loadFailed with Try again, which stays put and busy through its retry. A failed refresh keeps the last status and says it may be out of date. Only the server's null reads as never checked
Data subject requests (requests-list-section.tsx) "No erasure requests yet" on a failed first page, and also while the first page loaded (approxRowCount={0} means "show the empty state") Same handling as release-history-section.tsx (#4276): error/onRetry on the table, a notice above kept rows, a skeleton until the first page answers. loadFailed only while more pages may follow, useListPage's rule
Guardrails overview cards (guardrails-overview.tsx) A policy that couldn't be read showed Off / Not configured, contradicting its section's read-failure alert below Such a card says Unknown: when the read never answered, and when a refresh failed, because the section below hides its editor on the same isError. Once every policy read has settled, one alert above the cards names it. Try again re-reads only the failed policies, which are the cache entries the sections read too, and a retry no longer re-skeletonizes the overview

No second error concept: the change reuses what main already has for this class, useListPage's error/retry, useListReadRecovery, CatalogLoadError and readStateOf, as in contacts/products/websites, the legal-hold lists, Trash and the usage metrics. New strings ship in en, de and fr; none needs a de-CH override (no ß). One row per view goes in tests/manual/reference/automation.md. The user docs don't describe these failure states, so the docs are unchanged.

Closes #4834

Checklist

  • bun run check — not run in full in this worker. I ran the parts this change touches, at 4baf704d98f02ae7fa719f355a17819f18c896a1 (see the test plan): oxfmt on the changed files, lint:conflicts, lint:manual, platform oxlint --type-aware and tsc --noEmit, the platform i18n suites and two guards, and the settings/governance UI suites. CI's fast tier runs the rest.
  • bun run lint:sast — not run. Opengrep isn't cached in this worker, so the pre-commit scan skipped itself, and installing it would mean downloading a binary from outside the lockfiles. Left to the PR's SAST check.
  • Translations updated in services/platform/messages/{en,de,fr}/settings.yml and governance.yml. No de-CH override is needed.
  • Docs — N/A: the guides (docs/*/platform/admin/governance/{audit-logs,data-subject-requests,guardrails}.md) describe these views' normal states, not their read failures.
  • README — N/A: no setup, env or CLI change.

Test plan

Regression tests first: each was written before its fix and failed on main (9be5cadac) for the reported reason. On main the audit/error tables rendered "No audit logs" / "No error logs" and had no alert for a failed later page. The integrity panel showed "Not yet checked". The erasure list showed "No erasure requests yet", also while loading. A probe showed the PII card reading …Off after its read failed. The refinements were mutation-checked: reverting each one makes its test fail.

  • audit-log-table.test.tsx, both variants: a failed first page shows the error and Try again, the retry keeps focus on the named list, and the rows come back. A failed later page keeps the rows, shows the notice and "the rest couldn't be loaded", and retries. Control: an answered empty read still shows the empty copy.
  • audit-integrity-panel.test.tsx: a failed status read never shows "Not yet checked" or neverChecked. Try again stays the same node, aria-busy, through react-query's reset to pending, then shows the recovered alert status. A failed refresh keeps "Verified" and adds the out-of-date note. axe passes in the failure state.
  • requests-list-section.test.tsx: failed first page → error → Try again → skeleton, focus on the list → rows. No empty copy while the first page loads. A failed later page keeps the rows. A complete list whose refresh failed doesn't claim a rest. Control: an answered empty read still shows the empty copy.
  • guardrails-overview.test.tsx, with policy reads through a real react-query observer: a failed PII read gives Unknown, never Off, while the answered cards keep Not configured. Try again re-reads only pii_config, stays busy with no skeleton, and recovers to On. All three failing gives three Unknown. A failed refresh gives Unknown. No alert under the skeleton while another policy still loads.

Commands run in this worker, all green at 4baf704d98f02ae7fa719f355a17819f18c896a1:

  • bunx vitest --run --config vitest.ui.config.ts app/features/settings/audit-logs app/features/settings/governance app/features/analytics/chat-health: 66 files, 819 tests. Before the last two refinements and the commit hook's formatting, the whole app/features/settings UI set (plus chat-health) also passed: 180 files, 2025 tests.
  • bunx vitest --run --project server lib/i18n/ tests/guards/error-message-description.guard.test.ts tests/guards/single-failure-toast.guard.test.ts: 13 files, 699 tests. The i18n report-mode dumps list nothing for the new keys.
  • bunx tsc --noEmit (platform, 6 GiB heap): exit 0. bunx oxlint --type-aware (platform): no findings.
  • oxfmt --check on the changed files, bun run lint:conflicts, bun run lint:manual: clean.

Not run here, left to CI or the merge queue: the browser project (no Chromium in this worker), E2E, Build, and a visual check of the four failure states in a running stack. Forcing those reads to fail needs a live backend. Real-browser layout and screen-reader announcements of the new notices stay manual, as the register rows say.

Related: TALE-107 (#4665) should reuse the same handling for the notification panel. TALE-186 edits the same Guardrails cards' summary strings; this PR leaves those lines alone.

A failed first page of the Audit logs or Error logs tab settled as an
exhausted, empty listing, so the table told a compliance reviewer "No
audit logs" (or "No error logs") about a trail it never read.

The table now hands the listing's error and retry to useListPage: a
failed first page shows the table's error with Try again, which hands
its focus to the list, and a failed later page keeps the loaded rows
and names the failure above them, as the contacts and products lists
do through useListReadRecovery.

Refs #4834
When the Chain integrity status failed to load, the panel showed the
"Not yet checked" badge and "No automated integrity check has run
yet": a failed read passed for one that answered "never checked", and
it hid any alert the status carries.

The panel now reads the status through readStateOf. A status that
never answered is named with Try again, which stays put and busy
through its retry; a failed refresh keeps the last status and says it
may be out of date. Only the server's null reads as never checked.

Refs #4834
A failed first page of the data subject requests list showed "No
erasure requests yet", which invites filing a duplicate erasure. The
first page said the same while it loaded: the table was told to
expect zero rows before the read answered.

The list now hands the read's error and retry to the table, names a
failure under requests already loaded above them with the same
retry, and shows its skeleton until the first page answers, as the
legal-hold release history does. A failed read stops the scroll and
says the rest could not be loaded only while more pages may follow.

Refs #4834
A Guardrails overview card whose policy read failed showed Off (or
Not configured), because a policy that never loaded reads as switched
off. That contradicted the read-failure alert of its own section
further down the page.

Such a card now says Unknown, as long as its section below names the
failure: when the read never answered and when a refresh failed. Once
every policy read has settled, one alert above the cards names the
failure; its Try again re-reads only the failed policies, the cache
entries the sections read too, and a retry no longer turns the
overview back into its skeleton.

Refs #4834

@tale-review-bot tale-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 4baf704d98f02ae7fa719f355a17819f18c896a1 (base main 9be5cadac) for TALE-171 / #4834.

Scope. The PR fixes the four views the issue names and does nothing else. Audit and Error logs tables, the Chain integrity panel, the Data subject requests list and the Guardrails overview cards now name a failed read with Try again, instead of showing the empty, never-checked or Off copy. It reuses what main already has: useListPage's error/retry, useListReadRecovery, CatalogLoadError and readStateOf. The audit region wrapper uses the same classes as the contacts, products and websites sticky tables. The DSR list follows release-history-section.tsx. The extra DSR fix (approxRowCount={0} showed "No erasure requests yet" while the first page loaded) is the same false claim on the same view, so it is in scope.

Correctness.

  • I followed each change into use-cached-paginated-query.ts, use-list-page.ts, DataTable's body state machine and read-state.ts.
  • A failed first page goes to the table's error state. Its retry resets to pending and shows the skeleton, not the empty state. A failed later page keeps its rows and the notice stays up, busy, through fetchNextPage.
  • In the integrity panel, only the server's null reads as never checked. useIntegrityStatus is always enabled, so the masked line cannot hang.
  • A Guardrails card is Unknown both when its read never answered and when a refresh failed. This matches PolicyReadBoundary, which hides the section's editor on the same isError. The overview no longer re-skeletonizes during a retry.
  • LogsTableBoundary's retry fallback still renders the skeleton.

Tests (run by me, credentials removed, deps from the lockfile).

  • vitest --config vitest.ui.config.ts on the 4 touched suites plus audit-logs-page.test.tsx and logs-table-boundary.test.tsx at the head: 6 files, 88 passed.
  • Regression proof: I put main's 4 source files under the new tests and 14 new tests fail, for the reported reasons. Examples: "Not yet checked" present, "No audit logs", "No error logs" and "No erasure requests yet" present (the last also while loading), and no failure notice. The controls (an answered empty read still shows the empty copy) still pass. Files restored afterwards.
  • vitest --project server lib/i18n/ plus the error-message and single-failure-toast guards: 13 files, 699 passed.
  • lint:manual ok (1848 boxes); lint:conflicts exit 0.

Contract. Branch fix/governance-read-failures. Commitlint-shaped title (62 chars) and commits. New strings in en/de/fr; no ß, so no de-CH override is owed. Four 🔶 rows in tests/manual/reference/automation.md. The governance docs list no card or failure states, so they need no change.

Security. No secret, permission, dependency or workflow change. The notices show fixed localized strings, never an error payload.

Checks at this head. All 7 required CI ready checks passed:

  • Checks run 40919735289 (Format, Lint, Type check, Knip, Unit 1/2 and 2/2, workspaces)
  • Commitlint run 40919735242
  • SAST run 40919735387 (Opengrep)
  • E2E run 40919735392
  • CLI run 40919735256
  • Security run 40919735544
  • Build run 40919735359

Not run by me: the browser project, the full UI shards, E2E and Build. These run in the merge queue. No Chromium here; the existing browser test covers only the detail dialog, which stays outside the new region.

Non-blocking nit: in guardrails-overview.test.tsx the first oxlint-disable-next-line react-hooks/rules-of-hooks sits above the if, not above a hook call. Lint passed, so it is harmless.

@tale-review-bot
tale-review-bot added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 29, 2026
@tale-review-bot
tale-review-bot added this pull request to the merge queue Oct 29, 2026
@yannickmonney
yannickmonney removed this pull request from the merge queue due to a manual request Oct 29, 2026
@yannickmonney yannickmonney reopened this Oct 29, 2026
@tale-review-bot
tale-review-bot enabled auto-merge (squash) October 29, 2026 20:19
@tale-review-bot

Copy link
Copy Markdown
Collaborator

Reviewer: not landing yet. The approved head 4baf704d98f02ae7fa719f355a17819f18c896a1 has no CI round under the current workflows.

  • The newest Checks run on this head, 40947287636 (created 20:14 UTC), checked out Merge 4baf704d98f02ae7fa719f355a17819f18c896a1 into 9be5cadacb5f59cd6b2cc67c7840e3c0101bdde2 (merge commit ed9ab28). That is main from before 0da08205 ("ci: land each pull request on its own, without the merge queue"), so the run uses the old workflows.
  • In that run, UI (both jobs), Browser, Performance and Backend integration were skipped. The current .github/CI.md has a pull request run every suite its paths owe. Its CI ready (Checks) job is still queued.
  • What lands it: a fresh round on the same head under the current workflows. Closing and reopening the pull request rebuilds its test merge on the current main; draft→ready does not. My approval of 4baf704d98f02ae7fa719f355a17819f18c896a1 stands while the head is unchanged. Once every CI ready (...) of that round has finished green, it lands with gh pr merge --squash --auto --match-head-commit 4baf704d98f02ae7fa719f355a17819f18c896a1 after a hold read.

@yannickmonney

yannickmonney commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Reopened so the checks run again. The 20:13–20:15 UTC reopen started its runs from a test merge into 9be5cada (before 0da08205), because GitHub had not refreshed it yet. This reopen's runs start from the test merge 5128516d41, into 0da08205. The head is unchanged (no new commit).

@yannickmonney

Copy link
Copy Markdown
Contributor

Landed on train as ee82e82: squashed at the approved head after the fast gate (formatting, typecheck, build). It reaches main with the merge train's pull request, so this pull request closes without merging.

yannickmonney pushed a commit that referenced this pull request Oct 30, 2026
Reviewed and approved in pull request #5087 at 4baf704.

Closes #4834
Task: TALE-171
@yannickmonney
yannickmonney deleted the fix/governance-read-failures branch October 30, 2026 10:32
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.

bug(platform): audit logs, integrity status, erasure requests and guardrail cards say "nothing there" when their read fails

3 participants