Skip to content

Commit 9f0ac34

Browse files
author
Luca Forstner
authored
ref: Remove lastEventId (#10585)
After the deprecation in v7 we now remove `lastEventId`.
1 parent ee9a9d6 commit 9f0ac34

File tree

23 files changed

+3
-113
lines changed

23 files changed

+3
-113
lines changed

packages/astro/src/index.server.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ export {
5858
defaultIntegrations,
5959
getDefaultIntegrations,
6060
defaultStackParser,
61-
// eslint-disable-next-line deprecation/deprecation
62-
lastEventId,
6361
flush,
6462
close,
6563
getSentryRelease,

packages/astro/src/index.types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,4 @@ export declare const defaultStackParser: StackParser;
2626
export declare function close(timeout?: number | undefined): PromiseLike<boolean>;
2727
export declare function flush(timeout?: number | undefined): PromiseLike<boolean>;
2828

29-
/**
30-
* @deprecated This function will be removed in the next major version of the Sentry SDK.
31-
*/
32-
export declare function lastEventId(): string | undefined;
33-
3429
export default sentryAstro;

packages/browser/src/exports.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export {
4242
getCurrentScope,
4343
Hub,
4444
// eslint-disable-next-line deprecation/deprecation
45-
lastEventId,
46-
// eslint-disable-next-line deprecation/deprecation
4745
// eslint-disable-next-line deprecation/deprecation
4846
makeMain,
4947
setCurrentClient,

packages/browser/src/sdk.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ export const showReportDialog: ShowReportDialogFunction = (
198198
};
199199
}
200200

201-
// TODO(v8): Remove this entire if statement. `eventId` will be a required option.
202-
// eslint-disable-next-line deprecation/deprecation
203-
if (!options.eventId) {
204-
// eslint-disable-next-line deprecation/deprecation
205-
options.eventId = hub.lastEventId();
206-
}
207-
208201
const script = WINDOW.document.createElement('script');
209202
script.async = true;
210203
script.crossOrigin = 'anonymous';

packages/bun/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ export {
4949
getIsolationScope,
5050
Hub,
5151
// eslint-disable-next-line deprecation/deprecation
52-
lastEventId,
53-
// eslint-disable-next-line deprecation/deprecation
5452
makeMain,
5553
setCurrentClient,
5654
runWithAsyncContext,

packages/core/src/exports.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,6 @@ export async function close(timeout?: number): Promise<boolean> {
370370
return Promise.resolve(false);
371371
}
372372

373-
/**
374-
* This is the getter for lastEventId.
375-
*
376-
* @returns The last event id of a captured event.
377-
* @deprecated This function will be removed in the next major version of the Sentry SDK.
378-
*/
379-
export function lastEventId(): string | undefined {
380-
// eslint-disable-next-line deprecation/deprecation
381-
return getCurrentHub().lastEventId();
382-
}
383-
384373
/**
385374
* Get the currently active client.
386375
*/

packages/core/src/hub.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*

packages/core/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ export {
2020
configureScope,
2121
flush,
2222
// eslint-disable-next-line deprecation/deprecation
23-
lastEventId,
24-
// eslint-disable-next-line deprecation/deprecation
2523
startTransaction,
2624
setContext,
2725
setExtra,

packages/deno/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ export {
4848
getIsolationScope,
4949
Hub,
5050
// eslint-disable-next-line deprecation/deprecation
51-
lastEventId,
52-
// eslint-disable-next-line deprecation/deprecation
5351
makeMain,
5452
setCurrentClient,
5553
runWithAsyncContext,

packages/node-experimental/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ export {
3636
captureMessage,
3737
addGlobalEventProcessor,
3838
addEventProcessor,
39-
// eslint-disable-next-line deprecation/deprecation
40-
lastEventId,
4139
setContext,
4240
setExtra,
4341
setExtras,

0 commit comments

Comments
 (0)