Skip to content

Production safety check is completely non-functional — missing field in Rust model #93

@EVWorth

Description

@EVWorth

Summary

The "production connection" safety warning/confirmation that should warn users before running destructive queries on production databases is completely bypassed. It has never worked.

Root Cause

The TypeScript frontend checks profile.environment === "production" in two places:

  • src/stores/resultStore.ts:41-47 (isProductionConnection computed)
  • src/components/editor/EditorTabs.tsx:120,158 (production badge rendering)

But the Rust backend ConnectionProfileSummary struct in src-tauri/crates/mas-core/src/models/connection.rs:25-42 has no environment field at all. The Rust struct serialized to the frontend never includes this field.

Impact

  • profile.environment is always undefined
  • profile.environment === "production" is always false
  • The destructive query confirmation dialog for production connections NEVER triggers
  • The production badge in EditorTabs NEVER renders
  • Users can accidentally run DROP TABLE / DELETE on production databases with zero warning

Fix

Add an environment field to the Rust ConnectionProfileSummary struct and ConnectionProfile struct, wire it through the connection store, and persist it in the SQLite store.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions