diff --git a/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx b/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx index 8391f098332..ddd5e44a4a8 100644 --- a/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx +++ b/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx @@ -29,6 +29,12 @@ export const SentryInitEffect = () => { setIsSentryInitializing(true); try { + // oxlint-disable-next-line no-console + console.debug( + 'Initializing Sentry with DSN ending in:', + sentryConfig?.dsn?.slice(-8), + ); + const { init, browserTracingIntegration, @@ -59,6 +65,8 @@ export const SentryInitEffect = () => { ], }); + // oxlint-disable-next-line no-console + console.debug('Sentry initialized successfully'); setIsSentryInitialized(true); } catch (error) { // oxlint-disable-next-line no-console @@ -76,6 +84,12 @@ export const SentryInitEffect = () => { !isSentryUserDefined ) { try { + // oxlint-disable-next-line no-console + console.debug( + 'Setting Sentry user context for user:', + currentUser?.id, + ); + const { setUser } = await import('@sentry/react'); setUser({ email: currentUser?.email, @@ -83,6 +97,7 @@ export const SentryInitEffect = () => { workspaceId: currentWorkspace?.id, workspaceMemberId: currentWorkspaceMember?.id, }); + setIsSentryUserDefined(true); } catch (error) { // oxlint-disable-next-line no-console @@ -90,6 +105,9 @@ export const SentryInitEffect = () => { } } else if (!isDefined(currentUser) && isSentryInitialized) { try { + // oxlint-disable-next-line no-console + console.debug('Clearing Sentry user context'); + const { setUser } = await import('@sentry/react'); setUser(null); } catch (error) { diff --git a/packages/twenty-front/src/modules/file-upload/components/FileUploadProvider.tsx b/packages/twenty-front/src/modules/file-upload/components/FileUploadProvider.tsx index fc036748e7a..cbc3310d28e 100644 --- a/packages/twenty-front/src/modules/file-upload/components/FileUploadProvider.tsx +++ b/packages/twenty-front/src/modules/file-upload/components/FileUploadProvider.tsx @@ -39,11 +39,21 @@ export const FileUploadProvider = ({ try { if (!isDefined(files) || files.length === 0) { + // oxlint-disable-next-line no-console + console.debug('File upload cancelled by user'); currentOptions.onCancel?.(); } else { const filesArray = Array.from(files); + // oxlint-disable-next-line no-console + console.debug( + `File upload started: ${filesArray.length} file(s) selected`, + ); await currentOptions.onUpload(filesArray); } + } catch (error) { + // oxlint-disable-next-line no-console + console.error('File upload error:', error); + throw error; } finally { if (isDefined(fileInputRef.current)) { fileInputRef.current.value = ''; @@ -62,7 +72,12 @@ export const FileUploadProvider = ({ } try { + // oxlint-disable-next-line no-console + console.debug('File upload dialog cancelled'); currentOptions.onCancel?.(); + } catch (error) { + // oxlint-disable-next-line no-console + console.error('Error handling file upload cancel:', error); } finally { if (isDefined(fileInputRef.current)) { fileInputRef.current.value = '';