snowplow / snowplow-javascript-tracker

Snowplow event tracker for client-side and server-side JavaScript. Add analytics to your websites, web apps and servers.
http://snowplowanalytics.com
BSD 3-Clause "New" or "Revised" License
555 stars 222 forks source link

Read the request response to avoid overlapping requests to collector #1358

Closed matus-tomlein closed 1 month ago

matus-tomlein commented 1 month ago

Aims to address issue #1355.

This PR adds an await for the response body to be read before continuing with the emitter loop. Previously it was possible that requests overlapped since the emitter could start a new request (for follow up events) before the previous response was fully received. This could have caused problems with the fetch keepalive limitations.

bundlemon[bot] commented 1 month ago

BundleMon

Files added (6) Status | Path | Size | Limits :------------: | ------------ | :------------: | :------------: :white_check_mark: | trackers/javascript-tracker/dist/sp.js
| +24.28KB | 30KB / +10% :white_check_mark: | libraries/browser-tracker-core/dist/index.mod
ule.js
| +23.45KB | 25KB / +10% :white_check_mark: | libraries/tracker-core/dist/index.module.js
| +19.21KB | 20KB / +10% :white_check_mark: | trackers/browser-tracker/dist/index.umd.min.j
s
| +17.22KB | 20KB / +10% :white_check_mark: | trackers/javascript-tracker/dist/sp.lite.js
| +17.15KB | 20KB / +10% :white_check_mark: | trackers/browser-tracker/dist/index.module.js
| +3.49KB | 5KB / +10%

Total files change +104.79KB 0%

Final result: :white_check_mark:

View report in BundleMon website ➡️


Current branch size history