Skip to content

fix(platform): distinguish failed automation metrics reads - #4345

Merged
yannickmonney merged 1 commit into
mainfrom
fix/automation-metrics-read-errors
Oct 5, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/automation-metrics-read-errors

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Changes

  • Distinguish unavailable automation metrics from successful zero-run periods using the shared read-state helper and persistent, accessible error alert.
  • Add Try again for the current organization/period; hold the failure and busy retry through repeated failures and hand keyboard focus to the recovered metrics region.
  • Preserve cached figures and table rows after a failed refresh, naming their potentially stale state.
  • Add EN/DE/FR failure messages and document automated coverage. No backend, schema or infrastructure changes.

Verification

  • Real-page jsdom red/green: seven regressions fail before the fix; healthy controls pass. Final one-worker focused run: 41/41 pass, including metrics components, shared read-state tests and locale checks (30s per-test timeout for the catalog scanner on the shared host).
  • Scoped type-aware oxlint: exit 0. Scoped TypeScript diagnostics: page, both component tests and importing route, 0 diagnostics.
  • Scoped oxfmt check, git diff --check, manual reference gate and commitlint: pass.
  • Isolated Chromium fixture: EN/DE/FR failed-read alert/retry/recovery, cached-refresh failure, successful empty response and 390px German wrapping: pass. Only synthetic query results; no production network or writes.
  • Visual-aspect-analyzer: unchanged baseline 100/100, failed read 100/100, cached-refresh failure 100/100. Cached populated-page discovery reports its normal element cap; failure alert/retry are covered.

Closes #3869
Closes #3870

TALE-297 also covers duplicate TALE-298. Independent acceptance/merge/deployment remain separate from this implementation. Publication follows this run's mandatory push/PR workflow rather than the dispatch's conflicting local-only note.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

ACCEPT — independent exact-head review of PR #4345

Reviewed head: bb63331095a4418f4fd99f720d6155c6d9f50e2a (unchanged from dispatch; rechecked before posting).
Reviewer: Codex #7, agent ecfaae72-93ee-4d66-b93d-7a90d59234c7, run 01c0fde0-e0db-434b-a9a4-bb543ac271ce (TALE-818; manager dispatch run 6c6e9157).
Implementer: Codex #11, agent 7a7d20b9-15bf-4d0c-99bf-33e6e841a76c, run 5b87d765-efe9-46b2-9bad-5465bd426166.

Verdict and coverage

No blocking findings. Read #3869, #3870 and TALE-297: the two GitHub issues are duplicate descriptions of the same organization-level automation metrics defect; this PR covers both, including TALE-298.

  • Failed initial reads suppress KPI/chart/table output and false empty-run teaching; successful zero-run responses still show the healthy empty dashboard. Initial loading stays a skeleton, not an error.
  • The shared read-state helper retains the unavailable state through first-read retries. Try again refetches the current organization/period (7/30/90 days), stays named, busy, inert and focused through another failure, and hands focus to the named metrics region after recovery. Failed refreshes retain cached figures/rows with an explicit stale warning.
  • Reviewed shared alert/focus implementation and query adapter: the retry uses the existing organization-and-period query key; no new permissions, cross-tenant cache, backend writes or security boundary changes. Error detail goes through failureDetail, not serialized backend payloads or raw structured errors.
  • EN/DE/FR load-versus-refresh wording is equivalent and correctly uses the shared translated retry action. The English-only manual automation reference accurately describes the component coverage. Automated axe coverage is present; this review does not claim a browser or screen-reader run.

Independent verification

Existing dependencies only, one worker throughout; no install.

  1. bunx --no-install vitest run --config vitest.ui.config.ts --maxWorkers=1 app/features/analytics/automations/automation-metrics-page.read-errors.test.tsx app/features/analytics/automations/automation-metrics-page.test.tsx — 12/12 pass with /opt/node/bin first on PATH. The initial Bun-backed invocation hit the known Zod z.object collection error; the instructed Node fallback resolved collection.
  2. Same tests against current main's page via an output-only Vite source-transform control — 7 regressions fail, 5 controls pass. No repository source was edited. This independently reproduces the defect on main b3ecfcd9885592d4f83d8cf8d91be9b4a0770803.
  3. bunx --no-install vitest run --project server --maxWorkers=1 --testTimeout=30000 app/lib/backend/read-state.test.ts lib/i18n/messages.test.ts tests/guards/error-message-description.guard.test.ts — 53/53 pass (shared read states, locale parity/usage and error-payload guard). Combined head verification: 65/65.
  4. Scoped type-aware oxlint on the page, new/old component tests and importing route — exit 0. Scoped TypeScript compiler-API syntactic/semantic diagnostics on those four files, resolving imports with the repo options and ambient declarations — 0 diagnostics. The first harness lacked the existing UI setup's jest-dom augmentation; including that setup resolved its 25 harness-only matcher diagnostics. No whole-workspace type check.
  5. Scoped oxfmt and git diff --check — pass. Repository formatter intentionally excludes YAML/Markdown: those were reviewed manually; locale parity/usage checks passed.
  6. Passive CI snapshot — 51 SUCCESS, 26 SKIPPED, 1 NEUTRAL; no failures or pending checks. This is reported check state, not a claim that every cached CI task executed anew.

Overlap and boundaries

Current main still lacks the fix; git merge-tree --write-tree merges this head into main cleanly. Pairwise merge-tree checks with the current heads of #4339, #4342, #4343, #4344, #4346 and #4352 are all clean. No direct conflict with #4345 is expected: its locale additions are under analytics.automations.errors, while the others use personalization/governance/organization keys; its automation.md change is a metrics-table row, while #4339/#4342/#4346/#4352 insert near the top of Coverage map. In particular, #4352 has no direct automation.md conflict with #4345, consistent with its receipt. The top-of-map PRs can conflict with each other; preserve their paragraphs when integrating, rather than treating the shared filename alone as a #4345 conflict.

Unrun by this light-review brief: browser/visual analyzer, E2E, backend/database stack, live network recovery, screen-reader speech, full suite and whole-workspace lint/type/check gates. Those remain outside this acceptance scope; implementer browser claims were not independently rerun.

No push, merge, CI rerun, status change or native review decision. The human-captured TALE-297 review remains untouched. Integration/merge and any protected approval remain with their authorized owners. Deliverables and logs: /agent/output/75d1d29e-1838-452e-bd75-f877081f413a/.

@yannickmonney

Copy link
Copy Markdown
Contributor Author

TALE-827 merge receipt 2/4 — #4345

Accepted head bb63331095a4418f4fd99f720d6155c6d9f50e2a; normal squash merge SHA / eligible main source b8b70594bd6cd415940bf5eb9b1f60e3a20ba0ed.
OPEN/not draft; initial UNKNOWN resolved to CLEAN/MERGEABLE after brief wait. Checks: 51 SUCCESS, 26 conditional SKIPPED, 1 advisory NEUTRAL; none failing/pending.
Independent ACCEPT C7 run 01c0fde0; implementation C11 differs from merger C12 run cb4bdc7f-5fd3-4a6c-8eee-734081fc0908.
Squash message fetched from GitHub and byte-compared with mandated title and single commit-subject bullet: exact match, no trailer/attribution.
Covers TALE-297 and duplicate TALE-298. No admin bypass, push, update-branch, CI rerun, status change or native-review decision; human-captured review untouched. Eligible-source handoff is not release/candidate/deployment validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant