Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/update sentry #16223

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/suite-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@sentry/webpack-plugin": "^2.14.0",
"@sentry/webpack-plugin": "^2.22.7",
"@trezor/eslint": "workspace:*",
"@types/copy-webpack-plugin": "^10.1.0",
"@types/webpack-bundle-analyzer": "^4.7.0",
Expand Down
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -50,7 +50,7 @@
"@playwright/browser-firefox": "^1.49.1",
"@playwright/browser-webkit": "^1.49.1",
"@playwright/test": "^1.49.1",
"@sentry/webpack-plugin": "^2.14.0",
"@sentry/webpack-plugin": "^2.22.7",
"@trezor/trezor-user-env-link": "workspace:*",
"@trezor/type-utils": "workspace:*",
"@types/electron-localshortcut": "^3.1.3",
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),
};
Copy link
Contributor Author

@komret komret Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API change, see documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for troubles I didn't expect it could affect desktop and TS won't even complain


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.100.1",
"@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.100.1",
"@sentry/core": "^8.47.0",
"@solana/buffer-layout": "^4.0.1",
"@solana/web3.js": "^2.0.0",
"@solana/web3.js-version1": "npm:@solana/web3.js@1.95.8",
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.100.1",
"@sentry/types": "^7.100.1",
"@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://6d91ca6e6a5d4de7b47989455858b5f6@o117836.ingest.sentry.io/5193825',
autoSessionTracking: false, // do not send analytical data to Sentry
integrations: [
new CaptureConsole({
captureConsoleIntegration({
levels: ['error'],
}),
new Dedupe(),
],
Copy link
Contributor Author

@komret komret Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabled by default, see documentation.

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
Loading