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

Allow 0x0 viewport in browser context to avoid schema validation errors #1365

Closed matus-tomlein closed 1 month ago

matus-tomlein commented 1 month ago

This PR allows the viewport property in the browser_context schema to be 0x0 instead of making it null. The property is required in the schema, so null caused validation errors.

I think it's sensible to allow the 0x0 values since we do the same for documentSize and resolution properties in the same context entity. I don't see why we should make it null in that case especially since it's causing failed events.

bundlemon[bot] commented 1 month ago

BundleMon

Files added (6) Status | Path | Size | Limits :------------: | ------------ | :------------: | :------------: :white_check_mark: | libraries/browser-tracker-core/dist/index.mod
ule.js
| +27.5KB | 28KB / +10% :white_check_mark: | trackers/javascript-tracker/dist/sp.js
| +25.58KB | 26KB / +10% :white_check_mark: | trackers/javascript-tracker/dist/sp.lite.js
| +15.87KB | 16KB / +10% :white_check_mark: | trackers/browser-tracker/dist/index.umd.min.j
s
| +15.83KB | 16KB / +10% :white_check_mark: | libraries/tracker-core/dist/index.module.js
| +13.61KB | 15KB / +10% :white_check_mark: | trackers/browser-tracker/dist/index.module.js
| +3.51KB | 5KB / +10%

Total files change +101.91KB 0%

Final result: :white_check_mark:

View report in BundleMon website ➡️


Current branch size history