build: remove sentry integration

This commit is contained in:
kangfenmao 2025-04-24 11:48:53 +08:00
parent 7a7b24fe2f
commit 25b1e309ed
12 changed files with 16 additions and 1160 deletions

3
.gitignore vendored
View File

@ -51,6 +51,3 @@ local
coverage
.vitest-cache
vitest.config.*.timestamp-*
# Sentry Config File
.env.sentry-build-plugin

View File

@ -1,4 +1,3 @@
import { sentryVitePlugin } from '@sentry/vite-plugin'
import react from '@vitejs/plugin-react-swc'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import { resolve } from 'path'
@ -65,11 +64,6 @@ export default defineConfig({
]
]
}),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'cherry-ai',
project: 'cherry-studio'
}),
...visualizerPlugin('renderer')
],
resolve: {

View File

@ -72,7 +72,6 @@
"@langchain/community": "^0.3.36",
"@mozilla/readability": "^0.6.0",
"@notionhq/client": "^2.2.15",
"@sentry/electron": "^6.5.0",
"@strongtz/win32-arm64-msvc": "^0.4.7",
"@tryfabric/martian": "^1.2.4",
"@types/react-infinite-scroll-component": "^5.0.0",
@ -127,8 +126,6 @@
"@modelcontextprotocol/sdk": "^1.9.0",
"@notionhq/client": "^2.2.15",
"@reduxjs/toolkit": "^2.2.5",
"@sentry/react": "^9.13.0",
"@sentry/vite-plugin": "^3.3.1",
"@swc/plugin-styled-components": "^7.1.3",
"@tavily/core": "patch:@tavily/core@npm%3A0.3.1#~/.yarn/patches/@tavily-core-npm-0.3.1-fe69bf2bea.patch",
"@tryfabric/martian": "^1.2.4",

View File

@ -160,7 +160,4 @@ export enum IpcChannel {
SearchWindow_Open = 'search-window:open',
SearchWindow_Close = 'search-window:close',
SearchWindow_OpenUrl = 'search-window:open-url',
// sentry
Sentry_Init = 'sentry:init'
}

View File

@ -5,7 +5,6 @@ import { app, ipcMain } from 'electron'
import installExtension, { REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } from 'electron-devtools-installer'
import Logger from 'electron-log'
import { initSentry } from './integration/sentry'
import { registerIpc } from './ipc'
import { configManager } from './services/ConfigManager'
import mcpService from './services/MCPService'
@ -112,4 +111,3 @@ if (!app.requestSingleInstanceLock()) {
// code. You can also put them in separate files and require them here.
}
initSentry()

View File

@ -1,12 +0,0 @@
import { configManager } from '@main/services/ConfigManager'
import * as Sentry from '@sentry/electron/main'
import { app } from 'electron'
export function initSentry() {
if (configManager.getEnableDataCollection()) {
Sentry.init({
dsn: 'https://194ceab3bd44e686bd3ebda9de3c20fd@o4509184559218688.ingest.us.sentry.io/4509184569442304',
environment: app.isPackaged ? 'production' : 'development'
})
}
}

View File

@ -9,7 +9,6 @@ import { BrowserWindow, ipcMain, session, shell } from 'electron'
import log from 'electron-log'
import { titleBarOverlayDark, titleBarOverlayLight } from './config'
import { initSentry } from './integration/sentry'
import AppUpdater from './services/AppUpdater'
import BackupManager from './services/BackupManager'
import { configManager } from './services/ConfigManager'
@ -343,7 +342,4 @@ export function registerIpc(mainWindow: BrowserWindow, app: Electron.App) {
ipcMain.handle(IpcChannel.SearchWindow_OpenUrl, async (_, uid: string, url: string) => {
return await searchService.openUrlInSearchWindow(uid, url)
})
// sentry
ipcMain.handle(IpcChannel.Sentry_Init, () => initSentry())
}

View File

@ -33,9 +33,6 @@ declare global {
setAutoUpdate: (isActive: boolean) => void
reload: () => void
clearCache: () => Promise<{ success: boolean; error?: string }>
sentry: {
init: () => Promise<void>
}
system: {
getDeviceType: () => Promise<'mac' | 'windows' | 'linux'>
getHostname: () => Promise<string>

View File

@ -23,9 +23,6 @@ const api = {
setAutoUpdate: (isActive: boolean) => ipcRenderer.invoke(IpcChannel.App_SetAutoUpdate, isActive),
openWebsite: (url: string) => ipcRenderer.invoke(IpcChannel.Open_Website, url),
clearCache: () => ipcRenderer.invoke(IpcChannel.App_ClearCache),
sentry: {
init: () => ipcRenderer.invoke(IpcChannel.Sentry_Init)
},
system: {
getDeviceType: () => ipcRenderer.invoke(IpcChannel.System_GetDeviceType),
getHostname: () => ipcRenderer.invoke(IpcChannel.System_GetHostname)

View File

@ -3,7 +3,6 @@ import { isLocalAi } from '@renderer/config/env'
import { useTheme } from '@renderer/context/ThemeProvider'
import db from '@renderer/databases'
import i18n from '@renderer/i18n'
import { initSentry } from '@renderer/init'
import { useAppDispatch } from '@renderer/store'
import { setAvatar, setFilesPath, setResourcesPath, setUpdateState } from '@renderer/store/runtime'
import { delay, runAsyncFunction } from '@renderer/utils'
@ -106,6 +105,6 @@ export function useAppInit() {
}, [customCss])
useEffect(() => {
enableDataCollection && initSentry()
// TODO: init data collection
}, [enableDataCollection])
}

View File

@ -1,6 +1,4 @@
import KeyvStorage from '@kangfenmao/keyv-storage'
import * as Sentry from '@sentry/electron/renderer'
import { init as reactInit } from '@sentry/react'
import { startAutoSync } from './services/BackupService'
import { startNutstoreAutoSync } from './services/NutstoreService'
@ -31,17 +29,6 @@ function initAutoSync() {
}, 8000)
}
export function initSentry() {
Sentry.init(
{
sendDefaultPii: true,
tracesSampleRate: 1.0,
integrations: [Sentry.browserTracingIntegration()]
},
reactInit as any
)
}
initSpinner()
initKeyv()
initAutoSync()

1121
yarn.lock

File diff suppressed because it is too large Load Diff