Skip to content

[P1] [bug] handleSave ignores rows_affected — silent 0-row UPDATE #419

Closed

Description

@EVWorth

[P1] [bug] handleSave toasts "Applied N change(s)" even when rows_affected = 0 — silent partial-success

Context

handleSave (ResultsGrid.tsx:288-307) builds N statements, sends as a transactional batch via one api.executeQuery call. Result includes rows_affected per statement, but the handler ignores it.

Problem

Per docs/audits/results.md F23.

If the WHERE matches 0 rows (per F1/F7), MySQL returns rows_affected: 0. Toast says "Applied 1 change(s)" but no row changed. Worse: START TRANSACTION + COMMIT succeeds with 0-rows-affected UPDATE — user thinks data changed, then re-run shows the original value.

Files

  • src/components/grid/ResultsGrid.tsx:288-307

Repro (if applicable)

Static analysis only.

Expected

Editing name on a row whose id was deleted by another connection → "Saved but 1 of 1 changes may not have applied". Editing the same row when it exists → "Applied 1 change(s)".

Proposed fix

Scope M. Inspect rows_affected from each statement's QueryResult; if any is 0, show a warning toast and optionally mark cells as "save failed" with red border.

Acceptance

0-rows-affected UPDATE shows a warning; non-zero shows success.

Needs human verify

Yes

Labels: audit, area/results, severity/p1, kind/bug

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/results
    on Jul 31, 2026
  2. EVWorth commented on Sep 4, 2026

    @EVWorth
    OwnerAuthor

    Fixed by #529 (commit dc1f76c). handleSave in src/components/grid/ResultsGrid.tsx now sums rows_affected across the statements it issues and warns on a shortfall, so an UPDATE that matched nothing no longer reports success.

    Not auto-closed because the PR body wrote Refs #419 rather than a closing keyword.

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

    area/resultsauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions