fix: Limit queued events in Local storage
This MR limits number of events events queued up in local storage.
the snowplow option docs
Steps to verify:
Prerequisite: Install an ad blocker in your browser (I've tried it with uBlock).
Before changes from this MR :
-
Run
yarn examples:serve
in Browser SDK. It should open test app inlocalhost:8080
-
Accept cookie banner and click on
Track Event
andTrack Error
button multiple times. -
If adblocker is installed correctly, all the events API calls should be failing.
-
Go to
Applications
Tab and Check in thelocalStorage
, For keysnowplowOutQueue_gitlab_post2
verify that events are being queued. As per snowplow maximum limit of such queue is 1000 -
This raises an issue because currently in
.com
we have two versions of snowplow running and it can exhaust localStorage's maximum limit ~5MB very quickly. -
As a workaround, I have changed limit to
100
which should provide enough space for other data.
After This MR's Change: