Skip to content

feat(v8): Remove deprecated runWithAsyncContext API #10780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/bun/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export {
// eslint-disable-next-line deprecation/deprecation
makeMain,
setCurrentClient,
// eslint-disable-next-line deprecation/deprecation
runWithAsyncContext,
Scope,
// eslint-disable-next-line deprecation/deprecation
startTransaction,
Expand Down
13 changes: 0 additions & 13 deletions packages/core/src/currentScopes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ export function withIsolationScope<T>(callback: (isolationScope: Scope) => T): T
return acs.withIsolationScope(callback);
}

/**
* Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.
*
* @param callback The callback to run in its own async context
* @param options Options to pass to the async context strategy
* @returns The result of the callback
*
* @deprecated Use `Sentry.withScope()` instead.
*/
export function runWithAsyncContext<T>(callback: () => T): T {
return withScope(() => callback());
}

/**
* Get the currently active client.
*/
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export {
setGlobalScope,
withScope,
withIsolationScope,
// eslint-disable-next-line deprecation/deprecation
runWithAsyncContext,
getClient,
} from './currentScopes';
export {
Expand Down
2 changes: 0 additions & 2 deletions packages/deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export {
// eslint-disable-next-line deprecation/deprecation
makeMain,
setCurrentClient,
// eslint-disable-next-line deprecation/deprecation
runWithAsyncContext,
Scope,
// eslint-disable-next-line deprecation/deprecation
startTransaction,
Expand Down
2 changes: 0 additions & 2 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export {
// eslint-disable-next-line deprecation/deprecation
makeMain,
setCurrentClient,
// eslint-disable-next-line deprecation/deprecation
runWithAsyncContext,
Scope,
// eslint-disable-next-line deprecation/deprecation
startTransaction,
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry/src/asyncContextStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function setOpenTelemetryContextAsyncContextStrategy(): void {
// We set the `SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY` context value, which is picked up by
// the OTEL context manager, which uses the presence of this key to determine if it should
// fork the isolation scope, or not
// as by default, we don't want to fork this, unless triggered explicitly by `runWithAsyncContext`
// as by default, we don't want to fork this, unless triggered explicitly by `withScope`
return api.context.with(ctx, () => {
return callback(getCurrentScope());
});
Expand Down
2 changes: 0 additions & 2 deletions packages/remix/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ export {
metrics,
createGetModuleFromFilename,
hapiErrorPlugin,
// eslint-disable-next-line deprecation/deprecation
runWithAsyncContext,
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
Expand Down
2 changes: 0 additions & 2 deletions packages/serverless/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export {
functionToStringIntegration,
createGetModuleFromFilename,
metrics,
// eslint-disable-next-line deprecation/deprecation
runWithAsyncContext,
consoleIntegration,
onUncaughtExceptionIntegration,
onUnhandledRejectionIntegration,
Expand Down
2 changes: 0 additions & 2 deletions packages/sveltekit/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export {
createGetModuleFromFilename,
hapiErrorPlugin,
metrics,
// eslint-disable-next-line deprecation/deprecation
runWithAsyncContext,
SEMANTIC_ATTRIBUTE_SENTRY_OP,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
Expand Down
2 changes: 0 additions & 2 deletions packages/vercel-edge/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export {
// eslint-disable-next-line deprecation/deprecation
makeMain,
setCurrentClient,
// eslint-disable-next-line deprecation/deprecation
runWithAsyncContext,
Scope,
// eslint-disable-next-line deprecation/deprecation
startTransaction,
Expand Down