File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -656,8 +656,8 @@ function send(data) {
656
656
} , data ) ;
657
657
658
658
// Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
659
- data . tags = objectMerge ( globalOptions . tags , data . tags ) ;
660
- data . extra = objectMerge ( globalOptions . extra , data . extra ) ;
659
+ data . tags = objectMerge ( objectMerge ( { } , globalOptions . tags ) , data . tags ) ;
660
+ data . extra = objectMerge ( objectMerge ( { } , globalOptions . extra ) , data . extra ) ;
661
661
662
662
// Send along our own collected metadata with extra
663
663
data . extra = objectMerge ( {
Original file line number Diff line number Diff line change @@ -897,6 +897,11 @@ describe('globals', function() {
897
897
tags : { tag1 : 'value1' , tag2 : 'value2' } ,
898
898
extra : { 'session:duration' : 100 }
899
899
} ] ) ;
900
+ assert . deepEqual ( globalOptions , {
901
+ logger : 'javascript' ,
902
+ site : 'THE BEST' ,
903
+ tags : { tag1 : 'value1' }
904
+ } ) ;
900
905
} ) ;
901
906
902
907
it ( 'should merge in global extra' , function ( ) {
@@ -930,6 +935,11 @@ describe('globals', function() {
930
935
event_id : 'abc123' ,
931
936
extra : { key1 : 'value1' , key2 : 'value2' , 'session:duration' : 100 }
932
937
} ] ) ;
938
+ assert . deepEqual ( globalOptions , {
939
+ logger : 'javascript' ,
940
+ site : 'THE BEST' ,
941
+ extra : { key1 : 'value1' }
942
+ } ) ;
933
943
} ) ;
934
944
935
945
it ( 'should let dataCallback override everything' , function ( ) {
You can’t perform that action at this time.
0 commit comments