@@ -29,7 +29,7 @@ export class SdkInfo implements Integration {
2929 */
3030 public name : string = SdkInfo . id ;
3131
32- private _nativeSdkInfo : Package | null = null ;
32+ private _nativeSdkPackage : Package | null = null ;
3333
3434 /**
3535 * @inheritDoc
@@ -38,9 +38,9 @@ export class SdkInfo implements Integration {
3838 addGlobalEventProcessor ( async event => {
3939 // The native SDK info package here is only used on iOS as `beforeSend` is not called on `captureEnvelope`.
4040 // this._nativeSdkInfo should be defined a following time so this call won't always be awaited.
41- if ( NATIVE . platform === 'ios' && this . _nativeSdkInfo === null ) {
41+ if ( NATIVE . platform === 'ios' && this . _nativeSdkPackage === null ) {
4242 try {
43- this . _nativeSdkInfo = await NATIVE . fetchNativeSdkInfo ( ) ;
43+ this . _nativeSdkPackage = await NATIVE . fetchNativeSdkInfo ( ) ;
4444 } catch ( e ) {
4545 // If this fails, go ahead as usual as we would rather have the event be sent with a package missing.
4646 logger . warn (
@@ -51,14 +51,14 @@ export class SdkInfo implements Integration {
5151 }
5252
5353 event . platform = event . platform || 'javascript' ;
54- event . sdk = {
55- ... ( event . sdk ?? { } ) ,
56- ... defaultSdkInfo ,
57- packages : [
58- ... ( ( event . sdk && event . sdk . packages ) || [ ] ) ,
59- ...( ( this . _nativeSdkInfo && [ this . _nativeSdkInfo ] ) || [ ] ) ,
60- ] ,
61- } ;
54+ event . sdk = event . sdk || { } ;
55+ event . sdk . name = event . sdk . name || defaultSdkInfo . name ;
56+ event . sdk . version = event . sdk . version || defaultSdkInfo . version ;
57+ event . sdk . packages = [
58+ // default packages are added by baseclient and should not be added here
59+ ...( event . sdk . packages || [ ] ) ,
60+ ... ( ( this . _nativeSdkPackage && [ this . _nativeSdkPackage ] ) || [ ] ) ,
61+ ] ;
6262
6363 return event ;
6464 } ) ;
0 commit comments