Supabase RLS returns an empty array
An empty array from supabase-js is not a network error. PostgREST returns [] when RLS hides every row. That is the safe outcome. The bug is a policy that doesn't match how you store the owner.
Why this happens
- The policy compares auth.uid() to user_id, but the column stores the email or a profile id.
- RLS is on and there is no select policy yet, so nobody can read.
- The request uses the anon key and the policy requires an authenticated role.
What ShipWatch looks for
- ShipWatch's public scan calls the REST API with only the anon key. Empty is a pass.
- The daily check then logs in as two users and makes sure each one can see their own paid area.
Prompt to paste
Selects return an empty array even though rows exist. Check RLS policies on this table. auth.uid() must match the column that actually stores the owner. Add a select policy for the authenticated role, and keep anon selects empty unless the row is meant to be public.