Bulk tenant health rejects exactly 500 refs, the documented maximum

Open
#2,469 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@hsusul is already working on this.

Since Oct 30, 2026.

  • #2470 by @hsusul — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
elixir
Domain
api

Research direction

Read lib/realtime_web/controllers/tenant_controller.ex, focusing on within_ref_limit?/1 and the @max_refs value. Check the existing tests for POST /api/tenants/health; done means exactly 500 refs are accepted while 501 are rejected. A linked pull request is already open.

Written by the indexing model from the issue text.

Description

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I searched issues and PRs for this behavior.

Describe the bug

POST /api/tenants/health rejects a request with exactly 500 refs. It answers 422 with refs exceeds the maximum of 500. The request schema TenantBulkHealthParams sets maxItems: 500, and the error message also names 500 as the maximum. So 500 refs should be accepted, and only 501 or more rejected.

To reproduce

Send POST /api/tenants/health with a valid API JWT and a body of exactly 500 string refs:

{"refs": ["ref-1", "ref-2", "...", "ref-500"]}

Expected behavior

200 with present and missing, the same as for 499 refs.

Actual behavior

422 with {"message": "refs exceeds the maximum of 500"}.

Cause

within_ref_limit?/1 in lib/realtime_web/controllers/tenant_controller.ex checks length(refs) < @max_refs, and @max_refs is 500. Nothing validates the OpenAPI schema at runtime, so this check is the only limit.

System information

main at cea1926d (2.150.2).

Dominant language
Elixir
Stars
7.7k
Forks
479
Avg merge
2d 13h
Merged PRs (30d)
74

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/realtime

All issues in supabase/realtime

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.