Skip to content

Commit 5a0401f

Browse files
committed
Remove problematic Sentry integration
1 parent aca1768 commit 5a0401f

File tree

7 files changed

+12
-91
lines changed

7 files changed

+12
-91
lines changed

README.md

-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
- [Node](#node-1)
4747
- [Browser](#browser)
4848
- [Error event](#error-event)
49-
- [Sentry Integration](#sentry-integration)
5049
- [Versioning](#versioning)
5150
- [Contributing](#contributing)
5251

@@ -232,10 +231,6 @@ Error contains details field with responseBody, responseHeaders, code (only when
232231

233232
Upload abort throws an `FilestackError` with type `FilestackErrorType.ABORTED`
234233

235-
## Sentry Integration
236-
237-
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).
238-
239234
## Versioning
240235

241236
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.

manual_tests/upload_new.ts

-2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717

1818
// import { Client } from './../src/lib/client';
1919
// import * as Path from 'path';
20-
// import * as Sentry from '@sentry/node';
2120

2221
import { S3Uploader } from './../src/lib/api/upload/uploaders/s3';
2322
import { getFile } from '../src/lib/api/upload';
2423

2524
const createFile = (size = 10 * 1024 * 1024) => Buffer.alloc(size).fill('a');
26-
// Sentry.init({ dsn: 'DSN' });
2725

2826
// const fs = new Client(process.env.API_KEY);
2927
// fs.on('upload.error', (e) => {

package-lock.json

+2-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
"lodash.clonedeep": "^4.5.0",
5454
"p-queue": "^4.0.0",
5555
"spark-md5": "^3.0.0",
56-
"ts-node": "^8.10.2",
57-
"@sentry/minimal": "^6.2.1"
56+
"ts-node": "^8.10.2"
5857
},
5958
"devDependencies": {
6059
"@babel/core": "^7.8.4",

src/lib/client.ts

+9-39
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717

1818
import { EventEmitter } from 'eventemitter3';
19-
import * as Sentry from '@sentry/minimal';
2019
import { config, Hosts } from '../config';
2120
import { FilestackError } from './../filestack_error';
2221
import { metadata, MetadataOptions, remove, retrieve, RetrieveOptions, download } from './api/file';
@@ -32,9 +31,6 @@ import { StoreParams } from './filelink';
3231

3332
import { picker, PickerInstance, PickerOptions } from './picker';
3433

35-
/* istanbul ignore next */
36-
Sentry.addBreadcrumb({ category: 'sdk', message: 'filestack-js-sdk scope' });
37-
3834
export interface Session {
3935
apikey: string;
4036
urls: Hosts;
@@ -70,12 +66,6 @@ export interface ClientOptions {
7066
* Please be aware that tokens stored in localStorage are accessible by other scripts on the same domain.
7167
*/
7268
sessionCache?: boolean;
73-
74-
/**
75-
* Enable forwarding error logs to sentry
76-
* @default false
77-
*/
78-
forwardErrors?: boolean;
7969
}
8070

8171
/**
@@ -99,8 +89,6 @@ export class Client extends EventEmitter {
9989
private cloud: CloudClient;
10090
private prefetchInstance: Prefetch;
10191

102-
private forwardErrors: boolean = true;
103-
10492
/**
10593
* Returns filestack utils
10694
*
@@ -114,11 +102,6 @@ export class Client extends EventEmitter {
114102
constructor(apikey: string, private options?: ClientOptions) {
115103
super();
116104

117-
/* istanbul ignore if */
118-
if (options && options.forwardErrors) {
119-
this.forwardErrors = options.forwardErrors;
120-
}
121-
122105
if (!apikey || typeof apikey !== 'string' || apikey.length === 0) {
123106
throw new Error('An apikey is required to initialize the Filestack client');
124107
}
@@ -305,7 +288,15 @@ export class Client extends EventEmitter {
305288
* @param headers Optional headers to send
306289
* @param workflowIds Optional workflowIds to send
307290
*/
308-
storeURL(url: string, storeParams?: StoreParams, token?: any, security?: Security, uploadTags?: UploadTags, headers?: {[key: string]: string}, workflowIds?: string[]): Promise<Object> {
291+
storeURL(
292+
url: string,
293+
storeParams?: StoreParams,
294+
token?: any,
295+
security?: Security,
296+
uploadTags?: UploadTags,
297+
headers?: { [key: string]: string },
298+
workflowIds?: string[],
299+
): Promise<Object> {
309300
return storeURL({
310301
session: this.session,
311302
url,
@@ -460,18 +451,6 @@ export class Client extends EventEmitter {
460451
upload.on('start', () => this.emit('upload.start'));
461452
/* istanbul ignore next */
462453
upload.on('error', e => {
463-
if (this.forwardErrors) {
464-
Sentry.withScope(scope => {
465-
scope.setTag('filestack-apikey', this.session.apikey);
466-
scope.setTag('filestack-version', Utils.getVersion());
467-
scope.setExtra('filestack-options', this.options);
468-
scope.setExtras({ uploadOptions: options, storeOptions, details: e.details });
469-
e.message = `FS-${e.message}`;
470-
471-
Sentry.captureException(e);
472-
});
473-
}
474-
475454
this.emit('upload.error', e);
476455
});
477456

@@ -526,15 +505,6 @@ export class Client extends EventEmitter {
526505
upload.on('start', () => this.emit('upload.start'));
527506
/* istanbul ignore next */
528507
upload.on('error', e => {
529-
Sentry.withScope(scope => {
530-
scope.setTag('filestack-apikey', this.session.apikey);
531-
scope.setTag('filestack-version', Utils.getVersion());
532-
scope.setExtra('filestack-options', this.options);
533-
scope.setExtras(e.details);
534-
scope.setExtras({ uploadOptions: options, storeOptions });
535-
Sentry.captureException(e);
536-
});
537-
538508
this.emit('upload.error', e);
539509
});
540510

src/lib/picker.ts

-5
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,6 @@ export interface PickerOptions {
687687
* Sets the resolution of recorded video. One of "320x240", "640x480" or "1280x720". Default is `"640x480"`.
688688
*/
689689
videoResolution?: string;
690-
/**
691-
* Use Sentry Breadcrumbs mechanism to log information about occured errors.
692-
* It can override global objects like console, error etc. Defaults to `true`.
693-
*/
694-
useSentryBreadcrumbs?: boolean;
695690
/**
696691
* Specify which Picker instance should respond to paste event.
697692
* By default only hovered instance responds to event.

src/schema/picker.schema.ts

-3
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,6 @@ export const PickerParamsSchema = {
428428
},
429429
},
430430
},
431-
useSentryBreadcrumbs: {
432-
type: 'boolean',
433-
},
434431
pasteMode: {
435432
type: 'object',
436433
additionalProperties: false,

0 commit comments

Comments
 (0)