Unbounded response: Mobile app freezes on the feed screen on slow networks
Unbounded response debugging lab. The feed API returns 200 but responses are several megabytes. Mobile clients on 3G time out. The web app looks fine.
Practice debugging a unbounded response in a live, broken production system in your browser, with PostgreSQL. Find the root cause in the logs, terminal and code, fix it, and a load test checks that the fix holds under real traffic.
1. The Incident Context
The feed API returns 200 and the web app is fine. Mobile users on 3G report the feed screen hanging, then timing out. The response body is several megabytes.
2. Observed Symptoms & Metrics
- Affected Endpoints / Components:
GET /feed, the posts table.
- Behavior: Every request returns the user's entire post history, newest first. Each post's image is inlined as base64.
- Error Rate: Zero server errors. The problem is payload size: ~4 MB per response, which is fine on office wifi and unusable on a 3G link.
- System Metrics: Database CPU climbs with traffic because every request scans and serializes the whole history.
3. Application Logs
11:20:02 feed service listening on :8080
11:20:15 GET /feed?userId=1 wrote 4,210,000 bytes
11:20:16 GET /feed?userId=1 wrote 4,210,000 bytes
4. Your Objective
Step into the live environment while synthetic traffic is running, diagnose the root cause, and patch the codebase.
To clear this stack, your fix must satisfy these automated verification checks:
- Response size: The first page stays under 100 KB.
- Pagination: A client can page through all 2000 posts with no gaps or duplicates, 20 at a time.
Toolbox: curl -s 'localhost:8080/feed?userId=1' | wc -c, curl -s 'localhost:8080/feed?userId=1&cursor=...', the app logs.
The fix: return a page of 20 with a nextCursor over (created_at, id), and send images as URLs instead of inlining the bytes.
Save a file in the editor to rebuild and restart the app. Click Verify when you think it's fixed.
Your account and data
You can browse stacks without an account. To run labs you sign in with your email or Google account. BustedStack uses your email address to
sign you in, and your name and profile picture to show your account and pre-fill certificates. We never access your Gmail, contacts or Drive,
sell your data or run ad trackers.
Privacy Policy · Terms of Service · Browse stacks ·
hello@bustedstack.com
This site needs JavaScript to run labs.