File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ export function minidumpUrlFromDsn(dsn: string): string | undefined {
9696export const electronMinidumpIntegration = defineIntegration ( ( ) => {
9797 /** Counter used to ensure no race condition when updating extra params */
9898 let updateEpoch = 0 ;
99+ let lastParamCount = 0 ;
99100
100101 async function getNativeUploaderEvent ( client : NodeClient , scope : ScopeData ) : Promise < Event > {
101102 const { sendDefaultPii = false } = client . getOptions ( ) ;
@@ -128,9 +129,21 @@ export const electronMinidumpIntegration = defineIntegration(() => {
128129
129130 // Update the extra parameters in the main process
130131 const mainParams = getNativeUploaderExtraParams ( event ) ;
132+ const count = Object . keys ( mainParams ) . length ;
133+
134+ // Remove any extra parameters that extend beyond the current count
135+ if ( lastParamCount > count ) {
136+ for ( let i = count + 1 ; i <= lastParamCount ; i ++ ) {
137+ crashReporter . removeExtraParameter ( `sentry__${ i } ` ) ;
138+ }
139+ }
140+
131141 for ( const [ key , value ] of Object . entries ( mainParams ) ) {
132142 crashReporter . addExtraParameter ( key , value ) ;
133143 }
144+
145+ // Track how many parameters we added so we can remove extras next time
146+ lastParamCount = count ;
134147 } )
135148 . catch ( ( error ) => debug . error ( error ) ) ;
136149 }
You can’t perform that action at this time.
0 commit comments