diff --git a/README.md b/README.md index 015f7dd9..2f0f8f79 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,6 @@ - [Node](#node-1) - [Browser](#browser) - [Error event](#error-event) -- [Sentry Integration](#sentry-integration) - [Versioning](#versioning) - [Contributing](#contributing) @@ -232,10 +231,6 @@ Error contains details field with responseBody, responseHeaders, code (only when Upload abort throws an `FilestackError` with type `FilestackErrorType.ABORTED` -## Sentry Integration - -If you're using [Sentry](https://sentry.io/welcome/) to monitor your application, Filestack will automatically report upload errors to Sentry, and tag them with helpful diagnostic information via [`@sentry/minimal`](https://github.com/getsentry/sentry-javascript/tree/master/packages/minimal). - ## Versioning We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags](https://github.com/filestack/filestack-js/tags) on this repository. diff --git a/manual_tests/upload_new.ts b/manual_tests/upload_new.ts index a5b8a43e..bd6877ce 100644 --- a/manual_tests/upload_new.ts +++ b/manual_tests/upload_new.ts @@ -17,13 +17,11 @@ // import { Client } from './../src/lib/client'; // import * as Path from 'path'; -// import * as Sentry from '@sentry/node'; import { S3Uploader } from './../src/lib/api/upload/uploaders/s3'; import { getFile } from '../src/lib/api/upload'; const createFile = (size = 10 * 1024 * 1024) => Buffer.alloc(size).fill('a'); -// Sentry.init({ dsn: 'DSN' }); // const fs = new Client(process.env.API_KEY); // fs.on('upload.error', (e) => { diff --git a/package-lock.json b/package-lock.json index 6f9dc78e..dc8652b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1750,40 +1750,6 @@ "webpack-sources": "^1.0.0" } }, - "@sentry/hub": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.2.1.tgz", - "integrity": "sha512-pG7wCQeRpzeP6t0bT4T0X029R19dbDS3/qswF8BL6bg0AI3afjfjBAZm/fqn1Uwe/uBoMHVVdbxgJDZeQ5d4rQ==", - "requires": { - "@sentry/types": "6.2.1", - "@sentry/utils": "6.2.1", - "tslib": "^1.9.3" - } - }, - "@sentry/minimal": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.2.1.tgz", - "integrity": "sha512-wuSXB4Ayxv9rBEQ4pm7fnG4UU2ZPtPnnChoEfd4/mw1UthXSvmPFEn6O4pdo2G8fTkl8eqm6wT/Q7uIXMEmw+A==", - "requires": { - "@sentry/hub": "6.2.1", - "@sentry/types": "6.2.1", - "tslib": "^1.9.3" - } - }, - "@sentry/types": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.2.1.tgz", - "integrity": "sha512-h0OV1QT+fv5ojfK5/+iEXClu33HirmvbjcQC2jf05IHj9yXIOWy6EB10S8nBjuLiiFqQiAQYj3FN9Ip4eN8NJA==" - }, - "@sentry/utils": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.2.1.tgz", - "integrity": "sha512-6kQgM/yBPdXu+3qbJnI6HBcWztN9QfiMkH++ZiKk4ERhg9d2LYWlze478uTU5Fyo/JQYcp+McpjtjpR9QIrr0g==", - "requires": { - "@sentry/types": "6.2.1", - "tslib": "^1.9.3" - } - }, "@sindresorhus/df": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@sindresorhus/df/-/df-2.1.0.tgz", @@ -17769,7 +17735,8 @@ "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true }, "tslint": { "version": "6.0.0", diff --git a/package.json b/package.json index de201d67..6b21e704 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,7 @@ "lodash.clonedeep": "^4.5.0", "p-queue": "^4.0.0", "spark-md5": "^3.0.0", - "ts-node": "^8.10.2", - "@sentry/minimal": "^6.2.1" + "ts-node": "^8.10.2" }, "devDependencies": { "@babel/core": "^7.8.4", diff --git a/src/lib/client.ts b/src/lib/client.ts index d0ae40da..c16d5561 100644 --- a/src/lib/client.ts +++ b/src/lib/client.ts @@ -16,7 +16,6 @@ */ import { EventEmitter } from 'eventemitter3'; -import * as Sentry from '@sentry/minimal'; import { config, Hosts } from '../config'; import { FilestackError } from './../filestack_error'; import { metadata, MetadataOptions, remove, retrieve, RetrieveOptions, download } from './api/file'; @@ -32,9 +31,6 @@ import { StoreParams } from './filelink'; import { picker, PickerInstance, PickerOptions } from './picker'; -/* istanbul ignore next */ -Sentry.addBreadcrumb({ category: 'sdk', message: 'filestack-js-sdk scope' }); - export interface Session { apikey: string; urls: Hosts; @@ -70,12 +66,6 @@ export interface ClientOptions { * Please be aware that tokens stored in localStorage are accessible by other scripts on the same domain. */ sessionCache?: boolean; - - /** - * Enable forwarding error logs to sentry - * @default false - */ - forwardErrors?: boolean; } /** @@ -99,8 +89,6 @@ export class Client extends EventEmitter { private cloud: CloudClient; private prefetchInstance: Prefetch; - private forwardErrors: boolean = true; - /** * Returns filestack utils * @@ -114,11 +102,6 @@ export class Client extends EventEmitter { constructor(apikey: string, private options?: ClientOptions) { super(); - /* istanbul ignore if */ - if (options && options.forwardErrors) { - this.forwardErrors = options.forwardErrors; - } - if (!apikey || typeof apikey !== 'string' || apikey.length === 0) { throw new Error('An apikey is required to initialize the Filestack client'); } @@ -305,7 +288,15 @@ export class Client extends EventEmitter { * @param headers Optional headers to send * @param workflowIds Optional workflowIds to send */ - storeURL(url: string, storeParams?: StoreParams, token?: any, security?: Security, uploadTags?: UploadTags, headers?: {[key: string]: string}, workflowIds?: string[]): Promise { + storeURL( + url: string, + storeParams?: StoreParams, + token?: any, + security?: Security, + uploadTags?: UploadTags, + headers?: { [key: string]: string }, + workflowIds?: string[], + ): Promise { return storeURL({ session: this.session, url, @@ -460,18 +451,6 @@ export class Client extends EventEmitter { upload.on('start', () => this.emit('upload.start')); /* istanbul ignore next */ upload.on('error', e => { - if (this.forwardErrors) { - Sentry.withScope(scope => { - scope.setTag('filestack-apikey', this.session.apikey); - scope.setTag('filestack-version', Utils.getVersion()); - scope.setExtra('filestack-options', this.options); - scope.setExtras({ uploadOptions: options, storeOptions, details: e.details }); - e.message = `FS-${e.message}`; - - Sentry.captureException(e); - }); - } - this.emit('upload.error', e); }); @@ -526,15 +505,6 @@ export class Client extends EventEmitter { upload.on('start', () => this.emit('upload.start')); /* istanbul ignore next */ upload.on('error', e => { - Sentry.withScope(scope => { - scope.setTag('filestack-apikey', this.session.apikey); - scope.setTag('filestack-version', Utils.getVersion()); - scope.setExtra('filestack-options', this.options); - scope.setExtras(e.details); - scope.setExtras({ uploadOptions: options, storeOptions }); - Sentry.captureException(e); - }); - this.emit('upload.error', e); }); diff --git a/src/lib/picker.ts b/src/lib/picker.ts index 42960731..ccd95542 100644 --- a/src/lib/picker.ts +++ b/src/lib/picker.ts @@ -687,11 +687,6 @@ export interface PickerOptions { * Sets the resolution of recorded video. One of "320x240", "640x480" or "1280x720". Default is `"640x480"`. */ videoResolution?: string; - /** - * Use Sentry Breadcrumbs mechanism to log information about occured errors. - * It can override global objects like console, error etc. Defaults to `true`. - */ - useSentryBreadcrumbs?: boolean; /** * Specify which Picker instance should respond to paste event. * By default only hovered instance responds to event. diff --git a/src/schema/picker.schema.ts b/src/schema/picker.schema.ts index d37225c8..925a6e40 100644 --- a/src/schema/picker.schema.ts +++ b/src/schema/picker.schema.ts @@ -428,9 +428,6 @@ export const PickerParamsSchema = { }, }, }, - useSentryBreadcrumbs: { - type: 'boolean', - }, pasteMode: { type: 'object', additionalProperties: false,