Skip to content

bug(platform): automation version compare, Tests panel, Restore and "Saved by" turn a failed read into a false result #4828

Closed

Description

@yannickmonney

Problem

The new automation Versions and Tests views (#4795, #4797, #4801, #4808, #4811–#4819) handle most failed reads well: live version card, history tables, version picker. Four reads, though, turn a failure into a false result with no error and no Try again. Paths are under services/platform/app/features/automations/ at main aec031867.

# Read that fails Code What the user is told
1 The earlier version on the compare page (/versions/5 compares with v4 by default) components/versions/version-compare-page.tsx:171: before = … (beforeQuery.data ?? null), and beforeQuery.isError is never read. fromMissing (:252-255) only catches coded refusals (isMissingAutomationRead, lib/errors.ts:263-270), so a 5xx or network failure ends loading (:249-251) and the diff runs with before = null. diffAutomationDocuments treats null as a first version: every node, test and field "added" (lib/engine/core/diff/automation.ts:799-809). Every node, test and input of v5 is "Added", under a heading and picker that still say "v4 → v5". The YAML view's left side is empty. A reviewer comparing before a deploy or rollback gets a wrong diff (medium).
2 A version's stored test report (editor Tests panel) hooks/use-automation-tests.ts:150: const report = reportQuery.data ?? null;. The hook never reads reportQuery.isError, error or refetch, and it is the only consumer of useAutomationTestReport. With a null report each test's outcome is none and its status is not-run (lib/automation-tests/test-results.ts:184, :200). Every test says "Not run yet", coverage reads "Covers 0 of N paths" and every path "Not tested", while the Versions tab shows "Tests failed" for the same version. After a refused deploy, the alert "One of its tests fails. Tests shows which." sits over a list with no failing test (medium).
3 The automation itself on the Versions tab components/automation-versions-tab.tsx:81-82: latestVersion = automationQuery.data?.latestVersion ?? …version. When it is undefined, the restore dialog isn't mounted (:160-172), but version-history-table.tsx:336 still shows Restore as new version on every row (version !== latestVersion). Restore is offered on every row, the newest included, and clicking it does nothing. Per the sweep's notes, the compare page reads the same latestQuery (version-compare-page.tsx:202-203) and loses the Live badge. No error is shown, although the editor tab reports the same failure (low).
4 The member directory ("Saved by", "By", bylines) hooks/use-actor-label.ts:60: if (members === undefined) return { kind: 'pending', api };. The comment says this covers "loading, or failed", and nothing ever resolves the failed case. The Versions "Saved by" and Deployments "By" columns, the live card byline and the compare page byline pulse forever, and screen readers hear an empty cell (low).

Tests: none of the new component tests fails these reads. The QueryClient retries uncoded failures three times and refetches them on window focus (router.tsx:30-47), so a transient fault can heal on a refocus, but none of these views says that anything failed.

Expected

  • (1) Treat a failed before-read like the after-read (:235-247): an error with Try again, and no diff.

  • (2) Expose the report read state from useAutomationTests. Show "Couldn't load the test results" with Try again instead of not-run.

  • (3) Hide or disable Restore until the latest version is known, or show the read error as the editor does.

  • (4) Give useActorLabel a failed state with a plain fallback, and offer a retry.

  • Regression: for each view, a component test where the read fails (500 after retries) and must show an error with Try again:

    • the compare page must not render "Added" chips;
    • the Tests panel must not say "Not run yet";
    • Restore must not open a dead menu item;
    • "Saved by" must not pulse.

    On aec031867 all four fail.

Severity and owner

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. added a commit that references this issue on Oct 30, 2026
    5c35eee
  3. added a commit that references this issue on Oct 30, 2026
    e872084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions