From 240061f67391b5ec9cefa9ea4bcbda816737c198 Mon Sep 17 00:00:00 2001 From: Musa Kaleem <131704022+Musa-Kal@users.noreply.github.com> Date: Fri, 13 Nov 2026 22:54:15 -0500 Subject: [PATCH] ci: raise the realtime limits after the restart Realtime reseeds its tenant with the default limits when it starts (SEED_SELF_HOST), so updating the tenant and then restarting put the 100 a second limit straight back. Co-authored-by: Ferrin <177692050+Ferrin-Y@users.noreply.github.com> Co-authored-by: noorelmosrati <182049385+noorelmosrati@users.noreply.github.com> --- .github/workflows/ci.yml | 8 ++++---- docs/testing.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cf6048..a8c56cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,17 +89,17 @@ jobs: . /tmp/sb.env printf 'VITE_SUPABASE_URL=%s\nVITE_SUPABASE_PUBLISHABLE_KEY=%s\nVITE_APP_URL=http://localhost:4173\n' "$API_URL" "$PUBLISHABLE_KEY" > .env.local # The local Realtime tenant allows 100 Postgres change messages a second and drops the rest - # (MessagePerSecondRateLimitReached), which parallel journeys pass. Raise it, then restart - # Realtime so it rereads the tenant. + # (MessagePerSecondRateLimitReached), which parallel journeys pass. Realtime reseeds its + # tenant with those defaults when it starts (SEED_SELF_HOST), so restart it first and raise + # the limits after, before any client connects and caches the tenant. - name: Raise Realtime limits run: | - docker exec supabase_db_potluck psql -U supabase_admin -d postgres -v ON_ERROR_STOP=1 -c "update _realtime.tenants set max_events_per_second = 1000, max_joins_per_second = 500 where external_id = 'realtime-dev'" docker restart supabase_realtime_potluck for i in $(seq 1 30); do [ "$(docker inspect -f '{{.State.Health.Status}}' supabase_realtime_potluck)" = healthy ] && break sleep 2 done - docker inspect -f '{{.State.Health.Status}}' supabase_realtime_potluck + docker exec supabase_db_potluck psql -U supabase_admin -d postgres -v ON_ERROR_STOP=1 -At -c "update _realtime.tenants set max_events_per_second = 1000, max_joins_per_second = 500 where external_id = 'realtime-dev' returning max_events_per_second" - run: pnpm --filter @potluck/web exec playwright install --with-deps chromium webkit - run: pnpm e2e # Live updates are silent when Realtime drops a change (a rate limit, or a policy that errors diff --git a/docs/testing.md b/docs/testing.md index 2a93b13..187b499 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -130,7 +130,7 @@ pnpm --filter @potluck/web exec playwright test e2e/expenses.spec.ts --project=d pnpm --filter @potluck/web exec playwright show-report # after a failure ``` -Locally, a server already listening on :4173 is reused, even if another checkout or worktree started it, so the tests may run another branch's build. If you change app code while one is running, rebuild with `VITE_APP_URL=http://localhost:4173 pnpm --filter @potluck/web build` or stop it first. `E2E_PORT=4174` runs on another port beside it. `E2E_WORKERS` sets the local worker count (default 2). The local Realtime tenant drops Postgres changes past 100 a second (`MessagePerSecondRateLimitReached` in `docker logs supabase_realtime_potluck`), which looks like a live update that never arrives. CI raises it in the e2e job; locally, run the same `update _realtime.tenants` from `ci.yml` (as `supabase_admin`; `postgres` may not write it) and restart the Realtime container if live journeys fail only under load. +Locally, a server already listening on :4173 is reused, even if another checkout or worktree started it, so the tests may run another branch's build. If you change app code while one is running, rebuild with `VITE_APP_URL=http://localhost:4173 pnpm --filter @potluck/web build` or stop it first. `E2E_PORT=4174` runs on another port beside it. `E2E_WORKERS` sets the local worker count (default 2). The local Realtime tenant drops Postgres changes past 100 a second (`MessagePerSecondRateLimitReached` in `docker logs supabase_realtime_potluck`), which looks like a live update that never arrives. CI raises it in the e2e job; locally, restart the Realtime container (it reseeds the defaults when it starts) and then run the same `update _realtime.tenants` from `ci.yml` as `supabase_admin` (`postgres` may not write it), before opening the app. Projects (`apps/web/playwright.config.ts`):