# REAL ISSUES – Tables

| ID | Zone | Type | Description | Impact | Suggestion | Patch |
|----|------|------|-------------|--------|------------|-------|
| ISSUE-101 | apps/api/src/modules/analytics/analytics.service.ts | bug-logique | Funnel conversions counted all users per step instead of only those who progressed; dropoffs could go negative and final conversion rate overstated | HIGH | Intersect users with previous step when computing conversions/dropoffs; base conversion rate on retained users | ✅ Updated funnel analysis logic + added targeted test |
| ISSUE-102 | apps/api/src/modules/analytics/__tests__/analytics.service.spec.ts | test-gap | Firestore mock missed select() and "in" operator causing expandSessionWindows to throw and filtering to be wrong | MEDIUM | Mirror Firestore query API in mock (select + in) to keep analytics tests meaningful | ✅ Mock extended with select/in support |
| ISSUE-103 | apps/api/src/server.ts | config | Global rate limit set to 2000/min (too permissive for prod) | MEDIUM | Lower default max, make env-configurable, and exempt health/readiness | ✅ Rate limit now env-configurable (default 300 prod / 1000 dev) with health endpoints allow-listed |
| ISSUE-104 | apps/api/src/server.ts | health | /health returned 200 even when Redis/Firestore were unavailable | HIGH | Centralize dependency probing and return 503 on degraded core services | ✅ Added shared probe util + /health and /api/health now return 503 when degraded |
