Skip to content

Commit 31fcca2

Browse files
chore(deps): update JavaScript SDK to v7.99.0 (#3574)
Co-authored-by: GitHub <[email protected]>
1 parent cbee1f9 commit 31fcca2

20 files changed

+218
-150
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@ module.exports = {
6666
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
6767
'@sentry-internal/sdk/no-unsupported-es6-methods': 'off',
6868
'@sentry-internal/sdk/no-class-field-initializers': 'off',
69+
'deprecation/deprecation': 'off',
6970
},
7071
};

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ This release contains upgrade of `sentry-android` dependency to major version 7.
1313
- Bump Android SDK from v6.34.0 to v7.3.0 ([#3434](https://github.com/getsentry/sentry-react-native/pull/3434))
1414
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#730)
1515
- [diff](https://github.com/getsentry/sentry-java/compare/6.34.0...7.3.0)
16+
- Bump JavaScript SDK from v7.81.1 to v7.99.0 ([#3426](https://github.com/getsentry/sentry-react-native/pull/3426))
17+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7990)
18+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.81.1...7.99.0)
1619

1720
## 5.18.0
1821

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@
6666
"react-native": ">=0.65.0"
6767
},
6868
"dependencies": {
69-
"@sentry/browser": "7.81.1",
69+
"@sentry/browser": "7.99.0",
7070
"@sentry/cli": "2.25.2",
71-
"@sentry/core": "7.81.1",
72-
"@sentry/hub": "7.81.1",
73-
"@sentry/integrations": "7.81.1",
74-
"@sentry/react": "7.81.1",
75-
"@sentry/types": "7.81.1",
76-
"@sentry/utils": "7.81.1"
71+
"@sentry/core": "7.99.0",
72+
"@sentry/hub": "7.99.0",
73+
"@sentry/integrations": "7.99.0",
74+
"@sentry/react": "7.99.0",
75+
"@sentry/types": "7.99.0",
76+
"@sentry/utils": "7.99.0"
7777
},
7878
"devDependencies": {
7979
"@babel/core": "^7.23.5",
8080
"@expo/metro-config": "0.16.0",
8181
"@mswjs/interceptors": "^0.25.15",
82-
"@sentry-internal/eslint-config-sdk": "7.81.1",
83-
"@sentry-internal/eslint-plugin-sdk": "7.81.1",
84-
"@sentry-internal/typescript": "7.80.0",
82+
"@sentry-internal/eslint-config-sdk": "7.99.0",
83+
"@sentry-internal/eslint-plugin-sdk": "7.99.0",
84+
"@sentry-internal/typescript": "7.99.0",
8585
"@sentry/wizard": "3.16.3",
8686
"@types/jest": "^29.5.3",
8787
"@types/node": "^20.9.3",

src/js/client.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {
4444
super(options);
4545

4646
this._outcomesBuffer = [];
47-
void this._initNativeSdk();
47+
this._initNativeSdk();
4848
}
4949

5050
/**
@@ -159,20 +159,23 @@ export class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {
159159
/**
160160
* Starts native client with dsn and options
161161
*/
162-
private async _initNativeSdk(): Promise<void> {
163-
let didCallNativeInit = false;
164-
165-
try {
166-
didCallNativeInit = await NATIVE.initNativeSdk(this._options);
167-
} catch (_) {
168-
this._showCannotConnectDialog();
169-
} finally {
170-
try {
162+
private _initNativeSdk(): void {
163+
NATIVE.initNativeSdk(this._options)
164+
.then(
165+
(result: boolean) => {
166+
return result;
167+
},
168+
() => {
169+
this._showCannotConnectDialog();
170+
return false;
171+
},
172+
)
173+
.then((didCallNativeInit: boolean) => {
171174
this._options.onReady?.({ didCallNativeInit });
172-
} catch (error) {
175+
})
176+
.then(undefined, error => {
173177
logger.error('The OnReady callback threw an error: ', error);
174-
}
175-
}
178+
});
176179
}
177180

178181
/**

src/js/integrations/debugsymbolicator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ReactNativeLibraries } from '../utils/rnlibraries';
66
import { createStealthXhr, XHR_READYSTATE_DONE } from '../utils/xhr';
77
import type * as ReactNative from '../vendor/react-native';
88

9+
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor
910
const INTERNAL_CALLSITES_REGEX = new RegExp(['ReactNativeRenderer-dev\\.js$', 'MessageQueue\\.js$'].join('|'));
1011

1112
/**

src/js/integrations/reactnativeerrorhandlers.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,17 @@ export class ReactNativeErrorHandlers implements Integration {
241241
currentHub.captureEvent(event, hint);
242242

243243
if (!__DEV__) {
244-
void client.flush(options.shutdownTimeout || 2000).then(() => {
245-
defaultHandler(error, isFatal);
246-
});
244+
void client.flush(options.shutdownTimeout || 2000).then(
245+
() => {
246+
defaultHandler(error, isFatal);
247+
},
248+
(reason: unknown) => {
249+
logger.error(
250+
'[ReactNativeErrorHandlers] Error while flushing the event cache after uncaught error.',
251+
reason,
252+
);
253+
},
254+
);
247255
} else {
248256
// If in dev, we call the default handler anyway and hope the error will be sent
249257
// Just for a better dev experience

src/js/integrations/rewriteframes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RewriteFrames } from '@sentry/integrations';
2-
import type { StackFrame } from '@sentry/types';
2+
import type { Integration, StackFrame } from '@sentry/types';
33
import { Platform } from 'react-native';
44

55
import { isExpo, isHermesEnabled } from '../utils/environment';
@@ -13,7 +13,7 @@ export const IOS_DEFAULT_BUNDLE_NAME = 'app:///main.jsbundle';
1313
* and removes file://, 'address at' prefixes, CodePush postfix,
1414
* and Expo bundle postfix.
1515
*/
16-
export function createReactNativeRewriteFrames(): RewriteFrames {
16+
export function createReactNativeRewriteFrames(): Integration {
1717
return new RewriteFrames({
1818
iteratee: (frame: StackFrame) => {
1919
if (frame.platform === 'java' || frame.platform === 'cocoa') {

src/js/sdk.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,16 @@ export function captureUserFeedback(feedback: UserFeedback): void {
216216
*
217217
* @param callback that will be enclosed into push/popScope.
218218
*/
219-
export function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']> {
220-
const safeCallback = (scope: Scope): void => {
219+
export function withScope<T>(callback: (scope: Scope) => T): T | undefined {
220+
const safeCallback = (scope: Scope): T | undefined => {
221221
try {
222-
callback(scope);
222+
return callback(scope);
223223
} catch (e) {
224224
logger.error('Error while running withScope callback', e);
225+
return undefined;
225226
}
226227
};
227-
getCurrentHub().withScope(safeCallback);
228+
return getCurrentHub().withScope(safeCallback);
228229
}
229230

230231
/**

src/js/tools/sentryMetroSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,6 @@ function calculateDebugId(bundle: Bundle): string {
192192
}
193193

194194
function injectDebugId(code: string, debugId: string): string {
195+
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor
195196
return code.replace(new RegExp(DEBUG_ID_PLACE_HOLDER, 'g'), debugId);
196197
}

src/js/tracing/addTracingExtensions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { Hub, Transaction } from '@sentry/core';
1+
import type { Hub, Span, Transaction } from '@sentry/core';
22
import { addTracingExtensions, getCurrentHub, getMainCarrier } from '@sentry/core';
3-
import type { CustomSamplingContext, Span, SpanContext, TransactionContext } from '@sentry/types';
3+
import type { CustomSamplingContext, SpanContext, TransactionContext } from '@sentry/types';
44

55
import { DEFAULT } from '../tracing/ops';
66
import { ReactNativeTracing } from '../tracing/reactnativetracing';

0 commit comments

Comments
 (0)