Skip to content

fix: allow PUT tenant to clear database_pool_url and database_pool_mode#1069

Open
oniani1 wants to merge 1 commit intosupabase:masterfrom
oniani1:fix/admin-tenant-nullable-pool
Open

fix: allow PUT tenant to clear database_pool_url and database_pool_mode#1069
oniani1 wants to merge 1 commit intosupabase:masterfrom
oniani1:fix/admin-tenant-nullable-pool

Conversation

@oniani1
Copy link
Copy Markdown
Contributor

@oniani1 oniani1 commented Apr 29, 2026

The PUT /tenants/:id handler used truthy guards on databasePoolUrl and databasePoolMode, so a request with null would skip the assignment and the merge upsert left the existing column unchanged. The schema declares both fields nullable: true, and the PATCH handler at lines 396-401 already does the three-way check.

This switches both checks to !== undefined and treats explicit null as a clear, mirroring PATCH. tenantDBInterface was widened to allow string | null on the two columns so the assignment typechecks.

admin-tenants.test.ts adds a case that PUTs a tenant with both pool fields populated, verifies the encrypted/string values land in the DB, then PUTs again with null for both and asserts the columns are now NULL. Verified locally against multitenant_db running in Docker; the case fails on master and passes with the fix.

Closes #1068

@oniani1 oniani1 requested a review from a team as a code owner April 29, 2026 20:24
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25131948326

Coverage increased (+0.3%) to 72.266%

Details

  • Coverage increased (+0.3%) from the base build.
  • Patch coverage: 3 of 3 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 9823
Covered Lines: 7497
Line Coverage: 76.32%
Relevant Branches: 5530
Covered Branches: 3598
Branch Coverage: 65.06%
Branches in Coverage %: Yes
Coverage Strength: 392.99 hits per line

💛 - Coveralls

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.

Admin PUT /tenants/:id can't clear database_pool_url or database_pool_mode

2 participants