File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1921,6 +1921,9 @@ Raven.prototype = {
1921
1921
} else if ( current . exception || last . exception ) {
1922
1922
// Exception interface (i.e. from captureException/onerror)
1923
1923
return isSameException ( current . exception , last . exception ) ;
1924
+ } else if ( current . fingerprint || last . fingerprint ) {
1925
+ return Boolean ( current . fingerprint && last . fingerprint ) &&
1926
+ JSON . stringify ( current . fingerprint ) === JSON . stringify ( last . fingerprint )
1924
1927
}
1925
1928
1926
1929
return true ;
Original file line number Diff line number Diff line change @@ -3856,6 +3856,30 @@ describe('Raven (private methods)', function() {
3856
3856
assert . isFalse ( Raven . _isRepeatData ( data ) ) ;
3857
3857
} ) ;
3858
3858
3859
+ it ( 'should return false for different fingerprints' , function ( ) {
3860
+ var data = JSON . parse ( JSON . stringify ( Raven . _lastData ) ) ; // copy
3861
+ data . fingerprint = [ '{{ default }}' , 'grouping-identifier' ] ;
3862
+
3863
+ assert . isFalse ( Raven . _isRepeatData ( data ) ) ;
3864
+
3865
+ Raven . _lastData . fingerprint = [ '{{ default }}' , 'other-grouping-identifier' ] ;
3866
+
3867
+ assert . isFalse ( Raven . _isRepeatData ( data ) ) ;
3868
+
3869
+ delete data . fingerprint ;
3870
+
3871
+ assert . isFalse ( Raven . _isRepeatData ( data ) ) ;
3872
+ } ) ;
3873
+
3874
+ it ( 'should return false for different messages and identical fingerprints' , function ( ) {
3875
+ Raven . _lastData . message = 'the thing broke' ;
3876
+ Raven . _lastData . fingerprint = [ '{{ default }}' , 'grouping-identifier' ] ;
3877
+ var data = JSON . parse ( JSON . stringify ( Raven . _lastData ) ) ; // copy
3878
+ data . message = 'the other thing broke' ;
3879
+
3880
+ assert . isFalse ( Raven . _isRepeatData ( data ) ) ;
3881
+ } ) ;
3882
+
3859
3883
it ( 'should return false for different captureMessage payloads w/ synthetic traces' , function ( ) {
3860
3884
Raven . _lastData . stacktrace = {
3861
3885
frames : [
You can’t perform that action at this time.
0 commit comments