fix(subsUnion): stop blocking DDP on subscription union recompute

Every subscription add/change/remove recomputed the full geo union
over all 7k+ subscriptions with a synchronous turf.union chain,
freezing the single Node event loop (and thus DDP/HTTP) for minutes.
The same recompute also runs at startup ("Subs union outdated"),
so every restart froze the site too.

calcUnionAsync yields to the event loop periodically during the
union chain, and subsUnion.js now fires recomputes without blocking
Meteor.startup or the observer callbacks, serializing overlapping
triggers instead of stacking them.
This commit is contained in:
vjrj 2026-07-30 06:36:37 +02:00
parent 23e5f26239
commit b4e5511cd0
4 changed files with 102 additions and 14 deletions

View file

@ -12,6 +12,9 @@
"@sentry/browser": "^8.55.2",
"@sentry/node": "^8.55.2",
"@turf/buffer": "^5.1.5",
"@turf/circle": "^6.0.1",
"@turf/truncate": "^6.0.1",
"@turf/union": "^6.0.3",
"babel-runtime": "^6.26.0",
"bcrypt": "^5.1.1",
"bootstrap": "^5.3.8",