Skip to content

Commit e125056

Browse files
committed
deps: Upgrade @sentry/react-native to 2.1.1, the latest.
One thing we'd like to have is the merged PR getsentry/sentry-javascript#3108, a type adjustment that lets us use `undefined` as a value in `setTag` and `setTags`. The author of that PR says that passing `undefined` for a tag's value is an unofficial way to unset a tag from the scope. If that works, we'd like to do it until getsentry/sentry-javascript#2218 is solved more officially. I see just one declared breaking change at 2.0.0 [1]: """ - build(android): Changes android package name from `io.sentry.RNSentryPackage` to `io.sentry.react.RNSentryPackage` (Breaking). zulip#1131 """ But autolinking handles the name change just fine, so there's nothing special we have to do about that. We don't have a complete libdef yet, but we seem to have good coverage for our usage in what we've translated from the TypeScript manually so far. So, double-check all of that against the new version and fix a few things that were slightly wrong or out-of-date (including by taking the relevant changes from getsentry/sentry-javascript#3108). [1] https://github.com/getsentry/sentry-react-native/blob/master/CHANGELOG.md#200
1 parent 5f45495 commit e125056

File tree

4 files changed

+133
-72
lines changed

4 files changed

+133
-72
lines changed

flow-typed/@sentry/react-native_v1.x.x.js renamed to flow-typed/@sentry/react-native_v2.x.x.js

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
declare module '@sentry/react-native' {
2+
3+
declare type Primitive =
4+
| number
5+
| string
6+
| boolean
7+
// | bigint (not supported yet; facebook/flow#6639)
8+
| symbol
9+
| null
10+
| typeof undefined;
11+
212
// Adapted from @sentry/types/src/options.ts et al.
313
//
414
// Despite being given as exact, many other options not listed here are
@@ -47,6 +57,7 @@ declare module '@sentry/react-native' {
4757
event_id?: string,
4858
message?: string,
4959
timestamp?: number,
60+
start_timestamp?: number;
5061
level?: SeverityType,
5162
platform?: string,
5263
logger?: string,
@@ -63,18 +74,19 @@ declare module '@sentry/react-native' {
6374
// stacktrace?: Stacktrace,
6475
breadcrumbs?: Breadcrumb[],
6576
// contexts?: { [key: string]: object },
66-
tags?: { [key: string]: string },
77+
tags?: { [key: string]: Primitive },
6778
extra?: { [key: string]: any },
6879
// user?: User,
6980
type?: EventType,
7081
|};
7182

7283
// Taken from @sentry/types/src/event.ts.
73-
declare export type EventType = 'none';
84+
declare export type EventType = 'transaction';
7485

7586
// Taken from @sentry/types/src/event.ts.
7687
declare export type EventHint = {|
7788
event_id?: string,
89+
captureContext?: CaptureContext;
7890
syntheticException?: Error | null,
7991
originalException?: Error | string | null,
8092
data?: mixed,
@@ -87,7 +99,9 @@ declare module '@sentry/react-native' {
8799
event_id?: string,
88100
category?: string,
89101
message?: string,
90-
data?: any,
102+
data?: {
103+
[key: string]: mixed;
104+
},
91105
timestamp?: number,
92106
|};
93107

@@ -96,7 +110,7 @@ declare module '@sentry/react-native' {
96110
getClient(): Client | typeof undefined,
97111

98112
captureException(exception: mixed, hint?: EventHint): string,
99-
captureMessage(message: string, level?: SeverityType, eventHint?: EventHint): string,
113+
captureMessage(message: string, level?: SeverityType, hint?: EventHint): string,
100114
};
101115

102116
// Taken from @sentry/{minimal,types}/src/scope.ts.
@@ -107,14 +121,14 @@ declare module '@sentry/react-native' {
107121
* @param tags Tags context object to merge into current context.
108122
*/
109123
setTags(tags: {
110-
[key: string]: string,
124+
+[key: string]: Primitive,
111125
}): this;
112126
/**
113127
* Set key:value that will be sent as tags data with the event.
114128
* @param key String key of tag
115129
* @param value String value of tag
116130
*/
117-
setTag(key: string, value: string): this;
131+
setTag(key: string, value: Primitive): this;
118132
/**
119133
* Set key:value that will be sent as extra data with the event.
120134
* @param key String of extra
@@ -129,6 +143,8 @@ declare module '@sentry/react-native' {
129143
setExtras(extras: { +[key: string]: any }): this;
130144
}
131145

146+
declare export type CaptureContext = Scope | Partial<ScopeContext> | ((scope: Scope) => Scope);
147+
132148
// Adapted from @sentry/types/src/client.ts, with some specialization.
133149
declare export type Client = {
134150
getOptions(): Options,
@@ -137,15 +153,15 @@ declare module '@sentry/react-native' {
137153
// Adapted from @sentry/react-native/src/sdk.ts.
138154
declare export function init(o: Options): void;
139155

140-
// Taken from @sentry/react-native/src/sdk.ts.
156+
// Taken from @sentry/hub/src/hub.ts.
141157
declare export function getCurrentHub(): Hub;
142158

143159
// A slice of the so-called "Static API":
144160
// https://docs.sentry.io/development/sdk-dev/unified-api/#static-api
145161
//
146162
// Taken from @sentry/minimal/src/index.ts.
147-
declare export function captureException(exception: mixed): string;
148-
declare export function captureMessage(message: string, level?: $Values<typeof Severity>): string;
163+
declare export function captureException(exception: mixed, captureContext?: CaptureContext): string;
164+
declare export function captureMessage(message: string, captureContext?: CaptureContext | SeverityType): string;
149165
declare export function addBreadcrumb(breadcrumb: Breadcrumb): void;
150166

151167
/* Modifies the current scope. Avoid in favor of `withScope` wherever

ios/Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,19 +364,19 @@ PODS:
364364
- React
365365
- RNReanimated (1.13.0):
366366
- React
367-
- RNSentry (1.6.3):
368-
- React
369-
- Sentry (~> 5.1.8)
367+
- RNSentry (2.2.1):
368+
- React-Core
369+
- Sentry (= 6.1.4)
370370
- RNSound (0.11.0):
371371
- React
372372
- RNSound/Core (= 0.11.0)
373373
- RNSound/Core (0.11.0):
374374
- React
375375
- RNVectorIcons (8.0.0):
376376
- React-Core
377-
- Sentry (5.1.10):
378-
- Sentry/Core (= 5.1.10)
379-
- Sentry/Core (5.1.10)
377+
- Sentry (6.1.4):
378+
- Sentry/Core (= 6.1.4)
379+
- Sentry/Core (6.1.4)
380380
- Toast (4.0.0)
381381
- UMAppLoader (1.2.0)
382382
- UMBarCodeScannerInterface (5.2.1)
@@ -700,10 +700,10 @@ SPEC CHECKSUMS:
700700
RNDeviceInfo: bdd61e8b070d13a1dd9d022091981075ed4cde16
701701
RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39
702702
RNReanimated: 89f5e0a04d1dd52fbf27e7e7030d8f80a646a3fc
703-
RNSentry: ae1e005e4f2655775475445a9c49c1d343e8e3a7
703+
RNSentry: 7104cdfc1072ccb86015d9c8f210d81ae76806c1
704704
RNSound: da030221e6ac7e8290c6b43f2b5f2133a8e225b0
705705
RNVectorIcons: f67a1abce2ec73e62fe4606e8110e95a832bc859
706-
Sentry: 8715e88b813bde9ad37aead365d5b04ac7302153
706+
Sentry: 9d055e2de30a77685e86b219acf02e59b82091fc
707707
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
708708
UMAppLoader: 61049c8d55590b74e9ae1d5429bf68d96b4a2528
709709
UMBarCodeScannerInterface: e5e4c87797d3d01214e25cd1618866caf5d4f17f

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@react-navigation/material-top-tabs": "^5.2.19",
4242
"@react-navigation/native": "^5.7.6",
4343
"@react-navigation/stack": "^5.9.3",
44-
"@sentry/react-native": "^1.0.9",
44+
"@sentry/react-native": "^2.2.1",
4545
"@unimodules/core": "~5.3.0",
4646
"@zulip/shared": "^0.0.4",
4747
"base-64": "^0.1.0",

yarn.lock

Lines changed: 99 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,14 +2345,14 @@
23452345
dot "^1.1.1"
23462346
svgo "^1.1.1"
23472347

2348-
"@sentry/browser@^5.19.0":
2349-
version "5.20.1"
2350-
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.20.1.tgz#be59522d0914d58309e1367d997d4b3cd5385d7e"
2351-
integrity sha512-ClykuvrEsMKgAvifx5VHzRjchwYbJFX8YiIicYx+Wr3MXL2jLG6OEfHHJwJeyBL2C3vxd5O0KPK3pGMR9wPMLA==
2352-
dependencies:
2353-
"@sentry/core" "5.20.1"
2354-
"@sentry/types" "5.20.1"
2355-
"@sentry/utils" "5.20.1"
2348+
"@sentry/browser@6.2.0":
2349+
version "6.2.0"
2350+
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.2.0.tgz#4113a92bc82f55e63f30cb16a94f717bd0b95817"
2351+
integrity sha512-4r3paHcHXLemj471BtNDhUs2kvJxk5XDRplz1dbC/LHXN5PWEXP4anhGILxOlxqi4y33r53PIZu3xXFjznaVZA==
2352+
dependencies:
2353+
"@sentry/core" "6.2.0"
2354+
"@sentry/types" "6.2.0"
2355+
"@sentry/utils" "6.2.0"
23562356
tslib "^1.9.3"
23572357

23582358
"@sentry/cli@^1.52.4":
@@ -2366,68 +2366,94 @@
23662366
progress "^2.0.3"
23672367
proxy-from-env "^1.1.0"
23682368

2369-
"@sentry/core@5.20.1", "@sentry/core@^5.19.0":
2370-
version "5.20.1"
2371-
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.20.1.tgz#857cc7186931c37ff032a1bcb573600ebacde961"
2372-
integrity sha512-gG622/UY2TePruF6iUzgVrbIX5vN8w2cjlWFo1Est8MvCfQsz8agGaLMCAyl5hCGJ6K2qTUZDOlbCNIKoMclxg==
2369+
"@sentry/core@6.2.0":
2370+
version "6.2.0"
2371+
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.2.0.tgz#be1c33854fc94e1a4d867f7c2c311cf1cefb8ee9"
2372+
integrity sha512-oTr2b25l+0bv/+d6IgMamPuGleWV7OgJb0NFfd+WZhw6UDRgr7CdEJy2gW6tK8SerwXgPHdn4ervxsT3WIBiXw==
23732373
dependencies:
2374-
"@sentry/hub" "5.20.1"
2375-
"@sentry/minimal" "5.20.1"
2376-
"@sentry/types" "5.20.1"
2377-
"@sentry/utils" "5.20.1"
2374+
"@sentry/hub" "6.2.0"
2375+
"@sentry/minimal" "6.2.0"
2376+
"@sentry/types" "6.2.0"
2377+
"@sentry/utils" "6.2.0"
23782378
tslib "^1.9.3"
23792379

2380-
"@sentry/hub@5.20.1", "@sentry/hub@^5.19.0":
2381-
version "5.20.1"
2382-
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.20.1.tgz#05e83ba972a96e9d7225a64c7d3728aa9fcefc4e"
2383-
integrity sha512-Nv5BXf14BEc08acDguW6eSqkAJLVf8wki283FczEvTsQZZuSBHM9cJ5Hnehr6n+mr8wWpYLgUUYM0oXXigUmzQ==
2380+
"@sentry/hub@6.2.0":
2381+
version "6.2.0"
2382+
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.2.0.tgz#e7502652bc9608cf8fb63e43cd49df9019a28f29"
2383+
integrity sha512-BDTEFK8vlJydWXp/KMX0stvv73V7od224iLi+w3k7BcPwMKXBuURBXPU8d5XIC4G8nwg8X6cnDvwL+zBBlBbkg==
23842384
dependencies:
2385-
"@sentry/types" "5.20.1"
2386-
"@sentry/utils" "5.20.1"
2385+
"@sentry/types" "6.2.0"
2386+
"@sentry/utils" "6.2.0"
23872387
tslib "^1.9.3"
23882388

2389-
"@sentry/integrations@^5.19.0":
2390-
version "5.20.1"
2391-
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.20.1.tgz#c42dd53c2162b96bf4da641cd1c2bd53c0bbdce3"
2392-
integrity sha512-VpeZHYT8Fvw1J5478MqXXORf3Ftpt34YM4e+sTPuGrmf4Gro7lXdyownqiSaa7kwwNVQEV3zMlRDczVZzXQThw==
2389+
"@sentry/integrations@6.2.0":
2390+
version "6.2.0"
2391+
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-6.2.0.tgz#f3952cb07fd86aa1ea3923d51049fc4875b634a9"
2392+
integrity sha512-gvAhP61qs2fog2xCTDs94ZT8cZbWEjFZmOWfT1VXlZDIVopIporj5Qe6IgrLTiCWL61Yko5h5nFnPZ4mpjf+0w==
23932393
dependencies:
2394-
"@sentry/types" "5.20.1"
2395-
"@sentry/utils" "5.20.1"
2394+
"@sentry/types" "6.2.0"
2395+
"@sentry/utils" "6.2.0"
2396+
localforage "^1.8.1"
23962397
tslib "^1.9.3"
23972398

2398-
"@sentry/minimal@5.20.1":
2399-
version "5.20.1"
2400-
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.20.1.tgz#2e2b63d9cd265b7e2f593f3eab4e9874bd87eeef"
2401-
integrity sha512-2PeJKDTHNsUd1jtSLQBJ6oRI+xrIJrYDQmsyK/qs9D7HqHfs+zNAMUjYseiVeSAFGas5IcNSuZbPRV4BnuoZ0w==
2399+
"@sentry/minimal@6.2.0":
2400+
version "6.2.0"
2401+
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.2.0.tgz#718b70babb55912eeb38babaf7823d1bcdd77d1e"
2402+
integrity sha512-haxsx8/ZafhZUaGeeMtY7bJt9HbDlqeiaXrRMp1CxGtd0ZRQwHt60imEjl6IH1I73SEWxNfqScGsX2s3HzztMg==
24022403
dependencies:
2403-
"@sentry/hub" "5.20.1"
2404-
"@sentry/types" "5.20.1"
2404+
"@sentry/hub" "6.2.0"
2405+
"@sentry/types" "6.2.0"
24052406
tslib "^1.9.3"
24062407

2407-
"@sentry/react-native@^1.0.9":
2408-
version "1.6.3"
2409-
resolved "https://registry.yarnpkg.com/@sentry/react-native/-/react-native-1.6.3.tgz#80c68d6bc7f10bd4b7eb12e1b028620a1fadbcc5"
2410-
integrity sha512-0nkPV/QWEXWQb67XKy4HY9x8zLEURzBT7xaal2KUGRWu2JGObfy5eYk8+k+XsGLVAMfelCkcLQWNneUY80reng==
2411-
dependencies:
2412-
"@sentry/browser" "^5.19.0"
2413-
"@sentry/core" "^5.19.0"
2414-
"@sentry/hub" "^5.19.0"
2415-
"@sentry/integrations" "^5.19.0"
2416-
"@sentry/types" "^5.19.0"
2417-
"@sentry/utils" "^5.19.0"
2408+
"@sentry/react-native@^2.2.1":
2409+
version "2.2.1"
2410+
resolved "https://registry.yarnpkg.com/@sentry/react-native/-/react-native-2.2.1.tgz#6f88e19734d5a25bcf0e737c233811315f23b5f0"
2411+
integrity sha512-jFxPPDrUHNZfUvym34IzS8yV1HQvFyEYUAxSrSNfdmWaYCTRfnVZr2IYjaV+jSn+F4W32NhbW0m+1Gcg7XuR9Q==
2412+
dependencies:
2413+
"@sentry/browser" "6.2.0"
2414+
"@sentry/core" "6.2.0"
2415+
"@sentry/hub" "6.2.0"
2416+
"@sentry/integrations" "6.2.0"
2417+
"@sentry/react" "6.2.0"
2418+
"@sentry/tracing" "6.2.0"
2419+
"@sentry/types" "6.2.0"
2420+
"@sentry/utils" "6.2.0"
24182421
"@sentry/wizard" "^1.1.4"
24192422

2420-
"@sentry/[email protected]", "@sentry/types@^5.19.0":
2421-
version "5.20.1"
2422-
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.20.1.tgz#ccc4fa4c9d0f94d93014b04e674762d5d5cd30a2"
2423-
integrity sha512-OU+i/lcjGpDJv0XkNpsKrI2r1VPp8qX0H6Knq8NuZrlZe3AbvO3jRJJK0pH14xFv8Xok5jbZZpKKoQLxYfxqsw==
2423+
2424+
version "6.2.0"
2425+
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-6.2.0.tgz#bf46c38762554f246ca9dec527e6a5b3168fb0b0"
2426+
integrity sha512-Jf3s7om1iLpApkN26O7c3Ult3lS91ekZNC4WKtcPb6b+KOBQ36sB0d1KhL3hGZ55UKLmgZu3jn2hd7bJ9EY3yA==
2427+
dependencies:
2428+
"@sentry/browser" "6.2.0"
2429+
"@sentry/minimal" "6.2.0"
2430+
"@sentry/types" "6.2.0"
2431+
"@sentry/utils" "6.2.0"
2432+
hoist-non-react-statics "^3.3.2"
2433+
tslib "^1.9.3"
24242434

2425-
"@sentry/[email protected]", "@sentry/utils@^5.19.0":
2426-
version "5.20.1"
2427-
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.20.1.tgz#68cfae0d0e3b321b4649b59f30265024b29eae63"
2428-
integrity sha512-dhK6IdO6g7Q2CoxCbB+q8gwUapDUH5VjraFg0UBzgkrtNhtHLylqmwx0sWQvXCcp14Q/3MuzEbb4euvoh8o8oA==
2435+
"@sentry/[email protected].0":
2436+
version "6.2.0"
2437+
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.2.0.tgz#76c17e5dd3f1e61c8a4e3bd090f904a63d674765"
2438+
integrity sha512-pzgM1dePPJysVnzaFCMp+BKtjM5q46HZeyShiR+KcQYvneD3fmUPJigDkkcsB2DcrY3mFvDcswjoqxaTIW7ZBQ==
24292439
dependencies:
2430-
"@sentry/types" "5.20.1"
2440+
"@sentry/hub" "6.2.0"
2441+
"@sentry/minimal" "6.2.0"
2442+
"@sentry/types" "6.2.0"
2443+
"@sentry/utils" "6.2.0"
2444+
tslib "^1.9.3"
2445+
2446+
2447+
version "6.2.0"
2448+
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.2.0.tgz#ca020ff42913c6b9f88a9d0c375b5ee3965a2590"
2449+
integrity sha512-vN4P/a+QqAuVfWFB9G3nQ7d6bgnM9jd/RLVi49owMuqvM24pv5mTQHUk2Hk4S3k7ConrHFl69E7xH6Dv5VpQnQ==
2450+
2451+
2452+
version "6.2.0"
2453+
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.2.0.tgz#39c81ad5ba92cec54d690e3fa8ea4e777d8e9c2b"
2454+
integrity sha512-YToUC7xYf2E/pIluI7upYTlj8fKXOtdwoOBkcQZifHgX/dP+qDaHibbBFe5PyZwdmU2UiLnWFsBr0gjo0QFo1g==
2455+
dependencies:
2456+
"@sentry/types" "6.2.0"
24312457
tslib "^1.9.3"
24322458

24332459
"@sentry/wizard@^1.1.4":
@@ -6209,6 +6235,11 @@ image-size@^0.6.0:
62096235
resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.6.3.tgz#e7e5c65bb534bd7cdcedd6cb5166272a85f75fb2"
62106236
integrity sha512-47xSUiQioGaB96nqtp5/q55m0aBQSQdyIloMOc/x+QVTDZLNmXE892IIDrJ0hM1A5vcNUDD5tDffkSP5lCaIIA==
62116237

6238+
immediate@~3.0.5:
6239+
version "3.0.6"
6240+
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
6241+
integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=
6242+
62126243
immutable-devtools@^0.1.5:
62136244
version "0.1.5"
62146245
resolved "https://registry.yarnpkg.com/immutable-devtools/-/immutable-devtools-0.1.5.tgz#32a653c8ba8258bfed37680a860a3b5fa2675693"
@@ -8023,6 +8054,13 @@ levn@^0.4.1:
80238054
prelude-ls "^1.2.1"
80248055
type-check "~0.4.0"
80258056

8057+
8058+
version "3.1.1"
8059+
resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e"
8060+
integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=
8061+
dependencies:
8062+
immediate "~3.0.5"
8063+
80268064
lines-and-columns@^1.1.6:
80278065
version "1.1.6"
80288066
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00"
@@ -8064,6 +8102,13 @@ load-pkg@^3.0.1:
80648102
dependencies:
80658103
find-pkg "^0.1.0"
80668104

8105+
localforage@^1.8.1:
8106+
version "1.9.0"
8107+
resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.9.0.tgz#f3e4d32a8300b362b4634cc4e066d9d00d2f09d1"
8108+
integrity sha512-rR1oyNrKulpe+VM9cYmcFn6tsHuokyVHFaCM3+osEmxaHTbEk8oQu6eGDfS6DQLWi/N67XRmB8ECG37OES368g==
8109+
dependencies:
8110+
lie "3.1.1"
8111+
80678112
locate-path@^2.0.0:
80688113
version "2.0.0"
80698114
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"

0 commit comments

Comments
 (0)