Skip to content

fix(sql-workspace): cancelling the destructive-query dialog still throws away the staged table edits #1771

Closed

Description

@ZhuchkaTriplesix

Problem

In `generic_sql_workspace.dart` (run path), `confirmDiscardTableEditsIfDirty` is asked first, and when the user agrees the staging buffer is disposed immediately. The destructive-query confirmation comes after that. If the user then cancels it, the query does not run, but the staged edits are already gone.

Fix

Dispose the buffer only after every confirmation has passed (just before the query starts), or ask the destructive question first. Add a widget test: dirty buffer, destructive SQL, answer "discard" and then "cancel" keeps the buffer.

Found in the review of the SQL safety layer.

Activity

  1. added
    bugSomething isn't working
    editorCode/SQL editor
    P2Medium priority / Parity & Refactoring
    on Oct 25, 2026
  2. ZhuchkaTriplesix commented on Oct 25, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Fixed on dev in #1785 (merged). Closing by hand: the PRs target dev, so GitHub would only close this when dev is merged into main.

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

    P2Medium priority / Parity & RefactoringbugSomething isn't workingeditorCode/SQL editor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions