Skip to content

fix: null body crash, null config guard, and roles querystring schema mismatch#1091

Open
PedroHenrique0713 wants to merge 1 commit into
supabase:masterfrom
PedroHenrique0713:fix/null-guards-and-schema-mismatch
Open

fix: null body crash, null config guard, and roles querystring schema mismatch#1091
PedroHenrique0713 wants to merge 1 commit into
supabase:masterfrom
PedroHenrique0713:fix/null-guards-and-schema-mismatch

Conversation

@PedroHenrique0713

Copy link
Copy Markdown

Summary

Four fixes in postgres-meta.

# File Bug
1 routes/query.ts errorOnEmptyQuery crashed on null body — null.query TypeError instead of intended error message
2 routes/query.ts /deparse route had no null guard on request.body.ast
3 PostgresMetaRoles.ts config !== undefined allowed null through → null.map() TypeError
4 routes/roles.ts Querystring schema declared include_system_schemas but handler read include_default_roles — validated field never used

… mismatch

fix(query): guard against null request body in errorOnEmptyQuery.
  request.body.query on null body caused TypeError instead of the
  intended 'query not found' error.

fix(query): guard request.body.ast with optional chaining in /deparse.
  No validation or guard before accessing request.body.ast.

fix(PostgresMetaRoles): guard config against null (not just undefined).
  config !== undefined allowed null through, causing config.map() TypeError.

fix(roles): align querystring schema field name with handler.
  Schema declared include_system_schemas but handler read include_default_roles.
@PedroHenrique0713
PedroHenrique0713 requested review from a team, avallete and soedirgo as code owners July 23, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant