@@ -11,14 +11,14 @@ import {
1111} from '@sentry/core' ;
1212import { captureEvent , getClient , getCurrentScope } from '@sentry/node' ;
1313import { app , ipcMain , protocol , WebContents , webContents } from 'electron' ;
14- import { eventFromEnvelope } from '../common/envelope.js' ;
14+ import { eventFromEnvelope , profileChunkFromEnvelope } from '../common/envelope.js' ;
1515import { ipcChannelUtils , IPCMode , IpcUtils , RendererStatus } from '../common/ipc.js' ;
1616import { registerProtocol } from './electron-normalize.js' ;
1717import { createRendererEventLoopBlockStatusHandler } from './integrations/renderer-anr.js' ;
1818import { rendererProfileFromIpc } from './integrations/renderer-profiling.js' ;
1919import { getOsDeviceLogAttributes } from './log.js' ;
2020import { mergeEvents } from './merge.js' ;
21- import { normalizeReplayEnvelope } from './normalize.js' ;
21+ import { normalizeProfileChunkEnvelope , normalizeReplayEnvelope } from './normalize.js' ;
2222import { ElectronMainOptionsInternal } from './sdk.js' ;
2323import { SDK_VERSION } from './version.js' ;
2424
@@ -114,9 +114,16 @@ function handleEnvelope(
114114
115115 captureEventFromRenderer ( options , event , dynamicSamplingContext , attachments , contents ) ;
116116 } else {
117- const normalizedEnvelope = normalizeReplayEnvelope ( options , envelope , app . getAppPath ( ) ) ;
118- // Pass other types of envelope straight to the transport
119- void getClient ( ) ?. getTransport ( ) ?. send ( normalizedEnvelope ) ;
117+ // Check if this is a profile_chunk envelope (from UI profiling)
118+ const profileChunk = profileChunkFromEnvelope ( envelope ) ;
119+ if ( profileChunk ) {
120+ const normalizedEnvelope = normalizeProfileChunkEnvelope ( options , envelope , app . getAppPath ( ) ) ;
121+ void getClient ( ) ?. getTransport ( ) ?. send ( normalizedEnvelope ) ;
122+ } else {
123+ const normalizedEnvelope = normalizeReplayEnvelope ( options , envelope , app . getAppPath ( ) ) ;
124+ // Pass other types of envelope straight to the transport
125+ void getClient ( ) ?. getTransport ( ) ?. send ( normalizedEnvelope ) ;
126+ }
120127 }
121128}
122129
0 commit comments