Skip to content

Show a cancelled or partial restore as a warning, not a green success #793

Closed

Description

@EVWorth

Severity: P1 (misleads about database state)

What happens

  1. Open ?mock=connected. Toolbar → Restore, Browse (shop_backup.sql), database shop, click Restore.
  2. Click Cancel about a second in.

The result box is green with a check-mark icon and reads "Restore cancelled", while the line under it says "Rolled back, but part of the file had already been applied … so the structural changes stand." Green plus a check says "all good" when the database was partly changed.

Related on the same box:

  • On "Production (read-only)" with "Stop on error" unchecked, the heading reads "Stopped after 3480 error(s); 0 statements had run" — nothing stopped; the whole file ran and every statement failed.
  • The repeated error lines ("Statement 1: … 1290 …") trigger React's "Encountered two children with the same key" console error.

Cause

  • src/components/backup/RestoreDialog.tsx:362-370 picks success vs warning styling on statementsFailed === 0 only, ignoring summary.cancelled and summary.partiallyApplied.
  • :378 always says "Stopped after", regardless of stopOnError.
  • :391 uses key={err}; identical error strings collide.

Fix

Use warning styling and the alert icon when cancelled || partiallyApplied || statementsFailed > 0; keep green only for a clean full run. Word the heading by options.stopOnError (e.g. "Finished with N errors" when it was off). Key the error list by index.

Part of #783.

Activity

  1. added
    bug
    on Oct 21, 2026
  2. added a commit that references this issue on Oct 23, 2026
    090c780
  3. added a commit that references this issue on Oct 23, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions