Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable batching multiple events into a single POST request over buffer size if maxPostBytes setting is followed #1356

Open
wants to merge 2 commits into
base: release/4.0.0
Choose a base branch
from

Conversation

matus-tomlein
Copy link
Contributor

@matus-tomlein matus-tomlein commented Oct 17, 2024

This PR enables POST requests to contain more events than configured through bufferSize as long as they don't surpass the maxPostBytes.

The reason for this is to send events queued up in the event store in a single POST request rather than individually. This may happen for instance if some events didn't manage to be saved on the previous page visit (or the collector was not reachable). With this feature, they should be sent in one batch request on the next visit.

It may also happen in events are tracked right after each other – if they manage to be saved to the event store before the flush function is called, they will be batched together.

The change might be useful also with issue #1355 where part of the problem could be too many requests done shortly after each other.

Copy link

bundlemon bot commented Oct 17, 2024

BundleMon

Files added (6)
Status Path Size Limits
trackers/javascript-tracker/dist/sp.js
+24.32KB 30KB / +10%
libraries/browser-tracker-core/dist/index.mod
ule.js
+23.45KB 25KB / +10%
libraries/tracker-core/dist/index.module.js
+19.07KB 20KB / +10%
trackers/browser-tracker/dist/index.umd.min.j
s
+17.23KB 20KB / +10%
trackers/javascript-tracker/dist/sp.lite.js
+17.18KB 20KB / +10%
trackers/browser-tracker/dist/index.module.js
+3.49KB 5KB / +10%

Total files change +104.73KB 0%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant