Skip to content

Commit

Permalink
3.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Mar 31, 2017
1 parent cb5e0df commit d209408
Show file tree
Hide file tree
Showing 20 changed files with 111 additions and 41 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 3.14.0
* NEW: URL values captured in http + breadcrumb interfaces are now trimmed to new `maxUrlLength` config (default 250). See: https://github.com/getsentry/raven-js/pull/906
* CHANGE: Better extraction of URLs from eval frames on Chrome, Firefox. This may affect issue grouping of some events. See: https://github.com/getsentry/raven-js/pull/907
* BUGFIX: Raven.js now parses webpack:// URLs (generated when using devtool: eval). See: https://github.com/getsentry/raven-js/pull/908
* BUGFIX: React Native frames on Android no longer show [native code]. See: https://github.com/getsentry/raven-js/pull/875


## 3.13.1
* BUGFIX: Revert TypeScript declaration changes from 3.13.0 that resulted in bad imports. See: https://github.com/getsentry/raven-js/issues/898

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raven-js",
"version": "3.13.1",
"version": "3.14.0",
"dependencies": {},
"main": "dist/raven.js",
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/angular.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.13.1 (f55d281) | github.com/getsentry/raven-js */
/*! Raven.js 3.14.0 (6b817d7) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/angular.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/console.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.13.1 (f55d281) | github.com/getsentry/raven-js */
/*! Raven.js 3.14.0 (6b817d7) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/console.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/ember.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.13.1 (f55d281) | github.com/getsentry/raven-js */
/*! Raven.js 3.14.0 (6b817d7) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/ember.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/require.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.13.1 (f55d281) | github.com/getsentry/raven-js */
/*! Raven.js 3.14.0 (6b817d7) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/require.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/vue.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.13.1 (f55d281) | github.com/getsentry/raven-js */
/*! Raven.js 3.14.0 (6b817d7) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/vue.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 79 additions & 16 deletions dist/raven.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.13.1 (f55d281) | github.com/getsentry/raven-js */
/*! Raven.js 3.14.0 (6b817d7) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down Expand Up @@ -115,6 +115,9 @@ function Raven() {
crossOrigin: 'anonymous',
collectWindowErrors: true,
maxMessageLength: 0,

// By default, truncates URL values to 250 chars
maxUrlLength: 250,
stackTraceLimit: 50,
autoBreadcrumbs: true,
sampleRate: 1
Expand Down Expand Up @@ -152,7 +155,7 @@ Raven.prototype = {
// webpack (using a build step causes webpack #1617). Grunt verifies that
// this value matches package.json during build.
// See: https://github.com/getsentry/raven-js/issues/465
VERSION: '3.13.1',
VERSION: '3.14.0',

debug: false,

Expand Down Expand Up @@ -457,9 +460,10 @@ Raven.prototype = {

if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
var ex;
// create a stack trace from this point; just trim
// off extra frames so they don't include this function call (or
// earlier Raven.js library fn calls)
// Generate a "synthetic" stack trace from this point.
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
// of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
// or if it catches a thrown object without a "stack" property.
try {
throw new Error(msg);
} catch (ex1) {
Expand All @@ -473,6 +477,9 @@ Raven.prototype = {
// fingerprint on msg, not stack trace (legacy behavior, could be
// revisited)
fingerprint: msg,
// since we know this is a synthetic trace, the top N-most frames
// MUST be from Raven.js, so mark them as in_app later by setting
// trimHeadFrames
trimHeadFrames: (options.trimHeadFrames || 0) + 1
}, options);

Expand Down Expand Up @@ -1385,9 +1392,46 @@ Raven.prototype = {
exception.value = truncate(exception.value, max);
}

var request = data.request;
if (request) {
if (request.url) {
request.url = truncate(request.url, this._globalOptions.maxUrlLength);
}
if (request.Referer) {
request.Referer = truncate(request.Referer, this._globalOptions.maxUrlLength);
}
}

if (data.breadcrumbs && data.breadcrumbs.values)
this._trimBreadcrumbs(data.breadcrumbs);

return data;
},

/**
* Truncate breadcrumb values (right now just URLs)
*/
_trimBreadcrumbs: function (breadcrumbs) {
// known breadcrumb properties with urls
// TODO: also consider arbitrary prop values that start with (https?)?://
var urlprops = {to: 1, from: 1, url: 1},
crumb,
data;

for (var i = 0; i < breadcrumbs.values.length; i++) {
crumb = breadcrumbs.values[i];
if (!crumb.hasOwnProperty('data'))
continue;

data = crumb.data;
for (var prop in urlprops) {
if (data.hasOwnProperty(prop)) {
data[prop] = truncate(data[prop], this._globalOptions.maxUrlLength);
}
}
}
},

_getHttpData: function() {
if (!this._hasNavigator && !this._hasDocument) return;
var httpData = {};
Expand Down Expand Up @@ -2491,18 +2535,31 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
function computeStackTraceFromStackProp(ex) {
if (typeof ex.stack === 'undefined' || !ex.stack) return;

var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|<anonymous>).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|resource|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,
winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,
gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,
winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,

// Used to additionally parse URL/line/column from eval frames
geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i,
chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/,

lines = ex.stack.split('\n'),
stack = [],
submatch,
parts,
element,
reference = /^(.*) is undefined$/.exec(ex.message);

for (var i = 0, j = lines.length; i < j; ++i) {
if ((parts = chrome.exec(lines[i]))) {
var isNative = parts[2] && parts[2].indexOf('native') !== -1;
var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line
var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line
if (isEval && (submatch = chromeEval.exec(parts[2]))) {
// throw out eval line/column and use top-most line/column number
parts[2] = submatch[1]; // url
parts[3] = submatch[2]; // line
parts[4] = submatch[3]; // column
}
element = {
'url': !isNative ? parts[2] : null,
'func': parts[1] || UNKNOWN_FUNCTION,
Expand All @@ -2519,6 +2576,19 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
'column': parts[4] ? +parts[4] : null
};
} else if ((parts = gecko.exec(lines[i]))) {
var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
if (isEval && (submatch = geckoEval.exec(parts[3]))) {
// throw out eval line/column and use top-most line number
parts[3] = submatch[1];
parts[4] = submatch[2];
parts[5] = null; // no column when eval
} else if (i === 0 && !parts[5] && typeof ex.columnNumber !== 'undefined') {
// FireFox uses this awesome columnNumber property for its top frame
// Also note, Firefox's column number is 0-based and everything else expects 1-based,
// so adding 1
// NOTE: this hack doesn't work if top-most frame is eval
stack[0].column = ex.columnNumber + 1;
}
element = {
'url': parts[3],
'func': parts[1] || UNKNOWN_FUNCTION,
Expand All @@ -2541,13 +2611,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
return null;
}

if (!stack[0].column && typeof ex.columnNumber !== 'undefined') {
// FireFox uses this awesome columnNumber property for its top frame
// Also note, Firefox's column number is 0-based and everything else expects 1-based,
// so adding 1
stack[0].column = ex.columnNumber + 1;
}

return {
'name': ex.name,
'message': ex.message,
Expand Down
4 changes: 2 additions & 2 deletions dist/raven.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/raven.min.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/sri.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"@dist/raven.js": {
"hashes": {
"sha256": "DqjGfkHlXEUoWD0W2CirZy+/TcbA2bWYVZGM4GICEwc=",
"sha512": "pEOdKiz/v/gFCOIrBNn9R/Cg/z2a+oGEnwqs5h//UGAQ3ODQxdKfKvVotG+hw0z+R57+g07af2l9oOqcjcu53g=="
"sha256": "GaVHYvmPLfox/Z5Ob1I5FWL3pVAPwZLuPktzwzCxcms=",
"sha512": "SEmxNHXuuNcE69xNoUGYGeNqfDJoip3KO39CZAR5n1UNu1gYNFKF138iQz9d6xq7ZO4jEHH95Nb4zgQpFigkpA=="
},
"type": null,
"integrity": "sha256-DqjGfkHlXEUoWD0W2CirZy+/TcbA2bWYVZGM4GICEwc= sha512-pEOdKiz/v/gFCOIrBNn9R/Cg/z2a+oGEnwqs5h//UGAQ3ODQxdKfKvVotG+hw0z+R57+g07af2l9oOqcjcu53g==",
"integrity": "sha256-GaVHYvmPLfox/Z5Ob1I5FWL3pVAPwZLuPktzwzCxcms= sha512-SEmxNHXuuNcE69xNoUGYGeNqfDJoip3KO39CZAR5n1UNu1gYNFKF138iQz9d6xq7ZO4jEHH95Nb4zgQpFigkpA==",
"path": "dist/raven.js"
},
"@dist/raven.min.js": {
"hashes": {
"sha256": "rQKHhUx4JZkHPhu3S2kaqiCLZEOuVBP9W6K6LZMeSPI=",
"sha512": "xnf3jkR3/5vLX/GSvRlZnJJMfzP4I1oFMyINzQGq9+2esFgSywjARxwYG/ypRnCxJyNhBH3jxdNBHN0UEy/30w=="
"sha256": "YqZhLyo9sB/cpJWaREgvUe+nFUN9qC8h+qdNs8OoAVk=",
"sha512": "s7n51Ike9SKQix2aVAB8KytL5B3H9Uk5LAMY731p6lQtGX9JNgVL3uxqoTDEM/pJ9gxVyO2aJXNAjvFNvrFzrg=="
},
"type": null,
"integrity": "sha256-rQKHhUx4JZkHPhu3S2kaqiCLZEOuVBP9W6K6LZMeSPI= sha512-xnf3jkR3/5vLX/GSvRlZnJJMfzP4I1oFMyINzQGq9+2esFgSywjARxwYG/ypRnCxJyNhBH3jxdNBHN0UEy/30w==",
"integrity": "sha256-YqZhLyo9sB/cpJWaREgvUe+nFUN9qC8h+qdNs8OoAVk= sha512-s7n51Ike9SKQix2aVAB8KytL5B3H9Uk5LAMY731p6lQtGX9JNgVL3uxqoTDEM/pJ9gxVyO2aJXNAjvFNvrFzrg==",
"path": "dist/raven.min.js"
}
}
2 changes: 1 addition & 1 deletion docs/sentry-doc-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
}
},
"vars": {
"RAVEN_VERSION": "3.13.1"
"RAVEN_VERSION": "3.14.0"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raven-js",
"version": "3.13.1",
"version": "3.14.0",
"license": "BSD-2-Clause",
"homepage": "https://github.com/getsentry/raven-js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Raven.prototype = {
// webpack (using a build step causes webpack #1617). Grunt verifies that
// this value matches package.json during build.
// See: https://github.com/getsentry/raven-js/issues/465
VERSION: '3.13.1',
VERSION: '3.14.0',

debug: false,

Expand Down
4 changes: 2 additions & 2 deletions test/raven.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ describe('globals', function() {
extra: {'session:duration': 100},
});
assert.deepEqual(opts.auth, {
sentry_client: 'raven-js/3.13.1',
sentry_client: 'raven-js/3.14.0',
sentry_key: 'abc',
sentry_version: '7'
});
Expand Down Expand Up @@ -1125,7 +1125,7 @@ describe('globals', function() {
extra: {'session:duration': 100},
});
assert.deepEqual(opts.auth, {
sentry_client: 'raven-js/3.13.1',
sentry_client: 'raven-js/3.14.0',
sentry_key: 'abc',
sentry_secret: 'def',
sentry_version: '7'
Expand Down

0 comments on commit d209408

Please sign in to comment.