Skip to content

fix(postgrest): fix maybeSingle for all request methods by removing Accept header override#2182

Open
mandarini wants to merge 1 commit intomasterfrom
fix/postgrest-maybesinlge
Open

fix(postgrest): fix maybeSingle for all request methods by removing Accept header override#2182
mandarini wants to merge 1 commit intomasterfrom
fix/postgrest-maybesinlge

Conversation

@mandarini
Copy link
Contributor

@mandarini mandarini commented Mar 20, 2026

Summary

  • Removes the Accept: application/vnd.pgrst.object+json header override from maybeSingle() so PostgREST never sends a 406 for 0-row results
  • Drops the method === 'GET' guard so client-side array cardinality enforcement applies to all methods (including .insert().select().maybeSingle())
  • Removes the "0 rows" string-matching fallback, which is no longer needed

Related supabase/postgrest-js#361

And thanks to supabase/supabase-py#1424

@mandarini mandarini requested review from a team as code owners March 20, 2026 14:53
@github-actions github-actions bot added the postgrest-js Related to the postgrest-js library. label Mar 20, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 20, 2026

Open in StackBlitz

@supabase/auth-js

npm i https://pkg.pr.new/@supabase/auth-js@2182

@supabase/functions-js

npm i https://pkg.pr.new/@supabase/functions-js@2182

@supabase/postgrest-js

npm i https://pkg.pr.new/@supabase/postgrest-js@2182

@supabase/realtime-js

npm i https://pkg.pr.new/@supabase/realtime-js@2182

@supabase/storage-js

npm i https://pkg.pr.new/@supabase/storage-js@2182

@supabase/supabase-js

npm i https://pkg.pr.new/@supabase/supabase-js@2182

commit: 5358c72

@mandarini mandarini self-assigned this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

postgrest-js Related to the postgrest-js library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant