@@ -121,9 +121,6 @@ export class Hub implements HubInterface {
121121 /** Is a {@link Layer}[] containing the client and scope */
122122 private readonly _stack : Layer [ ] ;
123123
124- /** Contains the last event id of a captured event. */
125- private _lastEventId ?: string ;
126-
127124 private _isolationScope : Scope ;
128125
129126 /**
@@ -354,7 +351,7 @@ export class Hub implements HubInterface {
354351 * @deprecated Use `Sentry.captureException()` instead.
355352 */
356353 public captureException ( exception : unknown , hint ?: EventHint ) : string {
357- const eventId = ( this . _lastEventId = hint && hint . event_id ? hint . event_id : uuid4 ( ) ) ;
354+ const eventId = hint && hint . event_id ? hint . event_id : uuid4 ( ) ;
358355 const syntheticException = new Error ( 'Sentry syntheticException' ) ;
359356 // eslint-disable-next-line deprecation/deprecation
360357 this . getScope ( ) . captureException ( exception , {
@@ -373,7 +370,7 @@ export class Hub implements HubInterface {
373370 * @deprecated Use `Sentry.captureMessage()` instead.
374371 */
375372 public captureMessage ( message : string , level ?: SeverityLevel , hint ?: EventHint ) : string {
376- const eventId = ( this . _lastEventId = hint && hint . event_id ? hint . event_id : uuid4 ( ) ) ;
373+ const eventId = hint && hint . event_id ? hint . event_id : uuid4 ( ) ;
377374 const syntheticException = new Error ( message ) ;
378375 // eslint-disable-next-line deprecation/deprecation
379376 this . getScope ( ) . captureMessage ( message , level , {
@@ -393,23 +390,11 @@ export class Hub implements HubInterface {
393390 */
394391 public captureEvent ( event : Event , hint ?: EventHint ) : string {
395392 const eventId = hint && hint . event_id ? hint . event_id : uuid4 ( ) ;
396- if ( ! event . type ) {
397- this . _lastEventId = eventId ;
398- }
399393 // eslint-disable-next-line deprecation/deprecation
400394 this . getScope ( ) . captureEvent ( event , { ...hint , event_id : eventId } ) ;
401395 return eventId ;
402396 }
403397
404- /**
405- * @inheritDoc
406- *
407- * @deprecated This will be removed in v8.
408- */
409- public lastEventId ( ) : string | undefined {
410- return this . _lastEventId ;
411- }
412-
413398 /**
414399 * @inheritDoc
415400 *
0 commit comments