Skip to content

Commit

Permalink
Update to v7.63.0 of the JavaScript SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Aug 11, 2023
1 parent 9f7aba1 commit f5c0a7d
Show file tree
Hide file tree
Showing 20 changed files with 148 additions and 98 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@
"e2e": "cross-env TS_NODE_PROJECT=tsconfig.json xvfb-maybe mocha --require ts-node/register/transpile-only --retries 3 ./test/e2e/*.ts"
},
"dependencies": {
"@sentry/browser": "7.61.0",
"@sentry/core": "7.61.0",
"@sentry/node": "7.61.0",
"@sentry/types": "7.61.0",
"@sentry/utils": "7.61.0",
"@sentry/browser": "7.63.0",
"@sentry/core": "7.63.0",
"@sentry/node": "7.63.0",
"@sentry/types": "7.63.0",
"@sentry/utils": "7.63.0",
"deepmerge": "4.3.0",
"lru_map": "^0.3.3",
"tslib": "^2.5.0"
},
"devDependencies": {
"@sentry-internal/eslint-config-sdk": "7.61.0",
"@sentry-internal/typescript": "7.61.0",
"@sentry-internal/eslint-config-sdk": "7.63.0",
"@sentry-internal/typescript": "7.63.0",
"@types/busboy": "^0.2.3",
"@types/chai": "^4.2.10",
"@types/chai-as-promised": "^7.1.5",
Expand Down
12 changes: 9 additions & 3 deletions src/common/mutex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ interface QueueEntry {

/** An async mutex that queues up tasks for a shared resource */
export class Mutex {
private _entries: Array<QueueEntry> = [];
private _waiters: Array<Releaser> = [];
private _value: number = 1;
private readonly _entries: Array<QueueEntry>;
private _waiters: Array<Releaser>;
private _value: number;

public constructor() {
this._entries = [];
this._waiters = [];
this._value = 1;
}

/** Run a task when all pending tasks are complete */
public async runExclusive<T>(task: () => Promise<T> | T): Promise<T> {
Expand Down
6 changes: 5 additions & 1 deletion src/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ class EmptyIntegration implements Integration {
public static id: string = 'EmptyIntegration';

/** @inheritDoc */
public name: string = EmptyIntegration.id;
public readonly name: string;

public constructor() {
this.name = EmptyIntegration.id;
}

/** @inheritDoc */
public setupOnce(): void {
Expand Down
6 changes: 4 additions & 2 deletions src/main/integrations/additional-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ export class AdditionalContext implements Integration {
public static id: string = 'AdditionalContext';

/** @inheritDoc */
public name: string = AdditionalContext.id;
public readonly name: string;

private readonly _options: AdditionalContextOptions;
private _lazyDeviceContext: DeviceContext = {};
private readonly _lazyDeviceContext: DeviceContext;

public constructor(options: Partial<AdditionalContextOptions> = {}) {
this._lazyDeviceContext = {};
this.name = AdditionalContext.id;
this._options = {
...DEFAULT_OPTIONS,
...options,
Expand Down
3 changes: 2 additions & 1 deletion src/main/integrations/child-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ export class ChildProcess implements Integration {
public static id: string = 'ChildProcess';

/** @inheritDoc */
public name: string = ChildProcess.id;
public readonly name: string;

private readonly _options: ChildProcessOptions;

/**
* @param _options Integration options
*/
public constructor(options: Partial<OrBool<ChildProcessOptions>> = {}) {
this.name = ChildProcess.id;
const { breadcrumbs, events } = options;
this._options = {
breadcrumbs: Array.isArray(breadcrumbs) ? breadcrumbs : breadcrumbs == false ? [] : DEFAULT_OPTIONS.breadcrumbs,
Expand Down
3 changes: 2 additions & 1 deletion src/main/integrations/electron-breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ export class ElectronBreadcrumbs implements Integration {
public static id: string = 'ElectronBreadcrumbs';

/** @inheritDoc */
public name: string = ElectronBreadcrumbs.id;
public readonly name: string;

private readonly _options: ElectronBreadcrumbsOptions<EventFunction | false>;

/**
* @param _options Integration options
*/
public constructor(options: Partial<ElectronBreadcrumbsOptions<EventTypes>> = {}) {
this.name = ElectronBreadcrumbs.id;
this._options = { ...DEFAULT_OPTIONS, ...normalizeOptions(options) };
}

Expand Down
9 changes: 7 additions & 2 deletions src/main/integrations/electron-minidump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@ export class ElectronMinidump implements Integration {
public static id: string = 'ElectronMinidump';

/** @inheritDoc */
public name: string = ElectronMinidump.id;
public readonly name: string;

/** Counter used to ensure no race condition when updating extra params */
private _updateEpoch: number = 0;
private _updateEpoch: number;

private _customRelease: string | undefined;

public constructor() {
this.name = ElectronMinidump.id;
this._updateEpoch = 0;
}

/** @inheritDoc */
public setupOnce(): void {
// Mac AppStore builds cannot run the crash reporter due to the sandboxing
Expand Down
6 changes: 5 additions & 1 deletion src/main/integrations/main-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ export class MainContext implements Integration {
public static id: string = 'MainContext';

/** @inheritDoc */
public name: string = MainContext.id;
public readonly name: string;

public constructor() {
this.name = MainContext.id;
}

/** @inheritDoc */
public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {
Expand Down
6 changes: 4 additions & 2 deletions src/main/integrations/main-process-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export class MainProcessSession implements Integration {
public static id: string = 'MainProcessSession';

/** @inheritDoc */
public name: string = MainProcessSession.id;
public readonly name: string;

public constructor(private readonly _options: Options = {}) {}
public constructor(private readonly _options: Options = {}) {
this.name = MainProcessSession.id;
}

/** @inheritDoc */
public setupOnce(): void {
Expand Down
6 changes: 4 additions & 2 deletions src/main/integrations/net-breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ export class Net implements Integration {
public static id: string = 'Net';

/** @inheritDoc */
public name: string = Net.id;
public readonly name: string;

/** @inheritDoc */
public constructor(private readonly _options: NetOptions = {}) {}
public constructor(private readonly _options: NetOptions = {}) {
this.name = Net.id;
}

/** @inheritDoc */
public setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {
Expand Down
6 changes: 5 additions & 1 deletion src/main/integrations/onuncaughtexception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export class OnUncaughtException implements Integration {
public static id: string = 'OnUncaughtException';

/** @inheritDoc */
public name: string = OnUncaughtException.id;
public readonly name: string;

public constructor() {
this.name = OnUncaughtException.id;
}

/**
* @inheritDoc
Expand Down
6 changes: 5 additions & 1 deletion src/main/integrations/preload-injection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export class PreloadInjection implements Integration {
public static id: string = 'PreloadInjection';

/** @inheritDoc */
public name: string = PreloadInjection.id;
public readonly name: string;

public constructor() {
this.name = PreloadInjection.id;
}

/** @inheritDoc */
public setupOnce(): void {
Expand Down
6 changes: 5 additions & 1 deletion src/main/integrations/screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ export class Screenshots implements Integration {
public static id: string = 'Screenshots';

/** @inheritDoc */
public name: string = Screenshots.id;
public readonly name: string;

public constructor() {
this.name = Screenshots.id;
}

/** @inheritDoc */
public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {
Expand Down
6 changes: 5 additions & 1 deletion src/main/integrations/sentry-minidump/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class SentryMinidump implements Integration {
public static id: string = 'SentryMinidump';

/** @inheritDoc */
public name: string = SentryMinidump.id;
public readonly name: string;

/** Store to persist context information beyond application crashes. */
private _scopeStore?: BufferedWriteStore<PreviousRun>;
Expand All @@ -35,6 +35,10 @@ export class SentryMinidump implements Integration {

private _minidumpLoader?: MinidumpLoader;

public constructor() {
this.name = SentryMinidump.id;
}

/** @inheritDoc */
public setupOnce(): void {
// Mac AppStore builds cannot run the crash reporter due to the sandboxing
Expand Down
3 changes: 2 additions & 1 deletion src/main/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Store<T> {
/** Value used to initialize data for the first time. */
private readonly _initial: T;
/** A mutex to ensure that there aren't races while reading and writing files */
private _lock: Mutex = new Mutex();
private readonly _lock: Mutex;

/**
* Creates a new store.
Expand All @@ -37,6 +37,7 @@ export class Store<T> {
* @param initial An initial value to initialize data with.
*/
public constructor(path: string, id: string, initial: T) {
this._lock = new Mutex();
this._path = join(path, `${id}.json`);
this._initial = initial;
}
Expand Down
10 changes: 4 additions & 6 deletions src/main/transports/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ export interface QueuedTransportRequest extends TransportRequest {

/** A request queue that is persisted to disk to survive app restarts */
export class PersistedRequestQueue {
private readonly _queue: BufferedWriteStore<PersistedRequest[]> = new BufferedWriteStore(
this._queuePath,
'queue',
[],
);
private readonly _queue: BufferedWriteStore<PersistedRequest[]>;

public constructor(
private readonly _queuePath: string,
private readonly _maxAgeDays: number = 30,
private readonly _maxCount: number = 30,
) {}
) {
this._queue = new BufferedWriteStore(this._queuePath, 'queue', []);
}

/** Adds a request to the queue */
public async add(request: QueuedTransportRequest): Promise<number> {
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/integrations/event-to-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ export class EventToMain implements Integration {
public static id: string = 'EventToMain';

/** @inheritDoc */
public name: string = EventToMain.id;
public readonly name: string;

public constructor() {
this.name = EventToMain.id;
}

/** @inheritDoc */
public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/integrations/scope-to-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ export class ScopeToMain implements Integration {
public static id: string = 'ScopeToMain';

/** @inheritDoc */
public name: string = ScopeToMain.id;
public readonly name: string;

public constructor() {
this.name = ScopeToMain.id;
}

/** @inheritDoc */
public setupOnce(): void {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const defaultIntegrations = [...defaultBrowserIntegrations, new ScopeToMa
export function init<O extends BrowserOptions>(
options: BrowserOptions & O = {} as BrowserOptions & O,
// This parameter name ensures that TypeScript error messages contain a hint for fixing SDK version mismatches
originalInit: (if_you_get_a_typescript_error_ensure_sdks_use_version_v7_61_0: O) => void = browserInit,
originalInit: (if_you_get_a_typescript_error_ensure_sdks_use_version_v7_63_0: O) => void = browserInit,
): void {
ensureProcess('renderer');

Expand Down
Loading

0 comments on commit f5c0a7d

Please sign in to comment.