Skip to content

Delete does not throw an error when RLS is enabled and there is no delete policy #30190

@sarthakgupta072

Description

@sarthakgupta072

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I enabled RLS for one of my tables say "profiles".

When I execute this code

const { error: deleteError, data } = await supabase
      .from("profiles")
      .delete()
      .eq("user_id", userId)

As expected, nothing gets deleted from my DB due to RLS enabled and no policy for delete. But, I also don't see any error in deleteError variable. I was expecting it to throw error something like "Error in deleting items due to RLS"

Is this expected?

To Reproduce

Mentioned above

Expected behavior

I was expecting it to throw error something like "Error in deleting items due to RLS".

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: MacOS
  • Browser: Brave
  • Version of supabase-js: 2.45.3
  • Version of Node.js: 18.20.4

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions