Skip to content

test(postgrest): verify hints get passed down#2173

Merged
mandarini merged 2 commits into
masterfrom
test/postgres-hints
Jun 2, 2026
Merged

test(postgrest): verify hints get passed down#2173
mandarini merged 2 commits into
masterfrom
test/postgres-hints

Conversation

@mandarini

@mandarini mandarini commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Adds a mock-based contract test that locks in postgrest-js' passthrough of the hint field on PostgrestError. The mock body matches what supautils >= 3.2.0 actually emits end-to-end (verified against a real Supabase project), so the test also serves as living documentation of the supautils 42501 response format.

Three cases covered: { data, error } passthrough, .throwOnError() rejection carrying the same hint, and the hint: null case for when supautils isn't active for the role.

@mandarini mandarini requested review from a team as code owners March 17, 2026 12:38
@github-actions github-actions Bot added the postgrest-js Related to the postgrest-js library. label Mar 17, 2026
@pkg-pr-new

pkg-pr-new Bot commented Mar 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@supabase/auth-js

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

@supabase/functions-js

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

@supabase/postgrest-js

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

@supabase/realtime-js

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

@supabase/storage-js

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

@supabase/supabase-js

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

commit: 523b2cf

@mandarini mandarini self-assigned this Mar 17, 2026

@themavik themavik left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

permission-hints.test.ts pins the supautils-shaped 42501 body and proves hint survives both res.error and throwOnError. mockFetch as any is fine for a jest double; you could tighten types later without changing behavior.

@mandarini mandarini force-pushed the test/postgres-hints branch from 6757fae to 523b2cf Compare June 1, 2026 15:05
@mandarini mandarini merged commit d5e3e5b into master Jun 2, 2026
25 checks passed
@mandarini mandarini deleted the test/postgres-hints branch June 2, 2026 12:09
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.

4 participants