Fix/rpc no params react native#2017
Conversation
…ON body Refactors PostgrestBuilder to serialize headers as a plain object instead of a Headers instance, ensuring compatibility with environments expecting plain objects. Also ensures that requests without a body send an empty JSON object for non-GET/HEAD methods. Adds tests to verify header serialization and correct body handling.
|
@mandarini @avallete Pls check |
Co-authored-by: supabase-releaser[bot] <supabase-releaser[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
…2041) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…ime detection (supabase#2046) Co-authored-by: Guilherme Souza <guilherme@supabase.io>
Co-authored-by: supabase-releaser[bot] <supabase-releaser[bot]@users.noreply.github.com>
Co-authored-by: supabase-releaser[bot] <supabase-releaser[bot]@users.noreply.github.com>
…across 1 directory (supabase#2401) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…minor-and-patch group (supabase#2403) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…sful responses (supabase#2398) Co-authored-by: youcefzemmar <dzbuildoff@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hey @mandarini, so sorry this almost slipped my mind, I was on a break. I'll look into this immediately now that I'm free and do the needful. |
…ON body Refactors PostgrestBuilder to serialize headers as a plain object instead of a Headers instance, ensuring compatibility with environments expecting plain objects. Also ensures that requests without a body send an empty JSON object for non-GET/HEAD methods. Adds tests to verify header serialization and correct body handling.
|
Changes are made. Husky is cleaned, and I have rebased the branch with master. Let me know if any action is needed from my end. CC: @mandarini |
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
|
Hi @dev-hari-prasad ! Thank you for this contribution. The PR as it is, it's unmergeable, something went wrong during your rebase. In any case, I am putting in a new PR to fix the issue you were trying to solve. I will mention you in the PR description. Thank you for this PR, it highlighted a bug that needed to be addressed. Looking forward to your next contribution! |
|
Thanks! Totally works. Tag me in the new PR if my inputs are required. |
🔍 Description
This PR improves request handling in the PostgREST client to make it more compatible with custom
fetchimplementations and fixes Husky hooks to avoid reliance on globally installed binaries.What changed?
PostgREST client improvements
PostgrestBuilder.tsto serialize request headers as a plain object instead of aHeadersinstance. This avoids compatibility issues with non-standard or customfetchimplementations.{}) instead ofundefined. This fixes edge cases like RPC calls without parameters.headers_serialization.test.tsto verify:{}as the request body.Husky hook updates
.husky/commit-msgand.husky/pre-pushto use local binaries (./node_modules/.bin/...) instead ofnpx.Why was this change needed?
fetchsetups) do not fully support theHeadersAPI, causing requests to fail unexpectedly.npxinside Husky hooks can break in CI or restricted environments where global binaries are unavailable.Closes #1562 (if applicable)
📸 Screenshots / Examples
N/A – changes are covered by tests.
🔄 Breaking changes
📋 Checklist
<type>(<scope>): <description>npx nx formatto ensure consistent code formattingThis PR fixes #1562