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

[Cleanup] Remove electronAPI.sendErrorToSentry #609

Merged
merged 1 commit into from
Jan 14, 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
1 change: 0 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const IPC_CHANNELS = {
DELETE_MODEL: 'delete-model',
GET_ALL_DOWNLOADS: 'get-all-downloads',
GET_ELECTRON_VERSION: 'get-electron-version',
SEND_ERROR_TO_SENTRY: 'send-error-to-sentry',
GET_BASE_PATH: 'get-base-path',
GET_MODEL_CONFIG_PATH: 'get-model-config-path',
OPEN_PATH: 'open-path',
Expand Down
23 changes: 0 additions & 23 deletions src/main-process/comfyDesktopApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,29 +122,6 @@ export class ComfyDesktopApp {
log.info('Reinstalling...');
await this.reinstall();
});
type SentryErrorDetail = {
error: string;
extras?: Record<string, unknown>;
};

ipcMain.handle(
IPC_CHANNELS.SEND_ERROR_TO_SENTRY,
// eslint-disable-next-line @typescript-eslint/require-await
async (_event, { error, extras }: SentryErrorDetail): Promise<string | null> => {
try {
return Sentry.captureMessage(error, {
level: 'error',
extra: { ...extras, comfyUIExecutionError: true },
tags: {
comfyorigin: 'core',
},
});
} catch (error_) {
log.error('Failed to send error to Sentry:', error_);
return null;
}
}
);
// Restart core
ipcMain.handle(IPC_CHANNELS.RESTART_CORE, async (): Promise<boolean> => {
if (!this.comfyServer) return false;
Expand Down
8 changes: 0 additions & 8 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,6 @@ const electronAPI = {
},
/** The ComfyUI core version (as defined in package.json) */
getComfyUIVersion: () => __COMFYUI_VERSION__,
/**
* Send an error message to Sentry
* @param error The error object or message to send
* @param extras Optional additional context/data to attach
*/
sendErrorToSentry: (error: string, extras?: Record<string, unknown>) => {
return ipcRenderer.invoke(IPC_CHANNELS.SEND_ERROR_TO_SENTRY, { error, extras });
},
Terminal: {
/**
* Writes the data to the terminal
Expand Down
5 changes: 1 addition & 4 deletions src/services/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ class SentryLogging {
beforeSend: async (event) => {
this.filterEvent(event);

if (
event.extra?.comfyUIExecutionError ||
this.comfyDesktopApp?.comfySettings.get('Comfy-Desktop.SendStatistics')
) {
if (this.comfyDesktopApp?.comfySettings.get('Comfy-Desktop.SendStatistics')) {
return event;
}

Expand Down
Loading