Fixing the 1,000-Row Analytics Cap and Other Lessons from Production Hardening
Production applications don't fail in the demo; they fail in the quiet corners where you assumed defaults would hold.
This week, our work on Themselves of Us forced a reckoning with three invisible limits: a silent 1,000-row cap on analytics, the terrifying ease of a double-clicked newsletter send, and path-climbing vulnerabilities in our attachment handling.
Here is how we tackled them, what broke along the way, and what we learned about building resilient software for real-world conditions.
The 1,000-Row Analytics Blindspot
Dashboards are seductive. They show you charts, graphs, and nice green up-arrows. But when our reaction counts and marketing snapshots were compiled, they were quietly truncating at 1,000 rows.
To fix this, migrations 036 through 039 restructured our analytics rollups. We moved away from naive queries and implemented explicit pagination boundaries and aggregations that look at the entire dataset.
Along the way, we also had to resolve a missing peer dependency (react-is required by recharts) that broke our Cloudflare deployment pipeline during the build.
Stopping the Double-Send
When a user hits 'Send' on a newsletter or a scheduled letter, mobile latency can trick them into thinking nothing happened. They tap again. If your backend doesn't protect against retries, your subscribers get two copies of the same email.
We built a dedicated double-send guard into our delivery pipeline. Combined with exact story view counters and a strict invariant, exactly one approval email per reflection, the system now gracefully handles network hiccups without duplicating human communication.
Editor Hardening and Path Traversal
Rich-text editors are notorious state machines. We discovered our editor was registering the Link extension twice, leading to duplicate node parsing.
We fixed that alongside a security hardening sweep that rejects path-climbing attachment paths outright, protecting the server filesystem from malicious traversal.
On the UX side, we added a pre-publish checklist, word counts, and find-and-replace tools, ensuring the writing experience matches the robustness of the backend.
Hardening is never finished, but every migration brings the system closer to absolute reliability.
Drop a comment and tell me: what's the most surprising default limit you've had to override in your database lately?
Comments
No comments yet. Start the discussion.