AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Saved SQL Queries Lost After Supabase Incident While Functions Remain Intact

User reports that all saved SQL queries disappeared from Supabase Studio after a Supabase service incident and page refresh, but database functions remain. This suggests queries were stored in a non-persistent or less redundant location compared to functions.

highConfidence 45%Supabase

Origin Analysis

Saved SQL queries were likely stored in the user's browser localStorage or a weakly-persistent client-side cache, while database functions are stored server-side in the database. The incident or refresh caused the client-side storage to be cleared, resulting in query loss. Alternatively, if queries are stored server-side, a specific table or object storage may have been corrupted or rolled back, while functions in a different table were unaffected.
1. During a Supabase service disruption, open the SQL editor and refresh the page. 2. Check the saved queries list. 3. Observe that all queries are missing while database functions remain accessible via the database.

Fixing Code Block

Edge Case Audit

This fix requires database schema changes and user authentication. Rollback: if issues arise, restore the previous localStorage-based storage by reverting the frontend code and restoring any backed-up localStorage data. Concurrent writes from multiple tabs may cause conflicts; use upsert with conflict resolution. Ensure RLS policies are properly configured to prevent unauthorized access.

Ecosystem Topology