Repository navigation
fix(platform): show audit, erasure and guardrail read failures - #5087
tale-code-bot wants to merge 4 commits into
Conversation
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
left a comment
There was a problem hiding this comment.
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 andread-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
nullreads as never checked.useIntegrityStatusis 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 sameisError. 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.tson the 4 touched suites plusaudit-logs-page.test.tsxandlogs-table-boundary.test.tsxat 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:manualok (1848 boxes);lint:conflictsexit 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.
|
Reviewer: not landing yet. The approved head
|
|
Reopened so the checks run again. The 20:13–20:15 UTC reopen started its runs from a test merge into |
|
Landed on |
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.
audit-log-table.tsx)useListPagegets the listing'serrorandretry, 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 loadedaudit-integrity-panel.tsx)readStateOf. A status that never answered showslogs.integrity.loadFailedwith 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'snullreads as never checkedrequests-list-section.tsx)approxRowCount={0}means "show the empty state")release-history-section.tsx(#4276):error/onRetryon the table, a notice above kept rows, a skeleton until the first page answers.loadFailedonly while more pages may follow,useListPage's ruleguardrails-overview.tsx)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 overviewNo second error concept: the change reuses what
mainalready has for this class,useListPage'serror/retry,useListReadRecovery,CatalogLoadErrorandreadStateOf, as in contacts/products/websites, the legal-hold lists, Trash and the usage metrics. New strings ship in en, de and fr; none needs ade-CHoverride (noß). One row per view goes intests/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, at4baf704d98f02ae7fa719f355a17819f18c896a1(see the test plan): oxfmt on the changed files,lint:conflicts,lint:manual, platformoxlint --type-awareandtsc --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.services/platform/messages/{en,de,fr}/settings.ymlandgovernance.yml. Node-CHoverride is needed.docs/*/platform/admin/governance/{audit-logs,data-subject-requests,guardrails}.md) describe these views' normal states, not their read failures.Test plan
Regression tests first: each was written before its fix and failed on
main(9be5cadac) for the reported reason. Onmainthe 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…Offafter 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" orneverChecked. 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 onlypii_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 wholeapp/features/settingsUI 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 --checkon the changed files,bun run lint:conflicts,bun run lint:manual: clean.Not run here, left to CI or the merge queue: the
browserproject (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.