API Performance Boost ยท Faster Sessions, No More Timeout Errors
API Performance Boost ยท Faster Sessions, No More Timeouts
We identified and fixed the root cause of "NetworkError when attempting to fetch resource" errors that some users experienced after completing practice sessions.
The Problem
The analysis API route was performing too many sequential operations ยท authentication, audio transcription, AI analysis, database saves, streak updates, achievement checks, and XP awards ยท all one after another. On Vercel's serverless platform, this frequently exceeded the default 10-second timeout.
The Fix
โฑ๏ธ Extended Timeouts
All AI routes now have explicit timeout configurations:
- Practice analysis: 60 seconds
- AI Voice Coach: 30 seconds
- Interview reports: 60 seconds
- IELTS/TOEFL: 60 seconds
โก Parallel Database Operations
Session saves, streak updates, and achievement checks now run in parallel instead of sequentially ยท cutting 2-3 seconds from every request.
๐ก๏ธ Graceful Fallbacks
If the AI analysis times out, you now get a basic score with helpful feedback instead of an error screen. No more lost sessions.
๐ Request Timeouts
Individual API calls to Groq (transcription and analysis) now have their own timeout limits, preventing any single call from hanging the entire request.
Result
Session analysis is now faster and more reliable. The "NetworkError" issue is resolved across all session types.