Commit 6c33f68
committed
Truncate browser context hardwareConcurrency value
We have received reports of some UAs providing this value as a floating point rather than integral value (contrary to the web standards). This causes events from those agents to be invalid because the schema requires it to be an integer. To meet the documented behavior and schema expectations, floor the value to ensure it is a whole integer. If the UA doesn't have this value, Math.floor should return NaN which we will turn into undefined to exclude from the event. This will also occur with '0', which shouldn't be a valid value according to the standard anyway so is deemed acceptable.
Issue: AISP-6291 parent ca65906 commit 6c33f68
File tree
2 files changed
+11
-1
lines changed- common/changes/@snowplow/browser-tracker-core
- libraries/browser-tracker-core/src/helpers
2 files changed
+11
-1
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments