Behavior
Every event is written to the on-device SQLite store at logEvent time, so a process death before delivery loses nothing. Delivery goes out in batches of batchSize, one request per flush attempt, cascading while the queue still holds a full batch.
Flushes are triggered by: batch size reached, a periodic interval, app foreground/background transitions, network reconnect, and an explicit flush(). A failed periodic flush stretches the next tick to flushIntervalSeconds × 2^(n-1) (capped at 5 minutes) until one succeeds; the other triggers ignore the backoff. A batch rejected with a 4xx is dropped permanently (poison-pill protection); transient failures keep their events stored.