@sentry/react-native 5.0.0-alpha.2 → 5.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -4
- package/RNSentry.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/sentry/react/RNSentryModule.java +9 -12
- package/dist/js/client.d.ts +5 -1
- package/dist/js/client.d.ts.map +1 -1
- package/dist/js/client.js +17 -0
- package/dist/js/client.js.map +1 -1
- package/dist/js/definitions.d.ts +2 -4
- package/dist/js/definitions.d.ts.map +1 -1
- package/dist/js/definitions.js.map +1 -1
- package/dist/js/index.d.ts +2 -2
- package/dist/js/index.d.ts.map +1 -1
- package/dist/js/index.js +1 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.d.ts.map +1 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js +3 -1
- package/dist/js/integrations/reactnativeerrorhandlers.js.map +1 -1
- package/dist/js/integrations/sdkinfo.d.ts +4 -1
- package/dist/js/integrations/sdkinfo.d.ts.map +1 -1
- package/dist/js/integrations/sdkinfo.js +14 -7
- package/dist/js/integrations/sdkinfo.js.map +1 -1
- package/dist/js/misc.d.ts +9 -0
- package/dist/js/misc.d.ts.map +1 -0
- package/dist/js/misc.js +17 -0
- package/dist/js/misc.js.map +1 -0
- package/dist/js/options.d.ts +27 -6
- package/dist/js/options.d.ts.map +1 -1
- package/dist/js/options.js.map +1 -1
- package/dist/js/scope.d.ts +9 -1
- package/dist/js/scope.d.ts.map +1 -1
- package/dist/js/scope.js +12 -0
- package/dist/js/scope.js.map +1 -1
- package/dist/js/sdk.d.ts +5 -0
- package/dist/js/sdk.d.ts.map +1 -1
- package/dist/js/sdk.js +30 -18
- package/dist/js/sdk.js.map +1 -1
- package/dist/js/tracing/reactnativenavigation.d.ts +2 -0
- package/dist/js/tracing/reactnativenavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnativenavigation.js +20 -12
- package/dist/js/tracing/reactnativenavigation.js.map +1 -1
- package/dist/js/tracing/reactnativetracing.d.ts +14 -5
- package/dist/js/tracing/reactnativetracing.d.ts.map +1 -1
- package/dist/js/tracing/reactnativetracing.js +10 -7
- package/dist/js/tracing/reactnativetracing.js.map +1 -1
- package/dist/js/tracing/reactnavigation.d.ts +2 -0
- package/dist/js/tracing/reactnavigation.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigation.js +25 -17
- package/dist/js/tracing/reactnavigation.js.map +1 -1
- package/dist/js/tracing/reactnavigationv4.d.ts +4 -8
- package/dist/js/tracing/reactnavigationv4.d.ts.map +1 -1
- package/dist/js/tracing/reactnavigationv4.js +23 -11
- package/dist/js/tracing/reactnavigationv4.js.map +1 -1
- package/dist/js/tracing/utils.d.ts +4 -3
- package/dist/js/tracing/utils.d.ts.map +1 -1
- package/dist/js/tracing/utils.js +7 -10
- package/dist/js/tracing/utils.js.map +1 -1
- package/dist/js/transports/TextEncoder.d.ts +3 -0
- package/dist/js/transports/TextEncoder.d.ts.map +1 -0
- package/dist/js/transports/TextEncoder.js +12 -0
- package/dist/js/transports/TextEncoder.js.map +1 -0
- package/dist/js/utils/envelope.d.ts +10 -0
- package/dist/js/utils/envelope.d.ts.map +1 -0
- package/dist/js/utils/envelope.js +20 -0
- package/dist/js/utils/envelope.js.map +1 -0
- package/dist/js/vendor/buffer/index.d.ts +2 -0
- package/dist/js/vendor/buffer/index.d.ts.map +1 -0
- package/dist/js/vendor/buffer/index.js +2 -0
- package/dist/js/vendor/buffer/index.js.map +1 -0
- package/dist/js/vendor/buffer/utf8ToBytes.d.ts +10 -0
- package/dist/js/vendor/buffer/utf8ToBytes.d.ts.map +1 -0
- package/dist/js/vendor/buffer/utf8ToBytes.js +82 -0
- package/dist/js/vendor/buffer/utf8ToBytes.js.map +1 -0
- package/dist/js/vendor/index.d.ts +2 -0
- package/dist/js/vendor/index.d.ts.map +1 -0
- package/dist/js/vendor/index.js +2 -0
- package/dist/js/vendor/index.js.map +1 -0
- package/dist/js/version.d.ts +2 -1
- package/dist/js/version.d.ts.map +1 -1
- package/dist/js/version.js +2 -1
- package/dist/js/version.js.map +1 -1
- package/dist/js/wrapper.d.ts +3 -2
- package/dist/js/wrapper.d.ts.map +1 -1
- package/dist/js/wrapper.js +62 -57
- package/dist/js/wrapper.js.map +1 -1
- package/ios/RNSentry.m +22 -35
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,90 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 5.0.0-alpha.
|
|
3
|
+
## 5.0.0-alpha.4
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Latest changes from 4.5.0
|
|
6
|
+
|
|
7
|
+
### Breaking changes
|
|
8
|
+
|
|
9
|
+
- New ReactNativeTracingOptions idleTimeoutMs and finalTimeoutMs replacing idleTimeout and maxTransactionDuration respectively ([#2481](https://github.com/getsentry/sentry-react-native/pull/2481))
|
|
10
|
+
|
|
11
|
+
## 4.5.0
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- Add user feedback ([#2486](https://github.com/getsentry/sentry-react-native/pull/2486))
|
|
16
|
+
- Add typings for app hang functionality ([#2479](https://github.com/getsentry/sentry-react-native/pull/2479))
|
|
17
|
+
|
|
18
|
+
### Fixes
|
|
19
|
+
|
|
20
|
+
- Update warm/cold start span ops ([#2487](https://github.com/getsentry/sentry-react-native/pull/2487))
|
|
21
|
+
- Detect hard crash the same as native sdks ([#2480](https://github.com/getsentry/sentry-react-native/pull/2480))
|
|
22
|
+
- Integrations factory receives default integrations ([#2494](https://github.com/getsentry/sentry-react-native/pull/2494))
|
|
23
|
+
|
|
24
|
+
### Dependencies
|
|
25
|
+
|
|
26
|
+
- Bump Android SDK from v6.4.1 to v6.4.2 ([#2485](https://github.com/getsentry/sentry-react-native/pull/2485))
|
|
27
|
+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#642)
|
|
28
|
+
- [diff](https://github.com/getsentry/sentry-java/compare/6.4.1...6.4.2)
|
|
29
|
+
- Bump JavaScript SDK from v7.12.1 to v7.13.0 ([#2478](https://github.com/getsentry/sentry-react-native/pull/2478))
|
|
30
|
+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7130)
|
|
31
|
+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.12.1...7.13.0)
|
|
32
|
+
|
|
33
|
+
## 4.4.0
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
- Add attachments support ([#2463](https://github.com/getsentry/sentry-react-native/pull/2463))
|
|
38
|
+
|
|
39
|
+
## 4.3.1
|
|
40
|
+
|
|
41
|
+
### Fixes
|
|
42
|
+
|
|
43
|
+
- ReactNativeTracingOptions maxTransactionDuration is in seconds ([#2469](https://github.com/getsentry/sentry-react-native/pull/2469))
|
|
44
|
+
|
|
45
|
+
### Dependencies
|
|
46
|
+
|
|
47
|
+
- Bump Cocoa SDK from v7.24.1 to v7.25.1 ([#2465](https://github.com/getsentry/sentry-react-native/pull/2465))
|
|
48
|
+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/master/CHANGELOG.md#7251)
|
|
49
|
+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/7.24.1...7.25.1)
|
|
50
|
+
|
|
51
|
+
## 5.0.0-alpha.3
|
|
52
|
+
|
|
53
|
+
- Latest changes from 4.3.x
|
|
54
|
+
|
|
55
|
+
### Dependencies
|
|
56
|
+
|
|
57
|
+
- Bump Wizard from v2.0.0 to v2.2.0 ([#2460](https://github.com/getsentry/sentry-react-native/pull/2460))
|
|
58
|
+
- [changelog](https://github.com/getsentry/sentry-wizard/blob/master/CHANGELOG.md#v220)
|
|
59
|
+
- [diff](https://github.com/getsentry/sentry-wizard/compare/v2.0.0...v2.2.0)
|
|
60
|
+
|
|
61
|
+
## 4.3.0
|
|
62
|
+
|
|
63
|
+
### Features
|
|
64
|
+
|
|
65
|
+
- Add Transaction Source for Dynamic Sampling Context ([#2454](https://github.com/getsentry/sentry-react-native/pull/2454))
|
|
66
|
+
|
|
67
|
+
### Dependencies
|
|
68
|
+
|
|
69
|
+
- Bump Cocoa SDK from v7.23.0 to v7.24.1 ([#2456](https://github.com/getsentry/sentry-react-native/pull/2456))
|
|
70
|
+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/master/CHANGELOG.md#7241)
|
|
71
|
+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/7.23.0...7.24.1)
|
|
72
|
+
- Bump Android SDK from v6.3.1 to v6.4.1 ([#2437](https://github.com/getsentry/sentry-react-native/pull/2437))
|
|
73
|
+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#641)
|
|
74
|
+
- [diff](https://github.com/getsentry/sentry-java/compare/6.3.1...6.4.1)
|
|
75
|
+
- Bump JavaScript SDK from v7.9.0 to v7.12.1 ([#2451](https://github.com/getsentry/sentry-react-native/pull/2451))
|
|
76
|
+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7121)
|
|
77
|
+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.9.0...7.12.1)
|
|
78
|
+
|
|
79
|
+
## 4.2.4
|
|
80
|
+
|
|
81
|
+
### Fixes
|
|
82
|
+
|
|
83
|
+
- ReactNativeTracing wrongly marks transactions as deadline_exceeded when it reaches the idleTimeout ([#2427](https://github.com/getsentry/sentry-react-native/pull/2427))
|
|
84
|
+
|
|
85
|
+
## 5.0.0-alpha.2
|
|
6
86
|
|
|
7
|
-
-
|
|
8
|
-
- Fix: Auto linking for RN >= 0.69 (#2332) by @marandaneto
|
|
87
|
+
- Latest changes from 4.2.x
|
|
9
88
|
|
|
10
89
|
## 5.0.0-alpha.1
|
|
11
90
|
|
package/RNSentry.podspec
CHANGED
package/android/build.gradle
CHANGED
|
@@ -14,6 +14,7 @@ import com.facebook.react.bridge.Promise;
|
|
|
14
14
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
15
15
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
16
16
|
import com.facebook.react.bridge.ReactMethod;
|
|
17
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
17
18
|
import com.facebook.react.bridge.ReadableMap;
|
|
18
19
|
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
19
20
|
import com.facebook.react.bridge.WritableMap;
|
|
@@ -292,7 +293,12 @@ public class RNSentryModule extends ReactContextBaseJavaModule {
|
|
|
292
293
|
}
|
|
293
294
|
|
|
294
295
|
@ReactMethod
|
|
295
|
-
public void captureEnvelope(
|
|
296
|
+
public void captureEnvelope(ReadableArray rawBytes, ReadableMap options, Promise promise) {
|
|
297
|
+
byte bytes[] = new byte[rawBytes.size()];
|
|
298
|
+
for (int i = 0; i < rawBytes.size(); i++) {
|
|
299
|
+
bytes[i] = (byte) rawBytes.getInt(i);
|
|
300
|
+
}
|
|
301
|
+
|
|
296
302
|
try {
|
|
297
303
|
final String outboxPath = HubAdapter.getInstance().getOptions().getOutboxPath();
|
|
298
304
|
|
|
@@ -302,24 +308,15 @@ public class RNSentryModule extends ReactContextBaseJavaModule {
|
|
|
302
308
|
} else {
|
|
303
309
|
File installation = new File(outboxPath, UUID.randomUUID().toString());
|
|
304
310
|
try (FileOutputStream out = new FileOutputStream(installation)) {
|
|
305
|
-
out.write(
|
|
311
|
+
out.write(bytes);
|
|
306
312
|
}
|
|
307
313
|
}
|
|
308
314
|
} catch (Throwable ignored) {
|
|
309
|
-
logger.severe("Error
|
|
315
|
+
logger.severe("Error while writing envelope to outbox.");
|
|
310
316
|
}
|
|
311
317
|
promise.resolve(true);
|
|
312
318
|
}
|
|
313
319
|
|
|
314
|
-
@ReactMethod
|
|
315
|
-
public void getStringBytesLength(String payload, Promise promise) {
|
|
316
|
-
try {
|
|
317
|
-
promise.resolve(payload.getBytes("UTF-8").length);
|
|
318
|
-
} catch (UnsupportedEncodingException e) {
|
|
319
|
-
promise.reject(e);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
320
|
private static PackageInfo getPackageInfo(Context ctx) {
|
|
324
321
|
try {
|
|
325
322
|
return ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
|
package/dist/js/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from '@sentry/core';
|
|
2
|
-
import { Event, EventHint, SeverityLevel } from '@sentry/types';
|
|
2
|
+
import { Event, EventHint, SeverityLevel, UserFeedback } from '@sentry/types';
|
|
3
3
|
import { ReactNativeClientOptions } from './options';
|
|
4
4
|
/**
|
|
5
5
|
* The Sentry React Native SDK Client.
|
|
@@ -31,6 +31,10 @@ export declare class ReactNativeClient extends BaseClient<ReactNativeClientOptio
|
|
|
31
31
|
* @inheritDoc
|
|
32
32
|
*/
|
|
33
33
|
close(): PromiseLike<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Sends user feedback to Sentry.
|
|
36
|
+
*/
|
|
37
|
+
captureUserFeedback(feedback: UserFeedback): void;
|
|
34
38
|
/**
|
|
35
39
|
* Starts native client with dsn and options
|
|
36
40
|
*/
|
package/dist/js/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,KAAK,EACL,SAAS,EACT,aAAa,EAEb,YAAY,EACb,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAKrD;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IAEzE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAE/C;;;OAGG;gBACiB,OAAO,EAAE,wBAAwB;IAoCrD;;OAEG;IACI,kBAAkB,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAIrF;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAIxG;;;OAGG;IACI,WAAW,IAAI,IAAI;IAI1B;;OAEG;IACI,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAOpC;;OAEG;IACI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAYxD;;KAEC;YACa,cAAc;IAe5B;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAQjC"}
|
package/dist/js/client.js
CHANGED
|
@@ -3,7 +3,9 @@ import { BrowserClient, defaultStackParser, makeFetchTransport } from '@sentry/b
|
|
|
3
3
|
import { BaseClient } from '@sentry/core';
|
|
4
4
|
// @ts-ignore LogBox introduced in RN 0.63
|
|
5
5
|
import { Alert, LogBox, YellowBox } from 'react-native';
|
|
6
|
+
import { defaultSdkInfo } from './integrations/sdkinfo';
|
|
6
7
|
import { NativeTransport } from './transports/native';
|
|
8
|
+
import { createUserFeedbackEnvelope } from './utils/envelope';
|
|
7
9
|
import { NATIVE } from './wrapper';
|
|
8
10
|
/**
|
|
9
11
|
* The Sentry React Native SDK Client.
|
|
@@ -25,6 +27,8 @@ export class ReactNativeClient extends BaseClient {
|
|
|
25
27
|
return makeFetchTransport(options, nativeFetch);
|
|
26
28
|
};
|
|
27
29
|
}
|
|
30
|
+
options._metadata = options._metadata || {};
|
|
31
|
+
options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;
|
|
28
32
|
super(options);
|
|
29
33
|
// This is a workaround for now using fetch on RN, this is a known issue in react-native and only generates a warning
|
|
30
34
|
// YellowBox deprecated and replaced with with LogBox in RN 0.63
|
|
@@ -39,8 +43,10 @@ export class ReactNativeClient extends BaseClient {
|
|
|
39
43
|
this._browserClient = new BrowserClient({
|
|
40
44
|
dsn: options.dsn,
|
|
41
45
|
transport: options.transport,
|
|
46
|
+
transportOptions: options.transportOptions,
|
|
42
47
|
stackParser: options.stackParser || defaultStackParser,
|
|
43
48
|
integrations: [],
|
|
49
|
+
_metadata: options._metadata,
|
|
44
50
|
});
|
|
45
51
|
void this._initNativeSdk();
|
|
46
52
|
}
|
|
@@ -72,6 +78,17 @@ export class ReactNativeClient extends BaseClient {
|
|
|
72
78
|
return NATIVE.closeNativeSdk().then(() => result);
|
|
73
79
|
});
|
|
74
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Sends user feedback to Sentry.
|
|
83
|
+
*/
|
|
84
|
+
captureUserFeedback(feedback) {
|
|
85
|
+
const envelope = createUserFeedbackEnvelope(feedback, {
|
|
86
|
+
metadata: this._options._metadata,
|
|
87
|
+
dsn: this.getDsn(),
|
|
88
|
+
tunnel: this._options.tunnel,
|
|
89
|
+
});
|
|
90
|
+
this._sendEnvelope(envelope);
|
|
91
|
+
}
|
|
75
92
|
/**
|
|
76
93
|
* Starts native client with dsn and options
|
|
77
94
|
*/
|
package/dist/js/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/js/client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGxF,OAAO,EAAE,UAAU,E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C;YAE9B,IAAI;gBACF,iBAAiB,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC/D;YAAC,OAAO,CAAC,EAAE;gBACV,IAAI,CAAC,wBAAwB,EAAE,CAAC;gBAEhC,MAAA,MAAA,IAAI,CAAC,QAAQ,EAAC,OAAO,mDAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,EAAE;gBAEtD,OAAO;aACR;YACD,MAAA,MAAA,IAAI,CAAC,QAAQ,EAAC,OAAO,mDAAG,EAAE,iBAAiB,EAAE,EAAE;;KAChD;IAED;;OAEG;IACK,wBAAwB;QAC9B,IAAI,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC/C,KAAK,CAAC,KAAK,CACT,QAAQ,EACR,qOAAqO,CACtO,CAAC;SACH;IACH,CAAC;CACF","sourcesContent":["import { BrowserClient, defaultStackParser, makeFetchTransport } from '@sentry/browser';\nimport { BrowserTransportOptions } from '@sentry/browser/types/transports/types';\nimport { FetchImpl } from '@sentry/browser/types/transports/utils';\nimport { BaseClient } from '@sentry/core';\nimport {\n Event,\n EventHint,\n SeverityLevel,\n Transport,\n UserFeedback,\n} from '@sentry/types';\n// @ts-ignore LogBox introduced in RN 0.63\nimport { Alert, LogBox, YellowBox } from 'react-native';\n\nimport { defaultSdkInfo } from './integrations/sdkinfo';\nimport { ReactNativeClientOptions } from './options';\nimport { NativeTransport } from './transports/native';\nimport { createUserFeedbackEnvelope } from './utils/envelope';\nimport { NATIVE } from './wrapper';\n\n/**\n * The Sentry React Native SDK Client.\n *\n * @see ReactNativeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {\n\n private readonly _browserClient: BrowserClient;\n\n /**\n * Creates a new React Native SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: ReactNativeClientOptions) {\n if (!options.transport) {\n options.transport = (options: BrowserTransportOptions, nativeFetch?: FetchImpl): Transport => {\n if (NATIVE.isNativeTransportAvailable()) {\n return new NativeTransport();\n }\n return makeFetchTransport(options, nativeFetch);\n };\n }\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || defaultSdkInfo;\n super(options);\n\n // This is a workaround for now using fetch on RN, this is a known issue in react-native and only generates a warning\n // YellowBox deprecated and replaced with with LogBox in RN 0.63\n if (LogBox) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n LogBox.ignoreLogs(['Require cycle:']);\n } else {\n // eslint-disable-next-line deprecation/deprecation\n YellowBox.ignoreWarnings(['Require cycle:']);\n }\n\n this._browserClient = new BrowserClient({\n dsn: options.dsn,\n transport: options.transport,\n transportOptions: options.transportOptions,\n stackParser: options.stackParser || defaultStackParser,\n integrations: [],\n _metadata: options._metadata,\n });\n\n void this._initNativeSdk();\n }\n\n\n /**\n * @inheritDoc\n */\n public eventFromException(_exception: unknown, _hint?: EventHint): PromiseLike<Event> {\n return this._browserClient.eventFromException(_exception, _hint);\n }\n\n /**\n * @inheritDoc\n */\n public eventFromMessage(_message: string, _level?: SeverityLevel, _hint?: EventHint): PromiseLike<Event> {\n return this._browserClient.eventFromMessage(_message, _level, _hint);\n }\n\n /**\n * If native client is available it will trigger a native crash.\n * Use this only for testing purposes.\n */\n public nativeCrash(): void {\n NATIVE.nativeCrash();\n }\n\n /**\n * @inheritDoc\n */\n public close(): PromiseLike<boolean> {\n // As super.close() flushes queued events, we wait for that to finish before closing the native SDK.\n return super.close().then((result: boolean) => {\n return NATIVE.closeNativeSdk().then(() => result) as PromiseLike<boolean>;\n });\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n public captureUserFeedback(feedback: UserFeedback): void {\n const envelope = createUserFeedbackEnvelope(\n feedback,\n {\n metadata: this._options._metadata,\n dsn: this.getDsn(),\n tunnel: this._options.tunnel,\n },\n );\n this._sendEnvelope(envelope);\n }\n\n /**\n * Starts native client with dsn and options\n */\n private async _initNativeSdk(): Promise<void> {\n let didCallNativeInit = false;\n\n try {\n didCallNativeInit = await NATIVE.initNativeSdk(this._options);\n } catch (_) {\n this._showCannotConnectDialog();\n\n this._options.onReady?.({ didCallNativeInit: false });\n\n return;\n }\n this._options.onReady?.({ didCallNativeInit });\n }\n\n /**\n * If the user is in development mode, and the native nagger is enabled then it will show an alert.\n */\n private _showCannotConnectDialog(): void {\n if (__DEV__ && this._options.enableNativeNagger) {\n Alert.alert(\n 'Sentry',\n 'Warning, could not connect to Sentry native SDK.\\nIf you do not want to use the native component please pass `enableNative: false` in the options.\\nVisit: https://docs.sentry.io/platforms/react-native/#linking for more details.'\n );\n }\n }\n}\n"]}
|
package/dist/js/definitions.d.ts
CHANGED
|
@@ -24,9 +24,8 @@ interface SerializedObject {
|
|
|
24
24
|
export interface SentryNativeBridgeModule {
|
|
25
25
|
nativeClientAvailable: boolean;
|
|
26
26
|
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
27
|
-
captureEnvelope(
|
|
28
|
-
|
|
29
|
-
payload: Record<string, unknown>;
|
|
27
|
+
captureEnvelope(bytes: number[], options: {
|
|
28
|
+
store: boolean;
|
|
30
29
|
}): PromiseLike<boolean>;
|
|
31
30
|
clearBreadcrumbs(): void;
|
|
32
31
|
crash(): void;
|
|
@@ -41,7 +40,6 @@ export interface SentryNativeBridgeModule {
|
|
|
41
40
|
fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse>;
|
|
42
41
|
fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;
|
|
43
42
|
fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;
|
|
44
|
-
getStringBytesLength(str: string): Promise<number>;
|
|
45
43
|
initNativeSdk(options: ReactNativeOptions): Promise<boolean>;
|
|
46
44
|
setUser(defaultUserKeys: SerializedObject | null, otherUserKeys: SerializedObject | null): void;
|
|
47
45
|
setContext(key: string, value: SerializedObject | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/js/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,oBAAY,sBAAsB,GAAG;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC,CAAC;AAEF,UAAU,gBAAgB;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,wBAAwB;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAE/B,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC5C,eAAe,CACb,
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/js/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,oBAAY,sBAAsB,GAAG;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,oBAAY,oBAAoB,GAAG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CAAC,OAAO,CAAC,CAAC;IAC7D,OAAO,CACL,eAAe,EAAE,gBAAgB,GAAG,IAAI,EACxC,aAAa,EAAE,gBAAgB,GAAG,IAAI,GACrC,IAAI,CAAC;IACR,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;IAC9D,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/js/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { Breadcrumb, Package } from '@sentry/types';\n\nimport { ReactNativeOptions } from './options';\n\nexport type NativeAppStartResponse = {\n isColdStart: boolean;\n appStartTime: number;\n didFetchAppStart: boolean;\n};\n\nexport type NativeFramesResponse = {\n totalFrames: number;\n slowFrames: number;\n frozenFrames: number;\n};\n\nexport type NativeReleaseResponse = {\n build: string;\n id: string;\n version: string;\n};\n\nexport type NativeDeviceContextsResponse = {\n [key: string]: Record<string, unknown>;\n};\n\ninterface SerializedObject {\n [key: string]: string;\n}\n\nexport interface SentryNativeBridgeModule {\n nativeClientAvailable: boolean;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n captureEnvelope(\n
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/js/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { Breadcrumb, Package } from '@sentry/types';\n\nimport { ReactNativeOptions } from './options';\n\nexport type NativeAppStartResponse = {\n isColdStart: boolean;\n appStartTime: number;\n didFetchAppStart: boolean;\n};\n\nexport type NativeFramesResponse = {\n totalFrames: number;\n slowFrames: number;\n frozenFrames: number;\n};\n\nexport type NativeReleaseResponse = {\n build: string;\n id: string;\n version: string;\n};\n\nexport type NativeDeviceContextsResponse = {\n [key: string]: Record<string, unknown>;\n};\n\ninterface SerializedObject {\n [key: string]: string;\n}\n\nexport interface SentryNativeBridgeModule {\n nativeClientAvailable: boolean;\n\n addBreadcrumb(breadcrumb: Breadcrumb): void;\n captureEnvelope(\n bytes: number[],\n options: {\n store: boolean,\n },\n ): PromiseLike<boolean>;\n clearBreadcrumbs(): void;\n crash(): void;\n closeNativeSdk(): PromiseLike<void>;\n disableNativeFramesTracking(): void;\n fetchNativeRelease(): Promise<{\n build: string;\n id: string;\n version: string;\n }>;\n fetchNativeSdkInfo(): PromiseLike<Package>;\n fetchNativeDeviceContexts(): PromiseLike<NativeDeviceContextsResponse>;\n fetchNativeAppStart(): PromiseLike<NativeAppStartResponse | null>;\n fetchNativeFrames(): PromiseLike<NativeFramesResponse | null>;\n initNativeSdk(options: ReactNativeOptions): Promise<boolean>;\n setUser(\n defaultUserKeys: SerializedObject | null,\n otherUserKeys: SerializedObject | null\n ): void;\n setContext(key: string, value: SerializedObject | null): void;\n setExtra(key: string, value: string): void;\n setTag(key: string, value: string): void;\n}\n"]}
|
package/dist/js/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Breadcrumb, Request, SdkInfo, Event, Exception, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
|
|
1
|
+
export { Breadcrumb, Request, SdkInfo, Event, Exception, StackFrame, Stacktrace, Thread, User, UserFeedback, } from '@sentry/types';
|
|
2
2
|
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, getHubFromCarrier, getCurrentHub, Hub, Scope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, withScope, } from '@sentry/core';
|
|
3
3
|
import '@sentry/tracing';
|
|
4
4
|
export { Integrations as BrowserIntegrations, ErrorBoundary, withErrorBoundary, createReduxEnhancer, Profiler, useProfiler, withProfiler, } from '@sentry/react';
|
|
@@ -6,7 +6,7 @@ import * as Integrations from './integrations';
|
|
|
6
6
|
import { SDK_NAME, SDK_VERSION } from './version';
|
|
7
7
|
export { ReactNativeOptions } from './options';
|
|
8
8
|
export { ReactNativeClient } from './client';
|
|
9
|
-
export { init, wrap, setDist, setRelease, nativeCrash, flush, close, } from './sdk';
|
|
9
|
+
export { init, wrap, setDist, setRelease, nativeCrash, flush, close, captureUserFeedback, } from './sdk';
|
|
10
10
|
export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
|
|
11
11
|
export { ReactNativeTracing, ReactNavigationV4Instrumentation, ReactNavigationV5Instrumentation, ReactNavigationInstrumentation, ReactNativeNavigationInstrumentation, RoutingInstrumentation, ReactNavigationTransactionContext, } from './tracing';
|
|
12
12
|
export { Integrations, SDK_NAME, SDK_VERSION };
|
package/dist/js/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,SAAS,GACV,MAAM,cAAc,CAAC;AAItB,OAAO,iBAAiB,CAAC;AAMzB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,IAAI,EACJ,IAAI,EAEJ,OAAO,EAEP,UAAU,EACV,WAAW,EACX,KAAK,EACL,KAAK,EACL,mBAAmB,GACpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,gCAAgC,EAEhC,gCAAgC,EAChC,8BAA8B,EAC9B,oCAAoC,EACpC,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/js/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { init, wrap,
|
|
|
13
13
|
// eslint-disable-next-line deprecation/deprecation
|
|
14
14
|
setDist,
|
|
15
15
|
// eslint-disable-next-line deprecation/deprecation
|
|
16
|
-
setRelease, nativeCrash, flush, close, } from './sdk';
|
|
16
|
+
setRelease, nativeCrash, flush, close, captureUserFeedback, } from './sdk';
|
|
17
17
|
export { TouchEventBoundary, withTouchEventBoundary } from './touchevents';
|
|
18
18
|
export { ReactNativeTracing, ReactNavigationV4Instrumentation,
|
|
19
19
|
// eslint-disable-next-line deprecation/deprecation
|
package/dist/js/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/js/index.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,KAAK,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,SAAS,GACV,MAAM,cAAc,CAAC;AAEtB,iEAAiE;AACjE,6BAA6B;AAC7B,OAAO,iBAAiB,CAAC;AAEzB,kGAAkG;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,qBAAqB,EAAE,CAAC;AAExB,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,IAAI,EACJ,IAAI;AACJ,mDAAmD;AACnD,OAAO;AACP,mDAAmD;AACnD,UAAU,EACV,WAAW,EACX,KAAK,EACL,KAAK,EACL,mBAAmB,GACpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EACL,kBAAkB,EAClB,gCAAgC;AAChC,mDAAmD;AACnD,gCAAgC,EAChC,8BAA8B,EAC9B,oCAAoC,EACpC,sBAAsB,GAEvB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC","sourcesContent":["export {\n Breadcrumb,\n Request,\n SdkInfo,\n Event,\n Exception,\n StackFrame,\n Stacktrace,\n Thread,\n User,\n UserFeedback,\n} from '@sentry/types';\n\nexport {\n addGlobalEventProcessor,\n addBreadcrumb,\n captureException,\n captureEvent,\n captureMessage,\n configureScope,\n getHubFromCarrier,\n getCurrentHub,\n Hub,\n Scope,\n setContext,\n setExtra,\n setExtras,\n setTag,\n setTags,\n setUser,\n startTransaction,\n withScope,\n} from '@sentry/core';\n\n// We need to import it so we patch the hub with global functions\n// aka. this has side effects\nimport '@sentry/tracing';\n\n// Add the React Native SDK's own tracing extensions, this needs to happen AFTER @sentry/tracing's\nimport { _addTracingExtensions } from './measurements';\n_addTracingExtensions();\n\nexport {\n Integrations as BrowserIntegrations,\n ErrorBoundary,\n withErrorBoundary,\n createReduxEnhancer,\n Profiler,\n useProfiler,\n withProfiler,\n} from '@sentry/react';\n\nimport * as Integrations from './integrations';\nimport { SDK_NAME, SDK_VERSION } from './version';\nexport { ReactNativeOptions } from './options';\nexport { ReactNativeClient } from './client';\n\nexport {\n init,\n wrap,\n // eslint-disable-next-line deprecation/deprecation\n setDist,\n // eslint-disable-next-line deprecation/deprecation\n setRelease,\n nativeCrash,\n flush,\n close,\n captureUserFeedback,\n} from './sdk';\nexport { TouchEventBoundary, withTouchEventBoundary } from './touchevents';\n\nexport {\n ReactNativeTracing,\n ReactNavigationV4Instrumentation,\n // eslint-disable-next-line deprecation/deprecation\n ReactNavigationV5Instrumentation,\n ReactNavigationInstrumentation,\n ReactNativeNavigationInstrumentation,\n RoutingInstrumentation,\n ReactNavigationTransactionContext,\n} from './tracing';\n\nexport { Integrations, SDK_NAME, SDK_VERSION };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeerrorhandlers.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAK3D,uCAAuC;AACvC,UAAU,+BAA+B;IACvC,OAAO,EAAE,OAAO,CAAC;IAC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lC;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;OAEG;IACH,OAAO,CAAC,gCAAgC;IAyCxC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAqB5B;;OAEG;IACH,OAAO,CAAC,cAAc;CAoEvB"}
|
|
@@ -123,6 +123,7 @@ export class ReactNativeErrorHandlers {
|
|
|
123
123
|
}
|
|
124
124
|
const currentHub = getCurrentHub();
|
|
125
125
|
const client = currentHub.getClient();
|
|
126
|
+
const scope = currentHub.getScope();
|
|
126
127
|
if (!client) {
|
|
127
128
|
logger.error('Sentry client is missing, the error event might be lost.', error);
|
|
128
129
|
// If there is no client something is fishy, anyway we call the default handler
|
|
@@ -131,7 +132,8 @@ export class ReactNativeErrorHandlers {
|
|
|
131
132
|
}
|
|
132
133
|
const options = client.getOptions();
|
|
133
134
|
const event = yield client.eventFromException(error, {
|
|
134
|
-
originalException: error
|
|
135
|
+
originalException: error,
|
|
136
|
+
attachments: scope === null || scope === void 0 ? void 0 : scope.getAttachments(),
|
|
135
137
|
});
|
|
136
138
|
if (isFatal) {
|
|
137
139
|
event.level = 'fatal';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAmB/E,2CAA2C;AAC3C,MAAM,OAAO,wBAAwB;IAcnC,kBAAkB;IAClB,YAAmB,OAAkD;QATrE;;WAEG;QACI,SAAI,GAAW,wBAAwB,CAAC,EAAE,CAAC;QAOhD,IAAI,CAAC,QAAQ,mBACX,OAAO,EAAE,IAAI,EACb,oBAAoB,EAAE,IAAI,EAC1B,kBAAkB,EAAE,IAAI,IACrB,OAAO,CACX,CAAC;IACJ,CAAC;IAED;;O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ACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { Integration, SeverityLevel } from '@sentry/types';\nimport { addExceptionMechanism, getGlobalObject, logger } from '@sentry/utils';\n\nimport { ReactNativeClient } from '../client';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const global: any;\n\n/** ReactNativeErrorHandlers Integration */\nexport class ReactNativeErrorHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeErrorHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeErrorHandlers.id;\n\n /** ReactNativeOptions */\n private readonly _options: ReactNativeErrorHandlersOptions;\n\n /** Constructor */\n public constructor(options?: Partial<ReactNativeErrorHandlersOptions>) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n this._handleUnhandledRejections();\n this._handleOnError();\n }\n\n /**\n * Handle Promises\n */\n private _handleUnhandledRejections(): void {\n if (this._options.onunhandledrejection) {\n if (this._options.patchGlobalPromise) {\n this._polyfillPromise();\n }\n\n this._attachUnhandledRejectionHandler();\n this._checkPromiseAndWarn();\n }\n }\n /**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\n private _polyfillPromise(): void {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n const {\n polyfillGlobal,\n } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n const Promise = require('promise/setimmediate/es6-extensions');\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n polyfillGlobal('Promise', () => Promise);\n /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n }\n /**\n * Attach the unhandled rejection handler\n */\n private _attachUnhandledRejectionHandler(): void {\n const tracking: {\n disable: () => void;\n enable: (arg: unknown) => void;\n // eslint-disable-next-line import/no-extraneous-dependencies,@typescript-eslint/no-var-requires\n } = require('promise/setimmediate/rejection-tracking');\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(\n `Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`\n );\n },\n onHandled: (id) => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: Error) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n getCurrentHub().captureException(error, {\n data: { id },\n originalException: error,\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n }\n /**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\n private _checkPromiseAndWarn(): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const Promise = require('promise/setimmediate/es6-extensions');\n\n const _global = getGlobalObject<{ Promise: typeof Promise }>();\n\n if (Promise !== _global.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.'\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.'\n );\n }\n }\n /**\n * Handle errors\n */\n private _handleOnError(): void {\n if (this._options.onerror) {\n let handlingFatal = false;\n\n const defaultHandler =\n ErrorUtils.getGlobalHandler && ErrorUtils.getGlobalHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ErrorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log(\n 'Encountered multiple fatals in a row. The latest:',\n error\n );\n return;\n }\n handlingFatal = true;\n }\n\n const currentHub = getCurrentHub();\n const client = currentHub.getClient<ReactNativeClient>();\n\n if (!client) {\n logger.error(\n 'Sentry client is missing, the error event might be lost.',\n error\n );\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const options = client.getOptions();\n\n const event = await client.eventFromException(error, {\n originalException: error\n });\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event);\n\n if (!__DEV__) {\n void client.flush(options.shutdownTimeout || 2000).then(() => {\n defaultHandler(error, isFatal);\n });\n } else {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n }\n });\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reactnativeerrorhandlers.js","sourceRoot":"","sources":["../../../src/js/integrations/reactnativeerrorhandlers.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAmB/E,2CAA2C;AAC3C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AC,CAAC;gBAE/B,IAAI,CAAC,OAAO,EAAE;oBACZ,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;wBAC3D,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBACjC,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,gFAAgF;oBAChF,mCAAmC;oBACnC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;iBAChC;YACH,CAAC,CAAA,CAAC,CAAC;SACJ;IACH,CAAC;;AA/MD;;GAEG;AACW,2BAAE,GAAW,0BAA0B,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { Integration, SeverityLevel } from '@sentry/types';\nimport { addExceptionMechanism, getGlobalObject, logger } from '@sentry/utils';\n\nimport { ReactNativeClient } from '../client';\n\n/** ReactNativeErrorHandlers Options */\ninterface ReactNativeErrorHandlersOptions {\n onerror: boolean;\n onunhandledrejection: boolean;\n patchGlobalPromise: boolean;\n}\n\ninterface PromiseRejectionTrackingOptions {\n onUnhandled: (id: string, error: unknown) => void;\n onHandled: (id: string) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const global: any;\n\n/** ReactNativeErrorHandlers Integration */\nexport class ReactNativeErrorHandlers implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'ReactNativeErrorHandlers';\n\n /**\n * @inheritDoc\n */\n public name: string = ReactNativeErrorHandlers.id;\n\n /** ReactNativeOptions */\n private readonly _options: ReactNativeErrorHandlersOptions;\n\n /** Constructor */\n public constructor(options?: Partial<ReactNativeErrorHandlersOptions>) {\n this._options = {\n onerror: true,\n onunhandledrejection: true,\n patchGlobalPromise: true,\n ...options,\n };\n }\n\n /**\n * @inheritDoc\n */\n public setupOnce(): void {\n this._handleUnhandledRejections();\n this._handleOnError();\n }\n\n /**\n * Handle Promises\n */\n private _handleUnhandledRejections(): void {\n if (this._options.onunhandledrejection) {\n if (this._options.patchGlobalPromise) {\n this._polyfillPromise();\n }\n\n this._attachUnhandledRejectionHandler();\n this._checkPromiseAndWarn();\n }\n }\n /**\n * Polyfill the global promise instance with one we can be sure that we can attach the tracking to.\n *\n * In newer RN versions >=0.63, the global promise is not the same reference as the one imported from the promise library.\n * This is due to a version mismatch between promise versions.\n * Originally we tried a solution where we would have you put a package resolution to ensure the promise instances match. However,\n * - Using a package resolution requires the you to manually troubleshoot.\n * - The package resolution fix no longer works with 0.67 on iOS Hermes.\n */\n private _polyfillPromise(): void {\n /* eslint-disable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n const {\n polyfillGlobal,\n } = require('react-native/Libraries/Utilities/PolyfillFunctions');\n\n // Below, we follow the exact way React Native initializes its promise library, and we globally replace it.\n const Promise = require('promise/setimmediate/es6-extensions');\n\n // As of RN 0.67 only done and finally are used\n require('promise/setimmediate/done');\n require('promise/setimmediate/finally');\n\n polyfillGlobal('Promise', () => Promise);\n /* eslint-enable import/no-extraneous-dependencies,@typescript-eslint/no-var-requires */\n }\n /**\n * Attach the unhandled rejection handler\n */\n private _attachUnhandledRejectionHandler(): void {\n const tracking: {\n disable: () => void;\n enable: (arg: unknown) => void;\n // eslint-disable-next-line import/no-extraneous-dependencies,@typescript-eslint/no-var-requires\n } = require('promise/setimmediate/rejection-tracking');\n\n const promiseRejectionTrackingOptions: PromiseRejectionTrackingOptions = {\n onUnhandled: (id, rejection = {}) => {\n // eslint-disable-next-line no-console\n console.warn(\n `Possible Unhandled Promise Rejection (id: ${id}):\\n${rejection}`\n );\n },\n onHandled: (id) => {\n // eslint-disable-next-line no-console\n console.warn(\n `Promise Rejection Handled (id: ${id})\\n` +\n 'This means you can ignore any previous messages of the form ' +\n `\"Possible Unhandled Promise Rejection (id: ${id}):\"`\n );\n },\n };\n\n tracking.enable({\n allRejections: true,\n onUnhandled: (id: string, error: Error) => {\n if (__DEV__) {\n promiseRejectionTrackingOptions.onUnhandled(id, error);\n }\n\n getCurrentHub().captureException(error, {\n data: { id },\n originalException: error,\n });\n },\n onHandled: (id: string) => {\n promiseRejectionTrackingOptions.onHandled(id);\n },\n });\n }\n /**\n * Checks if the promise is the same one or not, if not it will warn the user\n */\n private _checkPromiseAndWarn(): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies\n const Promise = require('promise/setimmediate/es6-extensions');\n\n const _global = getGlobalObject<{ Promise: typeof Promise }>();\n\n if (Promise !== _global.Promise) {\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.'\n );\n } else {\n logger.log('Unhandled promise rejections will be caught by Sentry.');\n }\n } catch (e) {\n // Do Nothing\n logger.warn(\n 'Unhandled promise rejections will not be caught by Sentry. Read about how to fix this on our troubleshooting page.'\n );\n }\n }\n /**\n * Handle errors\n */\n private _handleOnError(): void {\n if (this._options.onerror) {\n let handlingFatal = false;\n\n const defaultHandler =\n ErrorUtils.getGlobalHandler && ErrorUtils.getGlobalHandler();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ErrorUtils.setGlobalHandler(async (error: any, isFatal?: boolean) => {\n // We want to handle fatals, but only in production mode.\n const shouldHandleFatal = isFatal && !__DEV__;\n if (shouldHandleFatal) {\n if (handlingFatal) {\n logger.log(\n 'Encountered multiple fatals in a row. The latest:',\n error\n );\n return;\n }\n handlingFatal = true;\n }\n\n const currentHub = getCurrentHub();\n const client = currentHub.getClient<ReactNativeClient>();\n const scope = currentHub.getScope();\n\n if (!client) {\n logger.error(\n 'Sentry client is missing, the error event might be lost.',\n error\n );\n\n // If there is no client something is fishy, anyway we call the default handler\n defaultHandler(error, isFatal);\n\n return;\n }\n\n const options = client.getOptions();\n\n const event = await client.eventFromException(error, {\n originalException: error,\n attachments: scope?.getAttachments(),\n });\n\n if (isFatal) {\n event.level = 'fatal' as SeverityLevel;\n\n addExceptionMechanism(event, {\n handled: false,\n type: 'onerror',\n });\n }\n\n currentHub.captureEvent(event);\n\n if (!__DEV__) {\n void client.flush(options.shutdownTimeout || 2000).then(() => {\n defaultHandler(error, isFatal);\n });\n } else {\n // If in dev, we call the default handler anyway and hope the error will be sent\n // Just for a better dev experience\n defaultHandler(error, isFatal);\n }\n });\n }\n }\n}\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { EventProcessor, Integration } from '@sentry/types';
|
|
1
|
+
import { EventProcessor, Integration, SdkInfo as SdkInfoType } from '@sentry/types';
|
|
2
|
+
declare type DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;
|
|
3
|
+
export declare const defaultSdkInfo: DefaultSdkInfo;
|
|
2
4
|
/** Default SdkInfo instrumentation */
|
|
3
5
|
export declare class SdkInfo implements Integration {
|
|
4
6
|
/**
|
|
@@ -15,4 +17,5 @@ export declare class SdkInfo implements Integration {
|
|
|
15
17
|
*/
|
|
16
18
|
setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void;
|
|
17
19
|
}
|
|
20
|
+
export {};
|
|
18
21
|
//# sourceMappingURL=sdkinfo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAW,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAW,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AAM7F,aAAK,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;AAEnF,eAAO,MAAM,cAAc,EAAE,cAS5B,CAAC;AAEF,sCAAsC;AACtC,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC,OAAO,CAAC,cAAc,CAAwB;IAE9C;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CA8B7E"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { logger } from '@sentry/utils';
|
|
3
|
-
import { SDK_NAME, SDK_VERSION } from '../version';
|
|
3
|
+
import { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../version';
|
|
4
4
|
import { NATIVE } from '../wrapper';
|
|
5
|
+
export const defaultSdkInfo = {
|
|
6
|
+
name: SDK_NAME,
|
|
7
|
+
packages: [
|
|
8
|
+
{
|
|
9
|
+
name: SDK_PACKAGE_NAME,
|
|
10
|
+
version: SDK_VERSION,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
version: SDK_VERSION,
|
|
14
|
+
};
|
|
5
15
|
/** Default SdkInfo instrumentation */
|
|
6
16
|
export class SdkInfo {
|
|
7
17
|
constructor() {
|
|
@@ -30,14 +40,11 @@ export class SdkInfo {
|
|
|
30
40
|
}
|
|
31
41
|
}
|
|
32
42
|
event.platform = event.platform || 'javascript';
|
|
33
|
-
event.sdk = Object.assign(Object.assign({}, ((_a = event.sdk) !== null && _a !== void 0 ? _a : {})), {
|
|
43
|
+
event.sdk = Object.assign(Object.assign(Object.assign({}, ((_a = event.sdk) !== null && _a !== void 0 ? _a : {})), defaultSdkInfo), { packages: [
|
|
34
44
|
...((event.sdk && event.sdk.packages) || []),
|
|
35
45
|
...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
version: SDK_VERSION,
|
|
39
|
-
},
|
|
40
|
-
], version: SDK_VERSION });
|
|
46
|
+
...defaultSdkInfo.packages,
|
|
47
|
+
] });
|
|
41
48
|
return event;
|
|
42
49
|
}));
|
|
43
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"sdkinfo.js","sourceRoot":"","sources":["../../../src/js/integrations/sdkinfo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAC,WAAW,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIpC,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,WAAW;SACrB;KACF;IACD,OAAO,EAAE,WAAW;CACrB,CAAC;AAEF,sCAAsC;AACtC,MAAM,OAAO,OAAO;IAApB;QAME;;WAEG;QACI,SAAI,GAAW,OAAO,CAAC,EAAE,CAAC;QAEzB,mBAAc,GAAmB,IAAI,CAAC;IAmChD,CAAC;IAjCC;;OAEG;IACI,SAAS,CAAC,uBAAoD;QACnE,uBAAuB,CAAC,CAAO,KAAK,EAAE,EAAE;;YACtC,2GAA2G;YAC3G,+FAA+F;YAC/F,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE;gBAC7D,IAAI;oBACF,IAAI,CAAC,cAAc,GAAG,MAAM,MAAM,CAAC,kBAAkB,EAAE,CAAC;iBACzD;gBAAC,OAAO,CAAC,EAAE;oBACV,qGAAqG;oBACrG,MAAM,CAAC,IAAI,CACT,sGAAsG,CACvG,CAAC;oBACF,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBAChB;aACF;YAED,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,YAAY,CAAC;YAChD,KAAK,CAAC,GAAG,iDACJ,OAAC,KAAK,CAAC,GAAG,mCAAI,EAAE,CAAC,GACjB,cAAc,KACjB,QAAQ,EAAE;oBACR,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAC5C,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,CAAC;oBACzD,GAAG,cAAc,CAAC,QAAQ;iBAC3B,GACF,CAAC;YAEF,OAAO,KAAK,CAAC;QACf,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AA5CD;;GAEG;AACW,UAAE,GAAW,SAAS,CAAC","sourcesContent":["import { EventProcessor, Integration, Package, SdkInfo as SdkInfoType } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { SDK_NAME, SDK_PACKAGE_NAME,SDK_VERSION } from '../version';\nimport { NATIVE } from '../wrapper';\n\ntype DefaultSdkInfo = Pick<Required<SdkInfoType>, 'name' | 'packages' | 'version'>;\n\nexport const defaultSdkInfo: DefaultSdkInfo = {\n name: SDK_NAME,\n packages: [\n {\n name: SDK_PACKAGE_NAME,\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n};\n\n/** Default SdkInfo instrumentation */\nexport class SdkInfo implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'SdkInfo';\n\n /**\n * @inheritDoc\n */\n public name: string = SdkInfo.id;\n\n private _nativeSdkInfo: Package | null = null;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (e: EventProcessor) => void): void {\n addGlobalEventProcessor(async (event) => {\n // The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.\n // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.\n if (NATIVE.platform === 'ios' && this._nativeSdkInfo === null) {\n try {\n this._nativeSdkInfo = await NATIVE.fetchNativeSdkInfo();\n } catch (e) {\n // If this fails, go ahead as usual as we would rather have the event be sent with a package missing.\n logger.warn(\n '[SdkInfo] Native SDK Info retrieval failed...something could be wrong with your Sentry installation:'\n );\n logger.warn(e);\n }\n }\n\n event.platform = event.platform || 'javascript';\n event.sdk = {\n ...(event.sdk ?? {}),\n ...defaultSdkInfo,\n packages: [\n ...((event.sdk && event.sdk.packages) || []),\n ...((this._nativeSdkInfo && [this._nativeSdkInfo]) || []),\n ...defaultSdkInfo.packages,\n ],\n };\n\n return event;\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EnvelopeItem } from '@sentry/types';
|
|
2
|
+
declare type EnvelopeItemPayload = EnvelopeItem[1];
|
|
3
|
+
/**
|
|
4
|
+
* Extracts the hard crash information from the event exceptions.
|
|
5
|
+
* No exceptions or undefined handled are not hard crashes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isHardCrash(payload: EnvelopeItemPayload): boolean;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=misc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEb,MAAM,eAAe,CAAC;AAEvB,aAAK,mBAAmB,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAUjE"}
|
package/dist/js/misc.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the hard crash information from the event exceptions.
|
|
3
|
+
* No exceptions or undefined handled are not hard crashes.
|
|
4
|
+
*/
|
|
5
|
+
export function isHardCrash(payload) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const values = typeof payload !== 'string' && 'exception' in payload && ((_a = payload.exception) === null || _a === void 0 ? void 0 : _a.values)
|
|
8
|
+
? payload.exception.values
|
|
9
|
+
: [];
|
|
10
|
+
for (const exception of values) {
|
|
11
|
+
if (!(((_b = exception.mechanism) === null || _b === void 0 ? void 0 : _b.handled) !== false)) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=misc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/js/misc.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;;IACtD,MAAM,MAAM,GAAgB,OAAO,OAAO,KAAK,QAAQ,IAAI,WAAW,IAAI,OAAO,WAAI,OAAO,CAAC,SAAS,0CAAE,MAAM,CAAA;QAC5G,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM;QAC1B,CAAC,CAAC,EAAE,CAAC;IACP,KAAK,MAAM,SAAS,IAAI,MAAM,EAAE;QAC9B,IAAI,CAAC,CAAC,OAAA,SAAS,CAAC,SAAS,0CAAE,OAAO,MAAK,KAAK,CAAC,EAAE;YAC7C,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import {\n EnvelopeItem,\n Exception,\n} from '@sentry/types';\n\ntype EnvelopeItemPayload = EnvelopeItem[1];\n\n/**\n * Extracts the hard crash information from the event exceptions.\n * No exceptions or undefined handled are not hard crashes.\n */\nexport function isHardCrash(payload: EnvelopeItemPayload): boolean {\n const values: Exception[] = typeof payload !== 'string' && 'exception' in payload && payload.exception?.values\n ? payload.exception.values\n : [];\n for (const exception of values) {\n if (!(exception.mechanism?.handled !== false)) {\n return true;\n }\n }\n return false;\n}\n"]}
|