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.2.0
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.2.1
Choose a head ref
  • 7 commits
  • 24 files changed
  • 2 contributors

Commits on Oct 22, 2018

  1. Copy the full SHA
    d67ad66 View commit details

Commits on Oct 23, 2018

  1. fix: Several fixes (#1671)

    HazAT authored Oct 23, 2018
    Copy the full SHA
    4dd82e8 View commit details
  2. meta: 4.2.1 Changelog

    HazAT committed Oct 23, 2018
    Copy the full SHA
    461af65 View commit details
  3. fix: Update pack script

    HazAT committed Oct 23, 2018
    Copy the full SHA
    81a8a9b View commit details
  4. Copy the full SHA
    04b0114 View commit details
  5. meta: Update travis.yml

    HazAT committed Oct 23, 2018
    Copy the full SHA
    3f65762 View commit details
  6. release: 4.2.1

    HazAT committed Oct 23, 2018
    Copy the full SHA
    f25aecb View commit details
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
git:
depth: false # we need this to make proper releases

branches:
only:
- master
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,12 @@

## Unreleased

## 4.2.1

- [core]: Invert logger logic the explicitly enable it.
- [hub]: Require `domain` in `getCurrentHub` in try/catch - Fixed #1670
- [hub]: Removed exposed getter on the Scope.

## 4.2.0

- [browser] fix: Make `addBreadcrumb` sync internally, `beforeBreadcrumb` is now only sync
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.2.0",
"version": "4.2.1",
"packages": "packages/*",
"ignore": "raven-*",
"npmClient": "yarn",
8 changes: 4 additions & 4 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/browser",
"version": "4.2.0",
"version": "4.2.1",
"description": "Offical Sentry SDK for browsers",
"repository": "git://github.com/getsentry/raven-js.git",
"homepage": "https://github.com/getsentry/raven-js/tree/master/packages/browser",
@@ -15,9 +15,9 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "4.2.0",
"@sentry/types": "4.2.0",
"@sentry/utils": "4.2.0"
"@sentry/core": "4.2.1",
"@sentry/types": "4.2.1",
"@sentry/utils": "4.2.1"
},
"devDependencies": {
"@types/md5": "2.1.32",
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.2.0';
export const SDK_VERSION = '4.2.1';
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/core",
"version": "4.2.0",
"version": "4.2.1",
"description": "Base implementation for all Sentry JavaScript SDKs",
"repository": "git://github.com/getsentry/raven-js.git",
"homepage": "https://github.com/getsentry/raven-js/tree/master/packages/core",
@@ -15,10 +15,10 @@
"access": "public"
},
"dependencies": {
"@sentry/hub": "4.2.0",
"@sentry/minimal": "4.2.0",
"@sentry/types": "4.2.0",
"@sentry/utils": "4.2.0"
"@sentry/hub": "4.2.1",
"@sentry/minimal": "4.2.1",
"@sentry/types": "4.2.1",
"@sentry/utils": "4.2.1"
},
"devDependencies": {
"jest": "^22.4.3",
2 changes: 1 addition & 1 deletion packages/core/src/integrations/dedupe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';
import { Integration, SentryEvent, SentryException, StackFrame } from '@sentry/types';
import { logger } from '@sentry/utils/logger';
import { getEventDescription } from '@sentry/utils/misc';
import { logger } from '../logger';

/** Deduplication filter */
export class Dedupe implements Integration {
57 changes: 0 additions & 57 deletions packages/core/src/logger.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/core/src/sdk.ts
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ export interface ClientClass<F extends Client, O extends Options> {
* @returns The installed and bound client instance.
*/
export function initAndBind<F extends Client, O extends Options>(clientClass: ClientClass<F, O>, options: O): void {
if (!options.debug) {
logger.disable();
if (options.debug === true) {
logger.enable();
}

if (getCurrentHub().getClient()) {
20 changes: 10 additions & 10 deletions packages/core/test/lib/base.test.ts
Original file line number Diff line number Diff line change
@@ -101,65 +101,65 @@ describe('BaseClient', () => {
const scope = new Scope();
scope.addBreadcrumb({ message: 'hello' }, 100);
client.addBreadcrumb({ message: 'world' }, undefined, scope);
expect(scope.getBreadcrumbs()[1].message).toBe('world');
expect((scope as any).breadcrumbs[1].message).toBe('world');
});

test('adds a timestamp to new breadcrumbs', () => {
const client = new TestClient({});
const scope = new Scope();
scope.addBreadcrumb({ message: 'hello' }, 100);
client.addBreadcrumb({ message: 'world' }, undefined, scope);
expect(scope.getBreadcrumbs()[1].timestamp).toBeGreaterThan(1);
expect((scope as any).breadcrumbs[1].timestamp).toBeGreaterThan(1);
});

test('discards breadcrumbs beyond maxBreadcrumbs', () => {
const client = new TestClient({ maxBreadcrumbs: 1 });
const scope = new Scope();
scope.addBreadcrumb({ message: 'hello' }, 100);
client.addBreadcrumb({ message: 'world' }, undefined, scope);
expect(scope.getBreadcrumbs().length).toBe(1);
expect(scope.getBreadcrumbs()[0].message).toBe('world');
expect((scope as any).breadcrumbs.length).toBe(1);
expect((scope as any).breadcrumbs[0].message).toBe('world');
});

test('allows concurrent updates', () => {
const client = new TestClient({});
const scope = new Scope();
client.addBreadcrumb({ message: 'hello' }, undefined, scope);
client.addBreadcrumb({ message: 'world' }, undefined, scope);
expect(scope.getBreadcrumbs()).toHaveLength(2);
expect((scope as any).breadcrumbs).toHaveLength(2);
});

test('calls beforeBreadcrumb and adds the breadcrumb without any changes', () => {
const beforeBreadcrumb = jest.fn(breadcrumb => breadcrumb);
const client = new TestClient({ beforeBreadcrumb });
const scope = new Scope();
client.addBreadcrumb({ message: 'hello' }, undefined, scope);
expect(scope.getBreadcrumbs()[0].message).toBe('hello');
expect((scope as any).breadcrumbs[0].message).toBe('hello');
});

test('calls beforeBreadcrumb and uses the new one', () => {
const beforeBreadcrumb = jest.fn(() => ({ message: 'changed' }));
const client = new TestClient({ beforeBreadcrumb });
const scope = new Scope();
client.addBreadcrumb({ message: 'hello' }, undefined, scope);
expect(scope.getBreadcrumbs()[0].message).toBe('changed');
expect((scope as any).breadcrumbs[0].message).toBe('changed');
});

test('calls beforeBreadcrumb and discards the breadcrumb when returned null', () => {
const beforeBreadcrumb = jest.fn(() => null);
const client = new TestClient({ beforeBreadcrumb });
const scope = new Scope();
client.addBreadcrumb({ message: 'hello' }, undefined, scope);
expect(scope.getBreadcrumbs().length).toBe(0);
expect((scope as any).breadcrumbs.length).toBe(0);
});

test('calls beforeBreadcrumb gets an access to a hint as a second argument', () => {
const beforeBreadcrumb = jest.fn((breadcrumb, hint) => ({ ...breadcrumb, data: hint.data }));
const client = new TestClient({ beforeBreadcrumb });
const scope = new Scope();
client.addBreadcrumb({ message: 'hello' }, { data: 'someRandomThing' }, scope);
expect(scope.getBreadcrumbs()[0].message).toBe('hello');
expect(scope.getBreadcrumbs()[0].data).toBe('someRandomThing');
expect((scope as any).breadcrumbs[0].message).toBe('hello');
expect((scope as any).breadcrumbs[0].data).toBe('someRandomThing');
});
});

6 changes: 3 additions & 3 deletions packages/hub/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/hub",
"version": "4.2.0",
"version": "4.2.1",
"description": "Sentry hub which handles global state managment.",
"repository": "git://github.com/getsentry/raven-js.git",
"homepage": "https://github.com/getsentry/raven-js/tree/master/packages/hub",
@@ -15,8 +15,8 @@
"access": "public"
},
"dependencies": {
"@sentry/types": "4.2.0",
"@sentry/utils": "4.2.0"
"@sentry/types": "4.2.1",
"@sentry/utils": "4.2.1"
},
"devDependencies": {
"jest": "^22.4.3",
2 changes: 1 addition & 1 deletion packages/hub/src/hub.ts
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ import {
} from '@sentry/types';
import { logger } from '@sentry/utils/logger';
import { getGlobalObject, uuid4 } from '@sentry/utils/misc';
import * as domain from 'domain';
import { Carrier, Layer } from './interfaces';
import { Scope } from './scope';

@@ -335,6 +334,7 @@ export function getCurrentHub(): Hub {

// Prefer domains over global if they are there
try {
const domain = require('domain');
const activeDomain = domain.active;

// If there no active domain, just return global hub
30 changes: 0 additions & 30 deletions packages/hub/src/scope.ts
Original file line number Diff line number Diff line change
@@ -148,36 +148,6 @@ export class Scope {
return newScope;
}

/** Returns tags. */
public getTags(): { [key: string]: string } {
return this.tags;
}

/** Returns extra. */
public getExtra(): { [key: string]: any } {
return this.extra;
}

/** Returns extra. */
public getUser(): User {
return this.user;
}

/** Returns fingerprint. */
public getFingerprint(): string[] | undefined {
return this.fingerprint;
}

/** Returns breadcrumbs. */
public getBreadcrumbs(): Breadcrumb[] {
return this.breadcrumbs;
}

/** Returns level. */
public getLevel(): Severity | undefined {
return this.level;
}

/** Clears the current scope and resets its properties. */
public clear(): void {
this.breadcrumbs = [];
4 changes: 2 additions & 2 deletions packages/hub/test/hub.test.ts
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ describe('Hub', () => {
hub.pushScope();
expect(hub.getStack()).toHaveLength(2);
expect(hub.getStack()[1].scope).not.toBe(localScope);
expect((hub.getStack()[1].scope as Scope).getExtra()).toEqual({ a: 'b' });
expect(((hub.getStack()[1].scope as Scope) as any).extra).toEqual({ a: 'b' });
});

test('pushScope inherit client', () => {
@@ -241,7 +241,7 @@ describe('Hub', () => {
localScope.setExtra('a', 'b');
const hub = new Hub({ a: 'b' }, localScope);
hub.configureScope(confScope => {
expect(confScope.getExtra()).toEqual({ a: 'b' });
expect((confScope as any).extra).toEqual({ a: 'b' });
});
});

Loading