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.
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(isProductionConnectioncomputed)src/components/editor/EditorTabs.tsx:120,158(production badge rendering)But the Rust backend
ConnectionProfileSummarystruct insrc-tauri/crates/mas-core/src/models/connection.rs:25-42has noenvironmentfield at all. The Rust struct serialized to the frontend never includes this field.Impact
profile.environmentis alwaysundefinedprofile.environment === "production"is alwaysfalseDROP TABLE/DELETEon production databases with zero warningFix
Add an
environmentfield to the RustConnectionProfileSummarystruct andConnectionProfilestruct, wire it through the connection store, and persist it in the SQLite store.