Skip to content

Commit

Permalink
chore: upgrade @sentry/core, @sentry/browser, @sentry/react-native, a…
Browse files Browse the repository at this point in the history
…nd @sentry/electron
  • Loading branch information
komret committed Jan 7, 2025
1 parent 7936aa0 commit 0093ee1
Show file tree
Hide file tree
Showing 19 changed files with 885 additions and 492 deletions.
2 changes: 1 addition & 1 deletion packages/suite-desktop-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test:e2e:desktop": "yarn xvfb-maybe -- playwright test --config=./e2e/playwright.config.ts --project=desktop"
},
"dependencies": {
"@sentry/electron": "^4.24.0",
"@sentry/electron": "^5.9.0",
"@suite-common/message-system": "workspace:*",
"@suite-common/sentry": "workspace:*",
"@suite-common/suite-constants": "workspace:^",
Expand Down
16 changes: 5 additions & 11 deletions packages/suite-desktop-core/src/libs/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { init, ElectronOptions, IPCMode } from '@sentry/electron';
import { init, ElectronMainOptions, IPCMode } from '@sentry/electron/main';
import { session } from 'electron';

import { TorStatus } from '@trezor/suite-desktop-api';
Expand All @@ -20,18 +20,12 @@ export const initSentry = ({ mainThreadEmitter, store }: InitSentryParams) => {
});

const transportOptions = {
beforeSend: () => {
if (store.getTorSettings().running && torStatus !== TorStatus.Enabled) {
// If Tor is enabled but not running, don't send the event but put it in a queue.
// Queue can be inspected in @trezor/suite-desktop/sentry/queue folder.
return 'queue';
}

return 'send';
},
// If Tor is enabled but not running, don't send the event but put it in a queue.
// Queue can be inspected in @trezor/suite-desktop/sentry/queue folder.
shouldSend: () => !(store.getTorSettings().running && torStatus !== TorStatus.Enabled),
};

const sentryConfig: ElectronOptions = {
const sentryConfig: ElectronMainOptions = {
...SENTRY_CONFIG,
ipcMode: IPCMode.Classic,
getSessions: () => [session.defaultSession],
Expand Down
2 changes: 1 addition & 1 deletion packages/suite-desktop-core/src/modules/coinjoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { ipcMain } from 'electron';
import { captureMessage, withScope } from '@sentry/electron';
import { captureMessage, withScope } from '@sentry/electron/main';

import { coinjoinReportTag, coinjoinNetworkTag } from '@suite-common/sentry';
import { createIpcProxyHandler, IpcProxyHandlerOptions } from '@trezor/ipc-proxy';
Expand Down
2 changes: 1 addition & 1 deletion packages/suite-desktop-core/src/modules/request-filter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Request Filter feature (blocks non-allowed requests)
*/
import { captureMessage } from '@sentry/electron';
import { captureMessage } from '@sentry/electron/main';

import { allowedDomains } from '../config';

Expand Down
2 changes: 1 addition & 1 deletion packages/suite-desktop-core/src/modules/tor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Tor feature (toggle, configure)
*/
import { captureException } from '@sentry/electron';
import { captureException } from '@sentry/electron/main';
import { session } from 'electron';
import path from 'path';

Expand Down
2 changes: 1 addition & 1 deletion packages/suite-desktop-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint:styles": "npx stylelint './src/**/*{.ts,.tsx}' --cache --config ../../.stylelintrc"
},
"dependencies": {
"@sentry/electron": "^4.24.0",
"@sentry/electron": "^5.9.0",
"@suite-common/formatters": "workspace:*",
"@suite-common/sentry": "workspace:*",
"@suite-common/suite-types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/suite-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build": "yarn rimraf ./build && yarn workspace @trezor/suite-build run build:web"
},
"dependencies": {
"@sentry/browser": "^7.118.0",
"@sentry/browser": "^8.47.0",
"@suite-common/formatters": "workspace:*",
"@suite-common/sentry": "workspace:*",
"@suite-common/suite-types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@hookform/resolvers": "3.9.1",
"@mobily/ts-belt": "^3.13.1",
"@reduxjs/toolkit": "1.9.5",
"@sentry/core": "^7.118.0",
"@sentry/core": "^8.47.0",
"@solana/buffer-layout": "^4.0.1",
"@solana/web3.js": "^2.0.0",
"@solana/web3.js-version1": "npm:@solana/[email protected]",
Expand Down
2 changes: 0 additions & 2 deletions scripts/list-outdated-dependencies/connect-dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ postcss-styled-syntax
@sentry/core
@sentry/electron
@sentry/webpack-plugin
@sentry/integrations
@sentry/types
@sinclair/typebox
@sinclair/typebox-codegen
@hbsnow/rehype-sectionize
Expand Down
3 changes: 1 addition & 2 deletions suite-common/sentry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"type-check": "yarn g:tsc --build"
},
"dependencies": {
"@sentry/integrations": "^7.118.0",
"@sentry/types": "^7.118.0",
"@sentry/core": "^8.47.0",
"@suite-common/suite-utils": "workspace:*",
"@trezor/utils": "workspace:*"
}
Expand Down
6 changes: 2 additions & 4 deletions suite-common/sentry/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CaptureConsole, Dedupe } from '@sentry/integrations';
import type { Options, Event as SentryEvent } from '@sentry/types';
import { captureConsoleIntegration, Options, Event as SentryEvent } from '@sentry/core';

import { isDevEnv } from '@suite-common/suite-utils';
import { redactUserPathFromString } from '@trezor/utils';
Expand Down Expand Up @@ -94,10 +93,9 @@ export const SENTRY_CONFIG: Options = {
dsn: 'https://[email protected]/5193825',
autoSessionTracking: false, // do not send analytical data to Sentry
integrations: [
new CaptureConsole({
captureConsoleIntegration({
levels: ['error'],
}),
new Dedupe(),
],
beforeSend,
enabled: !isDevEnv,
Expand Down
4 changes: 2 additions & 2 deletions suite-native/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"@react-navigation/native": "6.1.18",
"@react-navigation/native-stack": "6.11.0",
"@reduxjs/toolkit": "1.9.5",
"@sentry/core": "8.34.0",
"@sentry/react-native": "6.1.0",
"@sentry/core": "8.47.0",
"@sentry/react-native": "6.5.0",
"@shopify/flash-list": "^1.7.2",
"@shopify/react-native-skia": "^1.5.10",
"@suite-common/analytics": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion suite-native/device/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@mobily/ts-belt": "^3.13.1",
"@react-navigation/native": "6.1.18",
"@reduxjs/toolkit": "1.9.5",
"@sentry/react-native": "6.1.0",
"@sentry/react-native": "6.5.0",
"@suite-common/redux-utils": "workspace:*",
"@suite-common/wallet-core": "workspace:*",
"@suite-common/wallet-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion suite-native/graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@mobily/ts-belt": "^3.13.1",
"@react-navigation/native": "6.1.18",
"@reduxjs/toolkit": "1.9.5",
"@sentry/react-native": "6.1.0",
"@sentry/react-native": "6.5.0",
"@shopify/react-native-skia": "^1.5.10",
"@suite-common/formatters": "workspace:*",
"@suite-common/graph": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion suite-native/module-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@mobily/ts-belt": "^3.13.1",
"@react-navigation/native-stack": "6.11.0",
"@sentry/react-native": "6.1.0",
"@sentry/react-native": "6.5.0",
"@suite-common/message-system": "workspace:*",
"@suite-common/wallet-core": "workspace:*",
"@suite-native/atoms": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion suite-native/navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@react-navigation/bottom-tabs": "6.6.1",
"@react-navigation/native": "6.1.18",
"@react-navigation/native-stack": "6.11.0",
"@sentry/react-native": "6.1.0",
"@sentry/react-native": "6.5.0",
"@suite-common/message-system": "workspace:*",
"@suite-common/wallet-config": "workspace:*",
"@suite-common/wallet-types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion suite-native/state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@reduxjs/toolkit": "1.9.5",
"@sentry/react-native": "6.1.0",
"@sentry/react-native": "6.5.0",
"@suite-common/analytics": "workspace:*",
"@suite-common/firmware": "workspace:*",
"@suite-common/logger": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion suite-native/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@mobily/ts-belt": "^3.13.1",
"@reduxjs/toolkit": "1.9.5",
"@sentry/react-native": "6.1.0",
"@sentry/react-native": "6.5.0",
"@suite-common/suite-types": "workspace:*",
"@suite-common/wallet-core": "workspace:*",
"bs58": "^6.0.0",
Expand Down
Loading

0 comments on commit 0093ee1

Please sign in to comment.