Open
Description
Bug report
When I tried to delete a row from a table where I forgot to set up a permissive DELETE policy, the client kept returning a successful response code, even though the row wasn't deleted.
To Reproduce
- Set up a Supabase table with RLS enabled but without any DELETE policies
- Populate it with some rows
- Try deleting a row
try
{
await supaBaseClient.From<Item>()
.Where(i => i.Id == item.Id)
.Delete();
}
catch (Exception ex)
{
// log
throw;
}
Expected behavior
- The operation fails
- In the provided application code, an exception is logged and re-thrown
- In the client's
MakeRequest
method inHelper.cs
,response.IsSuccessStatusCode
isfalse
in the following code block, and the method proceeds to create and throw aPostgrestException
var response = await Client.SendAsync(requestMessage, cancellationToken);
var content = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
return new BaseResponse(clientOptions, response, content);
System information
- OS: Windows 11
- Version of postgrest-csharp: 3.5.1
- Version of supabase-csharp: 0.16.1