mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
Keepalive flushes (pagehide/visibilitychange/stop) skip async gzip to dispatch before page tear-down, so they're bound by the server's ~1MB raw body limit. Allowing 8MB single events there made the first oversized batch 413 and drop the buffered events behind it; gate the single-event drop threshold on keepalive so those events are dropped cleanly instead. Also align MAX_SINGLE_EVENT_BYTES to the server's binary-mebibyte MAX_DECOMPRESSED_BYTES, and hoist the duplicated getRequestInit/gunzipToText test helpers into shared scope.