@@ -121,7 +121,9 @@ export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Parti
121121 beforeSpanEnd ( span ) ;
122122 }
123123
124- const timestamp = args [ 0 ] || timestampInSeconds ( ) ;
124+ // Just ensuring that this keeps working, even if we ever have more arguments here
125+ const [ definedEndTimestamp , ...rest ] = args ;
126+ const timestamp = definedEndTimestamp || timestampInSeconds ( ) ;
125127 const spanEndTimestamp = spanTimeInputToSeconds ( timestamp ) ;
126128
127129 // Ensure we end with the last span timestamp, if possible
@@ -130,7 +132,7 @@ export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Parti
130132 // If we have no spans, we just end, nothing else to do here
131133 if ( ! spans . length ) {
132134 onIdleSpanEnded ( spanEndTimestamp ) ;
133- return Reflect . apply ( target , thisArg , [ spanEndTimestamp ] ) ;
135+ return Reflect . apply ( target , thisArg , [ spanEndTimestamp , ... rest ] ) ;
134136 }
135137
136138 const childEndTimestamps = spans
@@ -152,7 +154,7 @@ export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Parti
152154 ) ;
153155
154156 onIdleSpanEnded ( endTimestamp ) ;
155- return Reflect . apply ( target , thisArg , [ endTimestamp ] ) ;
157+ return Reflect . apply ( target , thisArg , [ endTimestamp , ... rest ] ) ;
156158 } ,
157159 } ) ;
158160
0 commit comments