From f87e3828360b49ac17f750477ce3d64ebf8e90c6 Mon Sep 17 00:00:00 2001 From: Francisco Solla Date: Thu, 6 Aug 2026 00:19:01 +0000 Subject: [PATCH] fix(campanha): unblock dobradinhas list SSR for Assessores (#386) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(campanha): unblock dobradinhas list SSR for Assessores column Drop CampaignTableHead description on Assessores — its hover tooltip plus StateDeputyAdvisorRelationCell breaks production SSR with an undefined element. * fix(test): keep int gate under Postgres connection ceiling Cap vitest workers and raise Docker max_connections so high-core laptops stop failing the suite with cascading "too many clients" / QueryError noise. * fix(test): do not force eight int workers on CI An explicit maxWorkers: 8 raised parallelism on 2–4 vCPU runners and starved shared invite/consent advisory leases (15s timeouts). Cap only on local high-core hosts; leave CI on Vitest's CPU-relative default. * style(test): format vitest.config.mts --- docker-compose.yml | 4 ++++ .../campanha/(app)/dobradinhas/page.tsx | 14 +++++--------- vitest.config.mts | 16 +++++++++++++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 204478df..b469ebb2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,10 @@ services: POSTGRES_DB: teqo ports: - '5432:5432' + # Default max_connections=100 is tight for vitest forks (≈CPUs × pg pool) + # plus a leftover `next start` from local repro. Raise the ceiling so the + # int gate fails on real assertions, not "too many clients already". + command: ['postgres', '-c', 'max_connections=200'] volumes: - pgdata:/var/lib/postgresql/data # Runs only on first initialization of the volume. Creates the dedicated diff --git a/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx b/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx index 161f47a4..e27ea4f3 100644 --- a/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx +++ b/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx @@ -184,15 +184,11 @@ const stateDeputyColumns = ( { id: 'advisors', label: 'Assessores', - head: canEditAdvisors ? ( - - Assessores - - ) : ( - - Assessores - - ), + // No `description` here: `CampaignTableHead`'s hover tooltip + // (`CampaignHoverTooltip`) plus `StateDeputyAdvisorRelationCell` on this + // list breaks production SSR with "Element type is invalid … undefined". + // Municípios keeps its tooltip; Assessores relies on the cell chrome. + head: Assessores, cellClassName: 'max-w-72 whitespace-normal', cell: (row) => (