@segment/analytics.js-integration-segmentio
Advanced tools
Comparing version 3.9.0 to 4.0.0
4.0.0 / 2019-03-08 | ||
================== | ||
* [New](https://github.com/segment-integrations/analytics.js-integration-segmentio/pull/55): Stop Generating MessageId. | ||
3.9.0 / 2019-01-14 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -15,3 +15,2 @@ 'use strict'; | ||
var localstorage = require('yields-store'); | ||
var md5 = require('spark-md5').hash; | ||
var protocol = require('@segment/protocol'); | ||
@@ -316,4 +315,2 @@ var send = require('@segment/send-json'); | ||
} | ||
// add some randomness to the messageId checksum | ||
msg.messageId = 'ajs-' + md5(json.stringify(msg) + uuid()); | ||
this.debug('normalized %o', msg); | ||
@@ -320,0 +317,0 @@ this.ampId(ctx); |
{ | ||
"name": "@segment/analytics.js-integration-segmentio", | ||
"description": "The Segmentio analytics.js integration.", | ||
"version": "3.9.0", | ||
"version": "4.0.0", | ||
"keywords": [ | ||
@@ -39,3 +39,2 @@ "analytics.js", | ||
"json3": "^3.3.2", | ||
"spark-md5": "^2.0.2", | ||
"uuid": "^2.0.2", | ||
@@ -45,3 +44,3 @@ "yields-store": "^1.0.2" | ||
"devDependencies": { | ||
"@segment/analytics.js-core": "^3.1.3", | ||
"@segment/analytics.js-core": "^3.8.0", | ||
"@segment/analytics.js-integration-tester": "^2.0.0", | ||
@@ -48,0 +47,0 @@ "@segment/clear-env": "^2.0.0", |
@@ -178,17 +178,2 @@ 'use strict'; | ||
it('should add .messageId', function() { | ||
segment.normalize(object); | ||
analytics.assert(object.messageId.length === 36); | ||
}); | ||
it('should properly randomize .messageId', function() { | ||
var set = {}; | ||
var count = 1000; | ||
for (var i = 0; i < count; i++) { | ||
var id = segment.normalize(object).messageId; | ||
set[id] = true; | ||
} | ||
analytics.assert(Object.keys(set).length === count); | ||
}); | ||
it('should add .library', function() { | ||
@@ -429,2 +414,9 @@ segment.normalize(object); | ||
}); | ||
it('should pick up messageId from AJS', function() { | ||
object = analytics.normalize(object); // ajs core generates the message ID here | ||
var messageId = object.messageId; | ||
segment.normalize(object); | ||
assert.equal(object.messageId, messageId); | ||
}); | ||
}); | ||
@@ -431,0 +423,0 @@ }); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15
80352
13
1801
1
- Removedspark-md5@^2.0.2
- Removedspark-md5@2.0.2(transitive)