mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-08-01 08:19:30 +00:00
Three independent wins, measured against a 1.4 GB production database (714k observed_paths, 38.7k mesh_connections): - Migration 0014: partial covering index on observed_paths for bytes_per_hop >= 2. The multibyte evidence query was a full table scan (2.2 s); with the index it reads only the index (77 ms). The optional days filter is covered too via last_seen in slot 2. - Compress responses with flask-compress when the client supports it. /api/mesh/edges alone is 16.3 MB of JSON uncompressed, 3.9 MB gzipped. Falls back gracefully (with a warning) if the package is not installed. - Fetch stats, edges, and nodes concurrently on the mesh page instead of three serialized awaits. Node prefixes are now computed client-side from public_key at the edge prefix length, which removes the edges-before-nodes ordering dependency. Rendering still waits for stats so initial framing can use the bot location. Also call map.invalidateSize() before the initial fitBounds: if the map was created while its container had no layout (e.g. a background tab), Leaflet's cached zero width made fitBounds zoom to max.