Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getsentry/sentry-javascript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.5.3
Choose a base ref
...
head repository: getsentry/sentry-javascript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.5.4
Choose a head ref
  • 12 commits
  • 18 files changed
  • 4 contributors

Commits on Jan 21, 2019

  1. Copy the full SHA
    419ef8d View commit details

Commits on Jan 31, 2019

  1. Copy the full SHA
    3ddda21 View commit details
  2. Copy the full SHA
    89bca28 View commit details

Commits on Feb 6, 2019

  1. Copy the full SHA
    28b8164 View commit details

Commits on Feb 7, 2019

  1. Copy the full SHA
    b0cabe5 View commit details

Commits on Feb 8, 2019

  1. Copy the full SHA
    b39b1c7 View commit details
  2. Copy the full SHA
    b00159f View commit details
  3. Copy the full SHA
    587b8f3 View commit details
  4. Copy the full SHA
    73a5c00 View commit details
  5. Copy the full SHA
    abeb2e6 View commit details

Commits on Feb 11, 2019

  1. misc: 4.5.4 changelog

    kamilogorek committed Feb 11, 2019
    Copy the full SHA
    f79d18c View commit details
  2. release: 4.5.4

    kamilogorek committed Feb 11, 2019
    Copy the full SHA
    bb75ee7 View commit details
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,15 @@

## Unreleased

## 4.5.4

- [browser] fix: `DOMError` and `DOMException` should be error level events
- [browser] ref: Log error if Ember/Vue instances are not provided
- [utils] fix: Dont mutate original input in `decycle` util function
- [utils] fix: Skip non-enumerable properties in `decycle` util function
- [utils] ref: Update `wrap` method to hide internal Sentry flags
- [utils] fix: Make internal Sentry flags non-enumerable in `fill` util

## 4.5.3

- [browser]: fix: Fix UnhandledPromise: [object Object]
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "3.4.0",
"version": "4.5.3",
"version": "4.5.4",
"packages": "packages/*",
"ignore": "raven-*",
"npmClient": "yarn",
6 changes: 3 additions & 3 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/browser",
"version": "4.5.3",
"version": "4.5.4",
"description": "Offical Sentry SDK for browsers",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -15,9 +15,9 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "4.5.3",
"@sentry/core": "4.5.4",
"@sentry/types": "4.5.3",
"@sentry/utils": "4.5.3",
"@sentry/utils": "4.5.4",
"tslib": "^1.9.3"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/browser/src/backend.ts
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ export class BrowserBackend extends BaseBackend<BrowserOptions> {
const name = ex.name || (isDOMError(ex) ? 'DOMError' : 'DOMException');
const message = ex.message ? `${name}: ${ex.message}` : name;

event = await this.eventFromMessage(message, undefined, hint);
event = await this.eventFromMessage(message, Severity.Error, hint);
addExceptionTypeValue(event, message);
} else if (isError(exception as Error)) {
// we have a real Error object, do nothing
19 changes: 16 additions & 3 deletions packages/browser/src/integrations/helpers.ts
Original file line number Diff line number Diff line change
@@ -113,13 +113,26 @@ export function wrap(
}
} catch (_oO) {} // tslint:disable-line:no-empty

fn.prototype = fn.prototype || {};
sentryWrapped.prototype = fn.prototype;
fn.__sentry_wrapped__ = sentryWrapped;

Object.defineProperty(fn, '__sentry_wrapped__', {
enumerable: false,
value: sentryWrapped,
});

// Signal that this function has been wrapped/filled already
// for both debugging and to prevent it to being wrapped/filled twice
sentryWrapped.__sentry__ = true;
sentryWrapped.__sentry_original__ = fn;
Object.defineProperties(sentryWrapped, {
__sentry__: {
enumerable: false,
value: true,
},
__sentry_original__: {
enumerable: false,
value: fn,
},
});

return sentryWrapped;
}
2 changes: 2 additions & 0 deletions packages/browser/src/integrations/pluggable/ember.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { captureException, captureMessage, getCurrentHub, Scope, withScope } from '@sentry/core';
import { Integration, SentryEvent } from '@sentry/types';
import { logger } from '@sentry/utils/logger';
import { getGlobalObject } from '@sentry/utils/misc';

/** JSDoc */
@@ -34,6 +35,7 @@ export class Ember implements Integration {
*/
public setupOnce(): void {
if (!this.Ember) {
logger.error('EmberIntegration is missing an Ember instance');
return;
}

2 changes: 2 additions & 0 deletions packages/browser/src/integrations/pluggable/vue.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { captureException, getCurrentHub, withScope } from '@sentry/core';
import { Integration, SentryEvent } from '@sentry/types';
import { isPlainObject, isUndefined } from '@sentry/utils/is';
import { logger } from '@sentry/utils/logger';
import { getGlobalObject } from '@sentry/utils/misc';

/** JSDoc */
@@ -57,6 +58,7 @@ export class Vue implements Integration {
*/
public setupOnce(): void {
if (!this.Vue || !this.Vue.config) {
logger.error('VueIntegration is missing a Vue instance');
return;
}

2 changes: 1 addition & 1 deletion packages/browser/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const SDK_NAME = 'sentry.javascript.browser';
export const SDK_VERSION = '4.5.3';
export const SDK_VERSION = '4.5.4';
17 changes: 17 additions & 0 deletions packages/browser/test/integrations/helpers.test.ts
Original file line number Diff line number Diff line change
@@ -179,4 +179,21 @@ describe('wrap()', () => {
expect(error.message).equal('boom');
}
});

it('internal flags shouldnt be enumerable', () => {
const fn = (() => 1337) as SentryWrappedFunction;
const wrapped = wrap(fn);

// Shouldn't show up in iteration
expect(Object.keys(fn)).to.not.include('__sentry__');
expect(Object.keys(fn)).to.not.include('__sentry_original__');
expect(Object.keys(fn)).to.not.include('__sentry_wrapped__');
expect(Object.keys(wrapped)).to.not.include('__sentry__');
expect(Object.keys(wrapped)).to.not.include('__sentry_original__');
expect(Object.keys(wrapped)).to.not.include('__sentry_wrapped__');
// But should be accessible directly
expect(wrapped.__sentry__).to.equal(true);
expect(wrapped.__sentry_original__).to.equal(fn);
expect(fn.__sentry_wrapped__).to.equal(wrapped);
});
});
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/core",
"version": "4.5.3",
"version": "4.5.4",
"description": "Base implementation for all Sentry JavaScript SDKs",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
@@ -15,10 +15,10 @@
"access": "public"
},
"dependencies": {
"@sentry/hub": "4.5.3",
"@sentry/minimal": "4.5.3",
"@sentry/hub": "4.5.4",
"@sentry/minimal": "4.5.4",
"@sentry/types": "4.5.3",
"@sentry/utils": "4.5.3",
"@sentry/utils": "4.5.4",
"tslib": "^1.9.3"
},
"devDependencies": {
4 changes: 2 additions & 2 deletions packages/hub/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/hub",
"version": "4.5.3",
"version": "4.5.4",
"description": "Sentry hub which handles global state managment.",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/hub",
@@ -16,7 +16,7 @@
},
"dependencies": {
"@sentry/types": "4.5.3",
"@sentry/utils": "4.5.3",
"@sentry/utils": "4.5.4",
"tslib": "^1.9.3"
},
"devDependencies": {
4 changes: 2 additions & 2 deletions packages/minimal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/minimal",
"version": "4.5.3",
"version": "4.5.4",
"description": "Sentry minimal library that can be used in other packages",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/minimal",
@@ -15,7 +15,7 @@
"access": "public"
},
"dependencies": {
"@sentry/hub": "4.5.3",
"@sentry/hub": "4.5.4",
"@sentry/types": "4.5.3",
"tslib": "^1.9.3"
},
8 changes: 4 additions & 4 deletions packages/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/node",
"version": "4.5.3",
"version": "4.5.4",
"description": "Offical Sentry SDK for Node.js",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -15,10 +15,10 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "4.5.3",
"@sentry/hub": "4.5.3",
"@sentry/core": "4.5.4",
"@sentry/hub": "4.5.4",
"@sentry/types": "4.5.3",
"@sentry/utils": "4.5.3",
"@sentry/utils": "4.5.4",
"@types/stack-trace": "0.0.29",
"cookie": "0.3.1",
"https-proxy-agent": "2.2.1",
2 changes: 1 addition & 1 deletion packages/node/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const SDK_NAME = 'sentry.javascript.node';
export const SDK_VERSION = '4.5.3';
export const SDK_VERSION = '4.5.4';
2 changes: 1 addition & 1 deletion packages/raven-js/typescript/raven.d.ts
Original file line number Diff line number Diff line change
@@ -202,7 +202,7 @@ declare namespace Raven {
* @return {Raven}
*/
captureException(
ex: Error | ErrorEvent | string,
ex: unknown,
options?: RavenOptions
): RavenStatic;

2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/utils",
"version": "4.5.3",
"version": "4.5.4",
"description": "Utilities for all Sentry JavaScript SDKs",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/utils",
43 changes: 35 additions & 8 deletions packages/utils/src/object.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SentryWrappedFunction } from '@sentry/types';
import { isNaN, isPlainObject, isPrimitive, isUndefined } from './is';
import { isArray, isNaN, isPlainObject, isPrimitive, isUndefined } from './is';
import { Memo } from './memo';
import { truncate } from './string';

@@ -62,9 +62,28 @@ export function fill(source: { [key: string]: any }, name: string, replacement:
}
const original = source[name] as () => any;
const wrapped = replacement(original) as SentryWrappedFunction;
wrapped.__sentry__ = true;
wrapped.__sentry_original__ = original;
wrapped.__sentry_wrapped__ = wrapped;

// Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work
// otherwise it'll throw "TypeError: Object.defineProperties called on non-object"
// tslint:disable-next-line:strict-type-predicates
if (typeof wrapped === 'function') {
wrapped.prototype = {};
Object.defineProperties(wrapped, {
__sentry__: {
enumerable: false,
value: true,
},
__sentry_original__: {
enumerable: false,
value: original,
},
__sentry_wrapped__: {
enumerable: false,
value: wrapped,
},
});
}

source[name] = wrapped;
}

@@ -134,7 +153,7 @@ export function serializeObject<T>(value: T, depth: number): T | string | {} {
});

return serialized;
} else if (Array.isArray(value)) {
} else if (isArray(value)) {
const val = (value as any) as T[];
return val.map(v => serializeObject(v, depth - 1));
}
@@ -306,19 +325,27 @@ function normalizeValue(value: any, key?: any): any {
* @param obj Object to be decycled
* @param memo Optional Memo class handling decycling
*/
function decycle(obj: any, memo: Memo = new Memo()): any {
export function decycle(obj: any, memo: Memo = new Memo()): any {
// tslint:disable-next-line:no-unsafe-any
const copy = isArray(obj) ? [...obj] : isPlainObject(obj) ? { ...obj } : obj;

if (!isPrimitive(obj)) {
if (memo.memoize(obj)) {
return '[Circular ~]';
}
// tslint:disable-next-line
for (const key in obj) {
// Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
continue;
}
// tslint:disable-next-line
obj[key] = decycle(obj[key], memo);
copy[key] = decycle(obj[key], memo);
}
memo.unmemoize(obj);
}
return obj;

return copy;
}

/**
Loading