@@ -24,6 +24,7 @@ import type { AsyncContextStrategy, Carrier } from './asyncContext';
2424import { getMainCarrier , getSentryCarrier } from './asyncContext' ;
2525import { DEFAULT_ENVIRONMENT } from './constants' ;
2626import { DEBUG_BUILD } from './debug-build' ;
27+ import { getCurrentHubShim } from './getCurrentHubShim' ;
2728import { Scope } from './scope' ;
2829import { closeSession , makeSession , updateSession } from './session' ;
2930import { SDK_VERSION } from './version' ;
@@ -506,13 +507,7 @@ export class Hub implements HubInterface {
506507 * @deprecated Use the respective replacement method directly instead.
507508 */
508509// eslint-disable-next-line deprecation/deprecation
509- export function getCurrentHub ( ) : HubInterface {
510- // Get main carrier (global for every environment)
511- const carrier = getMainCarrier ( ) ;
512-
513- const acs = getAsyncContextStrategy ( carrier ) ;
514- return acs . getCurrentHub ( ) || getGlobalHub ( ) ;
515- }
510+ export const getCurrentHub = getCurrentHubShim ;
516511
517512/** Get the default current scope. */
518513export function getDefaultCurrentScope ( ) : Scope {
@@ -586,7 +581,6 @@ function withIsolationScope<T>(callback: (isolationScope: ScopeInterface) => T):
586581/* eslint-disable deprecation/deprecation */
587582function getHubStackAsyncContextStrategy ( ) : AsyncContextStrategy {
588583 return {
589- getCurrentHub : getGlobalHub ,
590584 withIsolationScope,
591585 withScope,
592586 withSetScope,
0 commit comments