Skip to content

Commit

Permalink
Update sentry & fix android source maps (#1415)
Browse files Browse the repository at this point in the history
* fix sentry sourcemaps

* update native logs
  • Loading branch information
brunobar79 authored Dec 3, 2020
1 parent 773d3a0 commit 8da0db7
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 81 deletions.
1 change: 0 additions & 1 deletion android/sentry.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
defaults.url=https://sentry.io/
defaults.org=rainbow-me
defaults.project=rainbow-wallet
cli.executable=node_modules/@sentry/cli/bin/sentry-cli
22 changes: 11 additions & 11 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ PODS:
- React-Core
- react-native-camera/RN (3.40.0):
- React-Core
- react-native-cloud-fs (2.1.0):
- react-native-cloud-fs (2.3.0):
- React
- react-native-get-random-values (1.5.0):
- React
Expand Down Expand Up @@ -534,9 +534,9 @@ PODS:
- Yoga
- RNScreens (2.9.0):
- React
- RNSentry (1.4.5):
- React
- Sentry (~> 5.1.4)
- RNSentry (2.0.2):
- React-Core
- Sentry (= 6.0.9)
- RNStoreReview (0.1.5):
- React
- RNSVG (12.1.0):
Expand All @@ -553,9 +553,9 @@ PODS:
- SDWebImageWebPCoder (0.6.1):
- libwebp (~> 1.0)
- SDWebImage/Core (~> 5.7)
- Sentry (5.1.10):
- Sentry/Core (= 5.1.10)
- Sentry/Core (5.1.10)
- Sentry (6.0.9):
- Sentry/Core (= 6.0.9)
- Sentry/Core (6.0.9)
- SexyTooltip (1.2.7):
- pop (~> 1.0)
- Shimmer (1.0.2)
Expand Down Expand Up @@ -960,7 +960,7 @@ SPEC CHECKSUMS:
react-native-blur: cad4d93b364f91e7b7931b3fa935455487e5c33c
react-native-branch: 8bda99ca8dc5a16d32bd81c8a8d937cb3d2c5e0c
react-native-camera: 35854c4f764a4a6cf61c1c3525888b92f0fe4b31
react-native-cloud-fs: 8339f6e6e353f266f63a3f754882637443bc4c2c
react-native-cloud-fs: 1cb3deba691efbb5c6fcc831959be58762d8bdfe
react-native-get-random-values: 1404bd5cc0ab0e287f75ee1c489555688fc65f89
react-native-mail: a864fb211feaa5845c6c478a3266de725afdce89
react-native-netinfo: 250dc0ca126512f618a8a2ca6a936577e1f66586
Expand Down Expand Up @@ -1009,14 +1009,14 @@ SPEC CHECKSUMS:
RNReactNativeHapticFeedback: 653a8c126a0f5e88ce15ffe280b3ff37e1fbb285
RNReanimated: 2041d58f790987a36052d777e34c1f82635c2ef3
RNScreens: c526239bbe0e957b988dacc8d75ac94ec9cb19da
RNSentry: 0a70359ddacbfb9b1cbbb0971e54065b9f70ac57
RNSentry: 5ebc2926dbcbb9b77857ba6df0754a869037123d
RNStoreReview: 62d6afd7c37db711a594bbffca6b0ea3a812b7a8
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
RNTextSize: 21c94a67819fbf2c358a219bf6d251e3be9e5f29
RNTooltips: e13180e4339e2a85daabd09507f62a5a32d3dc8a
SDWebImage: a31ee8e90a97303529e03fb0c333eae0eacb88e9
SDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21
Sentry: 8715e88b813bde9ad37aead365d5b04ac7302153
Sentry: 388c9dc093b2fd3a264466a5c5b21e25959610a9
SexyTooltip: e243da5a858c7160141cf35786a4033669d1efca
Shimmer: c5374be1c2b0c9e292fb05b339a513cf291cac86
SRSRadialGradient: 7f9c92f2b31576ab80f059378ef2817404cd0575
Expand All @@ -1029,4 +1029,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 2b38dc4e50f6b19e7a7db1e41739f3209e9d05e6

COCOAPODS: 1.9.1
COCOAPODS: 1.10.0
15 changes: 15 additions & 0 deletions ios/Rainbow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
E5BAA1201450F6CFF8A6C0D3 /* [CP] Copy Pods Resources */,
A4451ED5032E4036E311CE0C /* [CP-User] [RNFB] Crashlytics Configuration */,
9FF961FEA7AF435FA18ED988 /* Upload Debug Symbols to Sentry */,
);
buildRules = (
);
Expand Down Expand Up @@ -527,6 +528,20 @@
shellScript = "export SENTRY_PROPERTIES=sentry.properties\nexport NODE_ARGS=--max-old-space-size=2048\nif [[ ! \"$CONFIGURATION\" = *Debug* ]]; then\n DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\n export EXTRA_PACKAGER_ARGS=\"--sourcemap-output $DEST/main.jsbundle.map\"\nfi\n\n../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh\n\nif [[ ! \"$CONFIGURATION\" = *Debug* ]]; then\n cp $DEST/main.jsbundle* ../ios/\nfi\n";
showEnvVarsInLog = 0;
};
9FF961FEA7AF435FA18ED988 /* Upload Debug Symbols to Sentry */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Upload Debug Symbols to Sentry";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export SENTRY_PROPERTIES=sentry.properties\n../node_modules/@sentry/cli/bin/sentry-cli upload-dsym";
};
A4451ED5032E4036E311CE0C /* [CP-User] [RNFB] Crashlytics Configuration */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
11 changes: 3 additions & 8 deletions ios/Rainbow/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,9 @@ - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserAct
- (void)applicationWillTerminate:(UIApplication *)application {

if(self.isRapRunning){

NSDictionary *event = @{@"message": @"applicationWillTerminate was called"};

NSData *jsonData = [NSJSONSerialization dataWithJSONObject:event
options:0
error:nil];

SentryEvent *sentryEvent = [[SentryEvent alloc] initWithJSON:jsonData];
SentryMessage *msg = [[SentryMessage alloc] initWithFormatted:@"applicationWillTerminate was called"];
SentryEvent *sentryEvent = [[SentryEvent alloc] init];
[sentryEvent setMessage: msg];
[SentrySDK captureEvent:sentryEvent];
}

Expand Down
1 change: 0 additions & 1 deletion ios/sentry.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
defaults.url=https://sentry.io/
defaults.org=rainbow-me
defaults.project=rainbow-wallet
cli.executable=node_modules/@sentry/cli/bin/sentry-cli
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@react-navigation/native": "^5.5.1",
"@react-navigation/stack": "^5.9.3",
"@segment/analytics-react-native": "^1.3.1",
"@sentry/react-native": "1.4.5",
"@sentry/react-native": "2.0.2",
"@tradle/react-native-http": "^2.0.1",
"@types/i18n-js": "^3.0.3",
"@types/lodash": "^4.14.159",
Expand Down Expand Up @@ -228,6 +228,7 @@
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"@sentry/cli": "^1.60.1",
"@babel/core": "^7.10.4",
"@babel/plugin-transform-react-inline-elements": "^7.9.0",
"@babel/plugin-transform-runtime": "^7.9.0",
Expand Down
26 changes: 21 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import messaging from '@react-native-firebase/messaging';
import analytics from '@segment/analytics-react-native';
import { init as initSentry, setRelease } from '@sentry/react-native';
import * as Sentry from '@sentry/react-native';
import { get } from 'lodash';
import nanoid from 'nanoid/non-secure';
import PropTypes from 'prop-types';
Expand Down Expand Up @@ -68,16 +68,32 @@ if (__DEV__) {
(showNetworkRequests || showNetworkResponses) &&
monitorNetwork(showNetworkRequests, showNetworkResponses);
} else {
initSentry({ dsn: SENTRY_ENDPOINT, environment: SENTRY_ENVIRONMENT });
let sentryOptions = {
dsn: SENTRY_ENDPOINT,
enableAutoSessionTracking: true,
environment: SENTRY_ENVIRONMENT,
release: `me.rainbow-${VersionNumber.appVersion}`,
};

if (android) {
const dist = VersionNumber.buildVersion;
// In order for sourcemaps to work on android,
// the release needs to be named with the following format
// [email protected]+4
const releaseName = `me.rainbow@${VersionNumber.appVersion}+${dist}`;
sentryOptions.release = releaseName;
// and we also need to manually set the dist to the versionCode value
sentryOptions.dist = dist.toString();
}
Sentry.init(sentryOptions);
}

CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING).then(update => {
if (update) {
setRelease(
// eslint-disable-next-line import/no-deprecated
Sentry.setRelease(
`me.rainbow-${VersionNumber.appVersion}-codepush:${update.label}`
);
} else {
setRelease(`me.rainbow-${VersionNumber.appVersion}`);
}
});

Expand Down
132 changes: 78 additions & 54 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2423,14 +2423,14 @@
resolved "https://registry.yarnpkg.com/@segment/analytics-react-native/-/analytics-react-native-1.3.1.tgz#155945e97898a1ddb507067e68ac9419424d963b"
integrity sha512-8tEmQPA1WfqHJBCaCtXyTxpLe3vtBP7BSqrx9PN65q4VE/ZS+kvetSkeexNMDWYqEomzSEZlnqutH56Uu0w2OQ==

"@sentry/browser@^5.16.1":
version "5.26.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.26.0.tgz#e90a197fb94c5f26c8e05d6a539c118f33c7d598"
integrity sha512-52kNVpy10Zd3gJRGFkhnOQvr80WJg7+XBqjMOE0//Akh4PfvEK3IqmAjVqysz6aHdruwTTivKF4ZoAxL/pA7Rg==
dependencies:
"@sentry/core" "5.26.0"
"@sentry/types" "5.26.0"
"@sentry/utils" "5.26.0"
"@sentry/browser@5.27.4":
version "5.27.4"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.27.4.tgz#241dedc7d82d3ed2769bfc8e4fb193d10e6a1d4d"
integrity sha512-L8Fsnkl3PIak4zJ1pcGDmV92XTQjS2/H6EBgp1rhuOF4OE3L59K8RR73C9w+wVtsIi7nyfYg/FIe8lvG++3Mow==
dependencies:
"@sentry/core" "5.27.4"
"@sentry/types" "5.27.4"
"@sentry/utils" "5.27.4"
tslib "^1.9.3"

"@sentry/cli@^1.52.4":
Expand All @@ -2444,69 +2444,93 @@
progress "^2.0.3"
proxy-from-env "^1.1.0"

"@sentry/[email protected]", "@sentry/core@^5.16.1":
version "5.26.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.26.0.tgz#9b5fe4de8a869d733ebcc77f5ec9c619f8717a51"
integrity sha512-Ubrw7K52orTVsaxpz8Su40FPXugKipoQC+zPrXcH+JIMB+o18kutF81Ae4WzuUqLfP7YB91eAlRrP608zw0EXA==
"@sentry/cli@^1.60.1":
version "1.60.1"
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.60.1.tgz#ec42f84f44e329f6d1da77051afe15284352e06c"
integrity sha512-pShmK+V4jWxSsdM2LPZm5nyaG8sS5m1ukSZiJdmE0jpj4G4aXM4B1pRovv9ePSkoJdAGnpesX+A/zEvISa8FOw==
dependencies:
"@sentry/hub" "5.26.0"
"@sentry/minimal" "5.26.0"
"@sentry/types" "5.26.0"
"@sentry/utils" "5.26.0"
https-proxy-agent "^5.0.0"
mkdirp "^0.5.5"
node-fetch "^2.6.0"
progress "^2.0.3"
proxy-from-env "^1.1.0"

"@sentry/[email protected]":
version "5.27.4"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.27.4.tgz#4155ee09ee4deed7364918094bf81654dcf681c0"
integrity sha512-IbI37cIZU/qBQouuUXaLbGF/9xYFp5STqmj1Gv64l0IZe4JnEp06V3yD5GxQ/mJ78vSfOqfwLooVCUw9FA61sQ==
dependencies:
"@sentry/hub" "5.27.4"
"@sentry/minimal" "5.27.4"
"@sentry/types" "5.27.4"
"@sentry/utils" "5.27.4"
tslib "^1.9.3"

"@sentry/hub@5.26.0", "@sentry/hub@^5.16.1":
version "5.26.0"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.26.0.tgz#b2bbd8128cd5915f2ee59cbc29fff30272d74ec5"
integrity sha512-lAYeWvvhGYS6eQ5d0VEojw0juxGc3v4aAu8VLvMKWcZ1jXD13Bhc46u9Nvf4qAY6BAQsJDQcpEZLpzJu1bk1Qw==
"@sentry/hub@5.27.4":
version "5.27.4"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.27.4.tgz#15db6f504672edd70b793e4b3d370dca9cb2fef6"
integrity sha512-Ba1AqcjvSd2S+fpdXtXCrVXdrzq9E2Etb2eHUOkEYwSsq7StMOw7E8YHDPAo+to8zUbpMPz/Z9XGhFkyAbImGQ==
dependencies:
"@sentry/types" "5.26.0"
"@sentry/utils" "5.26.0"
"@sentry/types" "5.27.4"
"@sentry/utils" "5.27.4"
tslib "^1.9.3"

"@sentry/integrations@^5.16.1":
version "5.26.0"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.26.0.tgz#cf90005359862c5b1df4df0f1ce8be5e56c9e1ad"
integrity sha512-XBMPm3wWW+3EJvWFHdVcl0PSWjjNEzmQxjjWeMv9vLWAC1zhS8gcpk/LyDIFWojJBzhASD8f1mLv2ZdKZtA1ZQ==
"@sentry/integrations@5.27.4":
version "5.27.4"
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.27.4.tgz#a048a2e9cbc65575a70a54dd0cae5bce2130d55e"
integrity sha512-/2KRNrpbRDatNfurKzhpeYa5YQCYSXgR2JbPGQzg8d3fKggSTDLiVxrc+LC7oHeHgv6LWOzkVVzfmB01LJRZTA==
dependencies:
"@sentry/types" "5.26.0"
"@sentry/utils" "5.26.0"
"@sentry/types" "5.27.4"
"@sentry/utils" "5.27.4"
localforage "1.8.1"
tslib "^1.9.3"

"@sentry/minimal@5.26.0":
version "5.26.0"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.26.0.tgz#851dea3644153ed3ac4837fa8ed5661d94e7a313"
integrity sha512-mdFo3FYaI1W3KEd8EHATYx8mDOZIxeoUhcBLlH7Iej6rKvdM7p8GoECrmHPU1l6sCCPtBuz66QT5YeXc7WILsA==
"@sentry/minimal@5.27.4":
version "5.27.4"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.27.4.tgz#2b331ed43d5f8999606fe9f8bf26a85155e8286c"
integrity sha512-biw5YfIQwvDoaRhLarfeRQ6MJ9UJOoDTmu8Kgg18prJy4rtfDowNJP0OBs5XAsTk6SWAXiE3g7vqUJBXgs7BWA==
dependencies:
"@sentry/hub" "5.26.0"
"@sentry/types" "5.26.0"
"@sentry/hub" "5.27.4"
"@sentry/types" "5.27.4"
tslib "^1.9.3"

"@sentry/[email protected]":
version "1.4.5"
resolved "https://registry.yarnpkg.com/@sentry/react-native/-/react-native-1.4.5.tgz#bbbd431604e8436309c3b385904856708768cb52"
integrity sha512-Ruh3992WsaNSDwwV8b3KFyus6INK45ZwG1TvpvJLh/Dsq7YfWcSymdJXPqEI+xSgDSft1qlIbwptyVvLCHMWlA==
dependencies:
"@sentry/browser" "^5.16.1"
"@sentry/core" "^5.16.1"
"@sentry/hub" "^5.16.1"
"@sentry/integrations" "^5.16.1"
"@sentry/types" "^5.16.1"
"@sentry/utils" "^5.16.1"
"@sentry/[email protected]":
version "2.0.2"
resolved "https://registry.yarnpkg.com/@sentry/react-native/-/react-native-2.0.2.tgz#e53793592184071b703a22580de59a8d7edcff8c"
integrity sha512-NEsXgWkTqXJlr5RNr4l/im5CVJsrvIrnfzpFSzyj74+1WQaNSr1JuuL+gGphpVK5QNkiAlu2epbwfu7esh/fwA==
dependencies:
"@sentry/browser" "5.27.4"
"@sentry/core" "5.27.4"
"@sentry/hub" "5.27.4"
"@sentry/integrations" "5.27.4"
"@sentry/react" "5.27.4"
"@sentry/types" "5.27.4"
"@sentry/utils" "5.27.4"
"@sentry/wizard" "^1.1.4"

"@sentry/[email protected]", "@sentry/types@^5.16.1":
version "5.26.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.26.0.tgz#b0cbacb0b24cd86620fb296b46cf7277bb004a3e"
integrity sha512-ugpa1ePOhK55pjsyutAsa2tiJVQEyGYCaOXzaheg/3+EvhMdoW+owiZ8wupfvPhtZFIU3+FPOVz0d5k9K5d1rw==
"@sentry/[email protected]":
version "5.27.4"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-5.27.4.tgz#757983dda2b2c8782d4c3a73c85806bb21ec93ed"
integrity sha512-nRv/u2nP4cQMWu1Gybv7izIl2VwcM6s6P2hco9RlxrCJUpQIUuHRo4yWqDn+G1Xxdr511yY8p4JR+ESBaRGJFg==
dependencies:
"@sentry/browser" "5.27.4"
"@sentry/minimal" "5.27.4"
"@sentry/types" "5.27.4"
"@sentry/utils" "5.27.4"
hoist-non-react-statics "^3.3.2"
tslib "^1.9.3"

"@sentry/[email protected]":
version "5.27.4"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.27.4.tgz#ba7cefae6f77bb39a0ac59aeba1bb23ce4ad5216"
integrity sha512-41h3c7tgtSS8UBmfvEckSr+7V7/IVOjt/EiydyOd6s0N18zSFfGY5HdA6g+eFtIJK3DhWkUHCHZNanD5IY5YCQ==

"@sentry/utils@5.26.0", "@sentry/utils@^5.16.1":
version "5.26.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.26.0.tgz#09a3d01d91747f38f796cafeb24f8fd86e4fa05f"
integrity sha512-F2gnHIAWbjiowcAgxz3VpKxY/NQ39NTujEd/NPnRTWlRynLFg3bAV+UvZFXljhYJeN3b/zRlScNDcpCWTrtZGw==
"@sentry/utils@5.27.4":
version "5.27.4"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.27.4.tgz#d57ccd72a56e2f97e109d632957f6cd11806e992"
integrity sha512-shV1I/q+Tob3hUxRj11DfMhe9PNDiv85hUUoRloZGGwu275dMwpswb2uwgSmjc2Ao4pnMKVx8TL1hC3kGLVHTQ==
dependencies:
"@sentry/types" "5.26.0"
"@sentry/types" "5.27.4"
tslib "^1.9.3"

"@sentry/wizard@^1.1.4":
Expand Down

0 comments on commit 8da0db7

Please sign in to comment.