Repository navigation
3.0.16 (2026-10-15)
Bug Fixes
Behaviour change: one request in flight per client
Each Analytics client now sends one batch request at a time, in queue order. Previously a burst of events could open hundreds of parallel requests, which triggered rate limiting (HTTP 429) and dropped events. Batches now also arrive in order, and persistence mode pushes to Redis one batch at a time.
flush() no longer rejects. A failed batch no longer stops the flush: its error goes to that batch's event callbacks and errorHandler, the rest of the queue is still sent, and flush() resolves, with no error passed to its callback. If you detect failures with try { await client.flush() } catch, use per-event callbacks or errorHandler instead.
What to check after upgrading:
- Throughput depends on batch size and latency. A client delivers about
events per batch ÷ request latency. With the default 450 KBmaxQueueSize(about 900 events of ~500 bytes), that is ~18k events/s at 50 ms per request. For higher volume, raisemaxQueueSize(the data plane accepts up to 4 MB per request) and setflushAtabove the number of events that fit in a batch. - The in-memory queue can fill faster. While a request is in flight, new events wait in memory. Events beyond
maxInternalQueueSize(default 20,000) are dropped without a callback. If you send in bursts, raisemaxInternalQueueSize, enlarge batches, or pause sending while many callbacks are pending. flush()can take longer. It resolves once every event queued at the call is sent, one request after another. If you flush before shutdown, allow time for the remaining batches, or use larger batches.
If you need more throughput than larger batches give, use several clients, for example routing by a hash of the user ID so each user's events stay in order.
Miscellaneous
- deps-dev: bump fast-uri from 3.1.6 to 3.1.8 (#486) (3eb0006)
- deps-dev: bump ip-address from 10.7.0 to 10.7.4 (#489) (fcd6450)
- deps-dev: bump js-yaml from 3.14.2 to 3.15.2 in the npm-security-major group (#470) (45b8c40)
- deps-dev: bump proxy-addr from 2.0.7 to 2.0.8 (#490) (5476f0c)
- deps-dev: bump source-map-js from 1.2.1 to 1.2.2 (#488) (8388f63)
- deps-dev: bump the npm-development-non-major group across 1 directory with 10 updates (#477) (55a5ebd)
- deps: bump actions/stale from 10.4.0 to 11.0.0 (#476) (469caf3)
- deps: bump brace-expansion (#487) (9b7effe)
- deps: bump qs from 6.15.3 to 6.16.1 (#493) (4ac6e26)
- deps: bump the github-actions-version-non-major group across 1 directory with 6 updates (#494) (d4cbac1)