@@ -508,8 +508,8 @@ describe('AmplitudeClient', function() {
508508 '"event_properties":{},"user_properties":{"$set":{"age":30,"city":"San Francisco, CA"}},"uuid":"' +
509509 'c50e1be4-7976-436a-aa25-d9ee38951082","library":{"name":"amplitude-js","version":"2.9.0"},"sequence_number"' +
510510 ':131,"groups":{}}]' ;
511- localStorage . setItem ( 'amplitude_unsent' , existingEvent ) ;
512- localStorage . setItem ( 'amplitude_unsent_identify' , existingIdentify ) ;
511+ localStorage . setItem ( 'amplitude_unsent_' + apiKey , existingEvent ) ;
512+ localStorage . setItem ( 'amplitude_unsent_identify_' + apiKey , existingIdentify ) ;
513513
514514 var amplitude2 = new AmplitudeClient ( '$default_Instance' ) ;
515515 amplitude2 . init ( apiKey , null , { batchEvents : true } ) ;
@@ -535,8 +535,8 @@ describe('AmplitudeClient', function() {
535535 '"event_properties":{},"user_properties":{"$set":{"age":30,"city":"San Francisco, CA"}},"uuid":"' +
536536 'c50e1be4-7976-436a-aa25-d9ee38951082","library":{"name":"amplitude-js","version":"2.9.0"},"sequence_number"' +
537537 ':131,"groups":{}}]' ;
538- localStorage . setItem ( 'amplitude_unsent_new_app ' , existingEvent ) ;
539- localStorage . setItem ( 'amplitude_unsent_identify_new_app ' , existingIdentify ) ;
538+ localStorage . setItem ( 'amplitude_unsent_' + apiKey + '_new_app ', existingEvent ) ;
539+ localStorage . setItem ( 'amplitude_unsent_identify_' + apiKey + '_new_app ', existingIdentify ) ;
540540 assert . isNull ( localStorage . getItem ( 'amplitude_unsent' ) ) ;
541541 assert . isNull ( localStorage . getItem ( 'amplitude_unsent_identify' ) ) ;
542542
@@ -565,7 +565,7 @@ describe('AmplitudeClient', function() {
565565 '[0,1,2,"3"],"nested_array":["a",{"key":"value"},["b"]],"object":{"key":"value"},"nested_object":' +
566566 '{"k":"v","l":[0,1],"o":{"k2":"v2","l2":["e2",{"k3":"v3"}]}}},"user_properties":{},"uuid":"650407a1-d705-' +
567567 '47a0-8918-b4530ce51f89","library":{"name":"amplitude-js","version":"2.9.0"},"sequence_number":5}]'
568- localStorage . setItem ( 'amplitude_unsent' , existingEvents ) ;
568+ localStorage . setItem ( 'amplitude_unsent_' + apiKey , existingEvents ) ;
569569
570570 var amplitude2 = new AmplitudeClient ( '$default_instance' ) ;
571571 amplitude2 . init ( apiKey , null , { batchEvents : true } ) ;
@@ -594,7 +594,7 @@ describe('AmplitudeClient', function() {
594594 '[0,1,2,"3"],"nested_array":["a",{"key":"value"},["b"]],"object":{"key":"value"},"nested_object":' +
595595 '{"k":"v","l":[0,1],"o":{"k2":"v2","l2":["e2",{"k3":"v3"}]}}}},"event_properties":{},"uuid":"650407a1-d705-' +
596596 '47a0-8918-b4530ce51f89","library":{"name":"amplitude-js","version":"2.9.0"},"sequence_number":5}]'
597- localStorage . setItem ( 'amplitude_unsent_identify' , existingEvents ) ;
597+ localStorage . setItem ( 'amplitude_unsent_identify_' + apiKey , existingEvents ) ;
598598
599599 var amplitude2 = new AmplitudeClient ( ) ;
600600 amplitude2 . init ( apiKey , null , { batchEvents : true } ) ;
@@ -625,8 +625,8 @@ describe('AmplitudeClient', function() {
625625 '"event_properties":{},"user_properties":{"$set":{"age":30,"city":"San Francisco, CA"}},"uuid":"' +
626626 'c50e1be4-7976-436a-aa25-d9ee38951082","library":{"name":"amplitude-js","version":"2.9.0"},"sequence_number"' +
627627 ':131}]' ;
628- localStorage . setItem ( 'amplitude_unsent' , existingEvent ) ;
629- localStorage . setItem ( 'amplitude_unsent_identify' , existingIdentify ) ;
628+ localStorage . setItem ( 'amplitude_unsent_' + apiKey , existingEvent ) ;
629+ localStorage . setItem ( 'amplitude_unsent_identify_' + apiKey , existingIdentify ) ;
630630
631631 var amplitude2 = new AmplitudeClient ( ) ;
632632 amplitude2 . init ( apiKey , null , { batchEvents : true , eventUploadThreshold : 2 } ) ;
@@ -661,8 +661,8 @@ it ('should load saved events from localStorage new keys and send events', funct
661661 '"event_properties":{},"user_properties":{"$set":{"age":30,"city":"San Francisco, CA"}},"uuid":"' +
662662 'c50e1be4-7976-436a-aa25-d9ee38951082","library":{"name":"amplitude-js","version":"2.9.0"},"sequence_number"' +
663663 ':131}]' ;
664- localStorage . setItem ( 'amplitude_unsent_new_app ' , existingEvent ) ;
665- localStorage . setItem ( 'amplitude_unsent_identify_new_app ' , existingIdentify ) ;
664+ localStorage . setItem ( 'amplitude_unsent_' + apiKey + '_new_app ', existingEvent ) ;
665+ localStorage . setItem ( 'amplitude_unsent_identify_' + apiKey + '_new_app ', existingIdentify ) ;
666666
667667 var amplitude2 = new AmplitudeClient ( 'new_app' ) ;
668668 amplitude2 . init ( apiKey , null , { batchEvents : true , eventUploadThreshold : 2 } ) ;
@@ -698,7 +698,7 @@ it ('should load saved events from localStorage new keys and send events', funct
698698 '[0,1,2,"3"],"nested_array":["a",{"key":"value"},["b"]],"object":{"key":"value"},"nested_object":' +
699699 '{"k":"v","l":[0,1],"o":{"k2":"v2","l2":["e2",{"k3":"v3"}]}}},"user_properties":{},"uuid":"650407a1-d705-' +
700700 '47a0-8918-b4530ce51f89","library":{"name":"amplitude-js","version":"2.9.0"},"sequence_number":5}]' ;
701- localStorage . setItem ( 'amplitude_unsent' , existingEvents ) ;
701+ localStorage . setItem ( 'amplitude_unsent_' + apiKey , existingEvents ) ;
702702
703703 var amplitude2 = new AmplitudeClient ( ) ;
704704 amplitude2 . init ( apiKey , null , {
@@ -773,11 +773,14 @@ it ('should load saved events from localStorage new keys and send events', funct
773773
774774 var amplitude2 = new AmplitudeClient ( 'new_app' ) ;
775775 amplitude2 . init ( apiKey , null , { trackingOptions : trackingOptions } ) ;
776+ console . log ( JSON . stringify ( amplitude2 . options . trackingOptions ) ) ;
776777
777778 // check config loaded correctly
778779 assert . deepEqual ( amplitude2 . options . trackingOptions , {
779780 city : false ,
780781 country : true ,
782+ carrier : true ,
783+ device_manufacturer : true ,
781784 device_model : true ,
782785 dma : true ,
783786 ip_address : false ,
@@ -2992,8 +2995,8 @@ describe('setVersionName', function() {
29922995 '"event_properties":{},"user_properties":{"$set":{"age":30,"city":"San Francisco, CA"}},"uuid":"' +
29932996 'c50e1be4-7976-436a-aa25-d9ee38951082","library":{"name":"amplitude-js","version":"2.9.0"},"sequence_number"' +
29942997 ':131, "groups":{}}]' ;
2995- localStorage . setItem ( 'amplitude_unsent' , existingEvent ) ;
2996- localStorage . setItem ( 'amplitude_unsent_identify' , existingIdentify ) ;
2998+ localStorage . setItem ( 'amplitude_unsent_' + apiKey , existingEvent ) ;
2999+ localStorage . setItem ( 'amplitude_unsent_identify_' + apiKey , existingIdentify ) ;
29973000
29983001 clock . tick ( 30 * 60 * 1000 + 1 ) ; // force new session
29993002 amplitude . init ( apiKey , undefined , {
0 commit comments