Skip to content

Commit

Permalink
fix fingerprinting when using synthetic traces
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Cruz committed Mar 6, 2018
1 parent 1c761dd commit bce9f86
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,14 @@ Raven.prototype = {

options = options || {};

var strMsg = msg + ''; // Make sure it's actually a string
var data = objectMerge(
{
message: msg + '' // Make sure it's actually a string
message: strMsg
},
options
);
var isFingerprint = isArray(data.fingerprint) && data.fingerprint.length;

var ex;
// Generate a "synthetic" stack trace from this point.
Expand Down Expand Up @@ -555,11 +557,13 @@ Raven.prototype = {
}

if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
if (!isFingerprint) {
// fingerprint on msg, not stack trace (legacy behavior, could be
// revisited)
data.fingerprint = [strMsg];
}
options = objectMerge(
{
// fingerprint on msg, not stack trace (legacy behavior, could be
// revisited)
fingerprint: msg,
trimHeadFrames: 0
},
options
Expand Down

0 comments on commit bce9f86

Please sign in to comment.