todos-contra-el-fuego-web/private/workers
vjrj 110ad66e86
All checks were successful
build-image / build (push) Successful in 13m24s
feat(subsUnion): incremental union merge for new subscriptions
A full recreate() over 7k+ subscriptions takes ~20 minutes even in a
worker thread — fine for not blocking the site, but means a new zone
takes ages to show up on the map. Since union only grows when adding a
circle, a new subscription can just be merged into the union already
stored (one turf.union call) instead of rebuilding the whole chain.

changed/removed still trigger a full recreate() (union can't be
"subtracted" from safely), and incrementalAdd falls back to a full
recreate whenever the stored count isn't exactly one behind what's
expected, rather than risk merging into stale state. Both paths now
share one serialized queue (FIFO for adds, coalesced for recomputes)
so they never race on the same stored union.
2026-07-30 08:07:00 +02:00
..
unionWorker.js feat(subsUnion): incremental union merge for new subscriptions 2026-07-30 08:07:00 +02:00