mike/backend
QA Runner 36cddb2566 fix: batch directory-modal project fetch instead of N+1 getProject burst
Every directory picker (AddDocumentsModal, UseWorkflowModal, the assistant
project selector) loads its "Projects" tab through useDirectoryData, which
fired one GET /projects/:id for EVERY existing project the moment the modal
opened. Each of those requests costs an auth verification against GoTrue
plus ~6 PostgREST queries, so an account with N projects produced an
~8xN-request burst on the Supabase gateway per modal open.

Under that burst the gateway genuinely falls over: measured locally against
the Supabase CLI stack, overlapping modal-open storms drove GoTrue into
Postgres connection exhaustion ("failed to connect ... context deadline
exceeded") and produced 467x 500 + 641x 504 on /auth/v1/user in a single
run — surfacing to users as failed project creates/loads, and to the e2e
suite as the intermittent Kong 502s its specs currently retry around.

Fix: GET /projects now accepts ?include=documents and returns each
project's documents from one batched query (same attach helpers as
GET /projects/:id, run once across all documents), and useDirectoryData
uses it. A modal open is now 1 API request and a fixed number of DB
queries regardless of project count. After the change the same storm
harness produced zero 5xx and zero auth failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 22:05:48 -07:00
..
migrations Merge pull request #212 from jmooves/upstream-pr/chat-messages-workflow-column 2026-07-21 12:49:06 +08:00
src fix: batch directory-modal project fetch instead of N+1 getProject burst 2026-07-20 22:05:48 -07:00
.env.example Add courtlistener intergration, liquid glass redesign, UI improvements, version control, various fixes 2026-06-06 15:48:47 +08:00
.gitignore Refactor ProjectPageParts and ProjectPageHeader components for improved loading states and skeleton UI. Update Modal and PageHeader components to support loading states. Enhance RenameableTitle for better caret positioning. Adjust DisplayWorkflowModal to utilize the new Modal component structure. Update WorkflowList to include loading indicators and improve sticky header behavior. 2026-06-11 21:50:58 +08:00
bun.lock feat: workflow, UI and document support updates 2026-07-08 18:27:28 +08:00
nixpacks.toml Sync deployment and project page fixes 2026-05-13 02:32:26 +08:00
package-lock.json Sync workflow, asst extra input, excel + ppt support and modal updates 2026-07-04 23:24:31 +08:00
package.json feat: workflow, UI and document support updates 2026-07-08 18:27:28 +08:00
schema.sql Merge pull request #212 from jmooves/upstream-pr/chat-messages-workflow-column 2026-07-21 12:49:06 +08:00
tsconfig.json Sync security and backend profile updates 2026-05-08 20:45:16 +08:00