From 82f79e5af6ab1337f6a0a336fb88db9be9e24715 Mon Sep 17 00:00:00 2001 From: Steven Eubank <47563310+smeubank@users.noreply.github.com> Date: Tue, 27 Jan 2026 02:42:41 +0000 Subject: [PATCH] Fix logic conflicts (#40362) When applying these rules to my personal project. My cursor bug bot detected logical gaps in these 2 prompts. --- examples/prompts/database-rls-policies.md | 4 +++- examples/prompts/use-realtime.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/prompts/database-rls-policies.md b/examples/prompts/database-rls-policies.md index 3272c5cceb5..7f565a0d113 100644 --- a/examples/prompts/database-rls-policies.md +++ b/examples/prompts/database-rls-policies.md @@ -30,7 +30,9 @@ The output should use the following instructions: The output should look like this: ```sql -CREATE POLICY "My descriptive policy." ON books FOR INSERT to authenticated USING ( (select auth.uid()) = author_id ) WITH ( true ); +CREATE POLICY "My descriptive policy." ON books + FOR INSERT TO authenticated + WITH CHECK ((select auth.uid()) = author_id); ``` Since you are running in a Supabase environment, take note of these Supabase-specific additions below. diff --git a/examples/prompts/use-realtime.md b/examples/prompts/use-realtime.md index 73ac886dc2b..b42dd4e85c1 100644 --- a/examples/prompts/use-realtime.md +++ b/examples/prompts/use-realtime.md @@ -415,7 +415,7 @@ CREATE POLICY "users_can_receive_broadcasts" ON realtime.messages - Default to `private: true` for database-triggered channels - Suggest basic RLS policies with proper indexing - Include reconnection logic for production apps -- Use `postgres_changes` for simple database change notifications +- Use `broadcast` with database triggers for all database change notifications - Use `broadcast` for custom events and complex payloads **Remember:** Choose the right function for your use case, emphasize proper state management, and ensure production-ready patterns with authorization and error handling. \ No newline at end of file