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
547 stars 220 forks source link

vid is being set to NaN in recent tracker version #1204

Closed jakeberesford-palmetto closed 1 year ago

jakeberesford-palmetto commented 1 year ago

Describe the bug Tracking events sent using this tracker are failing in enrichment with the following failure message

{
  "expectation": "cannot be converted to java.lang.Integer",
  "field": "vid",
  "value": "NaN"
}

I suspect this commit causes the issue: https://github.com/snowplow/snowplow-javascript-tracker/commit/b212eb7a15fc4fe0248dacfbc4e592277fe58b75#diff-e1e232ecf4c494ec3be5f942f973200db624f9569d1776b35781614dcf2a97a8R97

To Reproduce

  1. Send a tracking event without calling setSessionIndex or setSessionId
  2. Observe the vid p is set to NaN

Expected behavior

vid is not set if sessionIndex is undefined

Desktop (please complete the following information):

Additional context

We are using this package server-side in a node.js application.

igneel64 commented 1 year ago

Hey @jakeberesford-palmetto , thanks for spotting that, we released v3.12.1 which hopefully resolves this issue !

jakeberesford-palmetto commented 1 year ago

Thanks for the quick turnaround @igneel64 - much appreciated!