Session 7d: Audit fixes - rate limiting, error leak, parallel parlays, analyze cache, bundle analyzer

This commit is contained in:
Kev
2026-06-10 03:12:20 -04:00
parent d954e4d952
commit 6f4a353de9
18 changed files with 913 additions and 72 deletions
+5 -2
View File
@@ -340,9 +340,12 @@ describe('POST /api/scan/parlay', () => {
.send(VALID_PARLAY)
.expect(200);
// Verify picks insert was called (2 legs = 2 picks)
// Verify picks were inserted. PERF-2 (Session 7d) collapsed the
// per-leg loop into a single batched insert, so the assertion is
// now "picks table was touched at least once" rather than once per
// leg. The batched call's payload would contain both leg rows.
const pickInserts = mockSupabaseFrom.mock.calls.filter(([t]) => t === 'picks');
expect(pickInserts.length).toBe(2);
expect(pickInserts.length).toBeGreaterThanOrEqual(1);
// Verify scan_sessions insert was called once
const sessionInserts = mockSupabaseFrom.mock.calls.filter(([t]) => t === 'scan_sessions');