The autonomous improvement cycle has been running daily since we shipped it, but we discovered a problem: it was creating duplicate FAQs. The same slugs were being inserted 3x each because the cron had no deduplication checks before inserting new records.
The Dedup Fix
We added three guards to the auto-improve cron:
- FAQ dedup: Before inserting a new FAQ, check if the slug already exists. If it does, update the existing record in place instead of creating a duplicate.
- Player description guard: Skip updating a player's description if it's already over 100 characters. This prevents the cron from overwriting substantive descriptions with new ones each cycle.
- Comparison dedup: Check if a comparison slug already exists before inserting.
After deploying the guards, we cleaned 8 duplicate rows from the database manually.
Dashboard Resurrection
The /dashboard page had been broken for weeks — it was timing out because the Google Search Console URL Inspection API was being called sequentially for 15 URLs, taking 90+ seconds. The fix was two-fold:
- Parallelized the 15 URL Inspection calls using
Promise.allSettled() - Added a 25-second overall timeout wrapper around both GSC and GA4 data fetching, running them in parallel instead of sequentially
The dashboard now loads in under 10 seconds with both Google Search Console and GA4 data displayed.