diff --git a/MIGRATION.md b/MIGRATION.md index 20baed968b9e..19465e06e75c 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -256,7 +256,7 @@ If you are using the `Hub` right now, see the following table on how to migrate | captureException() | `Sentry.captureException()` | | captureMessage() | `Sentry.captureMessage()` | | captureEvent() | `Sentry.captureEvent()` | -| lastEventId() | REMOVED - Use event processors or beforeSend instead | +| lastEventId() | `Sentry.lastEventId()` | | addBreadcrumb() | `Sentry.addBreadcrumb()` | | setUser() | `Sentry.setUser()` | | setTags() | `Sentry.setTags()` | @@ -381,36 +381,6 @@ app.get('/your-route', req => { }); ``` -## Deprecate `Sentry.lastEventId()` and `hub.lastEventId()` - -`Sentry.lastEventId()` sometimes causes race conditions, so we are deprecating it in favour of the `beforeSend` -callback. - -```js -// Before - -Sentry.init({ - beforeSend(event, hint) { - const lastCapturedEventId = Sentry.lastEventId(); - - // Do something with `lastCapturedEventId` here - - return event; - }, -}); - -// After -Sentry.init({ - beforeSend(event, hint) { - const lastCapturedEventId = event.event_id; - - // Do something with `lastCapturedEventId` here - - return event; - }, -}); -``` - ## Deprecated fields on `Span` and `Transaction` In v8, the Span class is heavily reworked. The following properties & methods are thus deprecated: @@ -478,25 +448,6 @@ Instead, import this directly from `@sentry/utils`. Generally, in most cases you should probably use `continueTrace` instead, which abstracts this away from you and handles scope propagation for you. -## Deprecate `lastEventId()` - -Instead, if you need the ID of a recently captured event, we recommend using `beforeSend` instead: - -```ts -import * as Sentry from '@sentry/browser'; - -Sentry.init({ - dsn: '__DSN__', - beforeSend(event, hint) { - const lastCapturedEventId = event.event_id; - - // Do something with `lastCapturedEventId` here - - return event; - }, -}); -``` - ## Deprecate `timestampWithMs` export - #7878 The `timestampWithMs` util is deprecated in favor of using `timestampInSeconds`. @@ -621,7 +572,7 @@ This is no longer used. ## Deprecate @sentry/hub (since 7.15.0) - #5823 -This release deprecates `@sentry/hub` and all of it's exports. All of the `@sentry/hub` exports have moved to +This release deprecates `@sentry/hub` and all of its exports. All of the `@sentry/hub` exports have moved to `@sentry/core`. `@sentry/hub` will be removed in the next major release. # Upgrading Sentry Replay (beta, 7.24.0) diff --git a/packages/astro/src/index.server.ts b/packages/astro/src/index.server.ts index e842725cb242..42fade88a1a1 100644 --- a/packages/astro/src/index.server.ts +++ b/packages/astro/src/index.server.ts @@ -61,7 +61,6 @@ export { defaultIntegrations, getDefaultIntegrations, defaultStackParser, - // eslint-disable-next-line deprecation/deprecation lastEventId, flush, close, diff --git a/packages/astro/src/index.types.ts b/packages/astro/src/index.types.ts index 01022ffaf329..e39e69622a2b 100644 --- a/packages/astro/src/index.types.ts +++ b/packages/astro/src/index.types.ts @@ -26,10 +26,6 @@ export declare const defaultStackParser: StackParser; export declare function close(timeout?: number | undefined): PromiseLike; export declare function flush(timeout?: number | undefined): PromiseLike; - -/** - * @deprecated This function will be removed in the next major version of the Sentry SDK. - */ export declare function lastEventId(): string | undefined; export default sentryAstro; diff --git a/packages/browser/src/exports.ts b/packages/browser/src/exports.ts index 1ce59d127fb8..304042341cb5 100644 --- a/packages/browser/src/exports.ts +++ b/packages/browser/src/exports.ts @@ -44,7 +44,6 @@ export { getCurrentScope, // eslint-disable-next-line deprecation/deprecation Hub, - // eslint-disable-next-line deprecation/deprecation lastEventId, // eslint-disable-next-line deprecation/deprecation // eslint-disable-next-line deprecation/deprecation diff --git a/packages/browser/src/sdk.ts b/packages/browser/src/sdk.ts index 1c57f534867c..fbb3436a99f5 100644 --- a/packages/browser/src/sdk.ts +++ b/packages/browser/src/sdk.ts @@ -198,8 +198,6 @@ export const showReportDialog: ShowReportDialogFunction = ( }; } - // TODO(v8): Remove this entire if statement. `eventId` will be a required option. - // eslint-disable-next-line deprecation/deprecation if (!options.eventId) { // eslint-disable-next-line deprecation/deprecation options.eventId = hub.lastEventId(); diff --git a/packages/bun/src/index.ts b/packages/bun/src/index.ts index 003280dd83ba..8c64d068876e 100644 --- a/packages/bun/src/index.ts +++ b/packages/bun/src/index.ts @@ -51,7 +51,6 @@ export { getIsolationScope, // eslint-disable-next-line deprecation/deprecation Hub, - // eslint-disable-next-line deprecation/deprecation lastEventId, // eslint-disable-next-line deprecation/deprecation makeMain, diff --git a/packages/core/src/exports.ts b/packages/core/src/exports.ts index 80e602968d0a..27fa856f3d64 100644 --- a/packages/core/src/exports.ts +++ b/packages/core/src/exports.ts @@ -387,7 +387,6 @@ export async function close(timeout?: number): Promise { * This is the getter for lastEventId. * * @returns The last event id of a captured event. - * @deprecated This function will be removed in the next major version of the Sentry SDK. */ export function lastEventId(): string | undefined { // eslint-disable-next-line deprecation/deprecation diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 7105af28257e..05abe7a65ba9 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -19,7 +19,6 @@ export { // eslint-disable-next-line deprecation/deprecation configureScope, flush, - // eslint-disable-next-line deprecation/deprecation lastEventId, // eslint-disable-next-line deprecation/deprecation startTransaction, diff --git a/packages/deno/src/index.ts b/packages/deno/src/index.ts index d68dc228dcbb..ac49dbb1e13c 100644 --- a/packages/deno/src/index.ts +++ b/packages/deno/src/index.ts @@ -50,7 +50,6 @@ export { getIsolationScope, // eslint-disable-next-line deprecation/deprecation Hub, - // eslint-disable-next-line deprecation/deprecation lastEventId, // eslint-disable-next-line deprecation/deprecation makeMain, diff --git a/packages/node-experimental/src/index.ts b/packages/node-experimental/src/index.ts index b0edef9afbc7..cd77f7d8098c 100644 --- a/packages/node-experimental/src/index.ts +++ b/packages/node-experimental/src/index.ts @@ -36,7 +36,6 @@ export { captureMessage, addGlobalEventProcessor, addEventProcessor, - // eslint-disable-next-line deprecation/deprecation lastEventId, setContext, setExtra, diff --git a/packages/node-experimental/src/sdk/api.ts b/packages/node-experimental/src/sdk/api.ts index ae8450d58a7c..701e55db7f19 100644 --- a/packages/node-experimental/src/sdk/api.ts +++ b/packages/node-experimental/src/sdk/api.ts @@ -99,10 +99,8 @@ export function withIsolationScope(callback: (isolationScope: Scope) => T): T /** * Get the ID of the last sent error event. - * @deprecated This function will be removed in the next major version of the Sentry SDK. */ export function lastEventId(): string | undefined { - // eslint-disable-next-line deprecation/deprecation return getCurrentScope().lastEventId(); } diff --git a/packages/node-experimental/src/sdk/types.ts b/packages/node-experimental/src/sdk/types.ts index fed2785a0057..78f51cd5d161 100644 --- a/packages/node-experimental/src/sdk/types.ts +++ b/packages/node-experimental/src/sdk/types.ts @@ -32,9 +32,6 @@ export interface Scope extends BaseScope { isolationScope: typeof this | undefined; // @ts-expect-error typeof this is what we want here clone(scope?: Scope): typeof this; - /** - * @deprecated This function will be removed in the next major version of the Sentry SDK. - */ lastEventId(): string | undefined; getScopeData(): ScopeData; } diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index 4212a51632c2..633e223ba9ff 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -50,7 +50,6 @@ export { getIsolationScope, // eslint-disable-next-line deprecation/deprecation Hub, - // eslint-disable-next-line deprecation/deprecation lastEventId, // eslint-disable-next-line deprecation/deprecation makeMain, diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index a9d6d356f74f..f1d3aacdefc3 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -65,7 +65,6 @@ export { defaultIntegrations, getDefaultIntegrations, defaultStackParser, - // eslint-disable-next-line deprecation/deprecation lastEventId, flush, close, diff --git a/packages/remix/src/index.types.ts b/packages/remix/src/index.types.ts index a0c6607e5d97..2cfd9f30b478 100644 --- a/packages/remix/src/index.types.ts +++ b/packages/remix/src/index.types.ts @@ -30,9 +30,4 @@ declare const runtime: 'client' | 'server'; export const close = runtime === 'client' ? clientSdk.close : serverSdk.close; export const flush = runtime === 'client' ? clientSdk.flush : serverSdk.flush; - -/** - * @deprecated This function will be removed in the next major version of the Sentry SDK. - */ -// eslint-disable-next-line deprecation/deprecation export const lastEventId = runtime === 'client' ? clientSdk.lastEventId : serverSdk.lastEventId; diff --git a/packages/serverless/src/index.ts b/packages/serverless/src/index.ts index 2da0d893b647..5026853d3b62 100644 --- a/packages/serverless/src/index.ts +++ b/packages/serverless/src/index.ts @@ -66,7 +66,6 @@ export { flush, getSentryRelease, init, - // eslint-disable-next-line deprecation/deprecation lastEventId, DEFAULT_USER_INCLUDES, addRequestDataToEvent, diff --git a/packages/sveltekit/src/index.types.ts b/packages/sveltekit/src/index.types.ts index a83b53d78b2c..8c281c9dcc21 100644 --- a/packages/sveltekit/src/index.types.ts +++ b/packages/sveltekit/src/index.types.ts @@ -49,8 +49,4 @@ export declare const defaultStackParser: StackParser; export declare function close(timeout?: number | undefined): PromiseLike; export declare function flush(timeout?: number | undefined): PromiseLike; - -/** - * @deprecated This function will be removed in the next major version of the Sentry SDK. - */ export declare function lastEventId(): string | undefined; diff --git a/packages/sveltekit/src/server/index.ts b/packages/sveltekit/src/server/index.ts index fbe69b3e798f..eca53d62c906 100644 --- a/packages/sveltekit/src/server/index.ts +++ b/packages/sveltekit/src/server/index.ts @@ -59,7 +59,6 @@ export { defaultIntegrations, getDefaultIntegrations, defaultStackParser, - // eslint-disable-next-line deprecation/deprecation lastEventId, flush, close, diff --git a/packages/vercel-edge/src/index.ts b/packages/vercel-edge/src/index.ts index 2b8ef47def09..66bf827fdb12 100644 --- a/packages/vercel-edge/src/index.ts +++ b/packages/vercel-edge/src/index.ts @@ -50,7 +50,6 @@ export { getIsolationScope, // eslint-disable-next-line deprecation/deprecation Hub, - // eslint-disable-next-line deprecation/deprecation lastEventId, // eslint-disable-next-line deprecation/deprecation makeMain,