fix(postgrest): use POST fallback for rpc get:true with object args - #2502
Open
AndroidPoet wants to merge 1 commit into
Open
fix(postgrest): use POST fallback for rpc get:true with object args#2502AndroidPoet wants to merge 1 commit into
AndroidPoet wants to merge 1 commit into
Conversation
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
This was referenced Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
rpc(fn, args, { get: true })silently corrupts the request when any argument is an object (or an array containing objects): the object is stringified into the query string as the literal[object Object].The
rpcmethod already has a fallback that routes object-valued args toPOST(objects can't be serialized into URL params), but the guard only checkedhead:Since
headandgetshare the same URL-serialization branch (else if (head || get)), aget: truecall with an object arg skipped the fallback and hit`${value}`→"[object Object]". The siblinghead: truepath handled it correctly.Reproduction
Fix
Extend the POST fallback to
getas well, and keepreturn=minimalhead-only so agetcaller still receives the function result:head && _hasObjectArgis equivalent to the original head-only condition, so the existingheadbehavior is unchanged.get: truewith an object arg now sendsPOSTwith the args as the body and returns the function result.Type of Change
Testing
test/fetch-errors.test.ts) assertingget: true+ object args producesPOST, the body carries the args, the URL contains no[object Object], andreturn=minimalis not set (so the body is returned).Received: "GET") and passes after the fix.get: truetests (scalar / array / empty args) are unaffected — no test relied on the old behavior.Checklist
nx format:checkpasses)nx affected --target=build)nx test:types postgrest-js)codegen:check)