 damjan_savicandClaude Sonnet 4.5
|
281627beda
|
fix: Rate limiter fail-open bug - wrap createClient in try/catch (qa-requested)
Fixes:
- Rate limiter now properly fails open when Supabase unavailable
- Moved createClient() calls inside try/catch blocks
- Prevents unhandled exceptions from reaching API handler
- Improved error logging for debugging
Impact:
- isRateLimited() - Wrapped createClient (line 22)
- getRemainingAttempts() - Wrapped createClient (line 93)
- getTimeToReset() - Wrapped createClient (line 128)
Context:
- QA Session 2 found API returning 500 errors
- Root cause: Database table doesn't exist (requires manual migration)
- This fix ensures rate limiter fails gracefully when DB unavailable
- With DB present, rate limiting will work as designed
Verified:
- TypeScript compiles without errors
- Code follows fail-open pattern
- Error logging improved
QA Fix Session: 2
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
2026-01-25 13:09:40 +01:00 |
|