v0.0.4 π§Ή Performance, Correctness & Pruning
Important
Network total graph now shows 30 days. The LIMIT was too aggressive β 720 rows at 15-min intervals only covered 7.5 days. Upped to 2880 rows.
π Python Backend
- movers endpoint β Was using a single global timestamp instead of per-country lookups. Fixed with per-country subqueries.
- comparison endpoint β Had no LIMIT, could return 35K+ rows. Now capped at 720.
- query_trends β Parameterized the SQL instead of f-string interpolation.
π¦ Rust Backend
- movers_detailed β ~3000 individual queries per request. Now batches each window into one query.
- at_risk β Same N+1 pattern. Batched into one query.
- country_stats β Was fetching 6 hours of data (24 rows). Now fetches 96 rows for full 24h volatility.
- 24h moving average β Integer division was truncating. Now uses float division with rounding.
β° Pruning
- prune_old_data.py β Referenced in crontab for years but never existed. Created it.
π₯οΈ Frontend
- setInterval leak β Every refresh spawned a new timer. ~288 redundant timers after 24h. Now clears properly.
- Volatility API calls β 100 individual requests per page load. Removed live volatility from mover tables.
- Timezone staleness β Poll freshness compared UTC vs local browser time. Now uses consistent UTC math.
π§ Poller
- JWT error handling β Missing/empty token now logs a clear error instead of failing silently.