@@ -14,7 +14,7 @@ import { getFinalOptions } from './options';
1414import { wrapRequestHandler } from './request' ;
1515import { addCloudResourceContext } from './scope-utils' ;
1616import { init } from './sdk' ;
17- import { cloneExecutionContext } from './utils/cloneExecutionContext ' ;
17+ import { copyExecutionContext } from './utils/copyExecutionContext ' ;
1818
1919/**
2020 * Wrapper for Cloudflare handlers.
@@ -41,7 +41,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
4141 const [ request , env , ctx ] = args ;
4242
4343 const options = getFinalOptions ( optionsCallback ( env ) , env ) ;
44- const context = cloneExecutionContext ( ctx )
44+ const context = copyExecutionContext ( ctx )
4545 args [ 2 ] = context ;
4646
4747 return wrapRequestHandler ( { options, request, context } , ( ) => target . apply ( thisArg , args ) ) ;
@@ -75,7 +75,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
7575 handler . scheduled = new Proxy ( handler . scheduled , {
7676 apply ( target , thisArg , args : Parameters < ExportedHandlerScheduledHandler < Env > > ) {
7777 const [ event , env , ctx ] = args ;
78- const context = cloneExecutionContext ( ctx )
78+ const context = copyExecutionContext ( ctx )
7979 args [ 2 ] = context ;
8080 return withIsolationScope ( isolationScope => {
8181 const options = getFinalOptions ( optionsCallback ( env ) , env ) ;
@@ -120,7 +120,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
120120 handler . email = new Proxy ( handler . email , {
121121 apply ( target , thisArg , args : Parameters < EmailExportedHandler < Env > > ) {
122122 const [ emailMessage , env , ctx ] = args ;
123- const context = cloneExecutionContext ( ctx )
123+ const context = copyExecutionContext ( ctx )
124124 args [ 2 ] = context ;
125125 return withIsolationScope ( isolationScope => {
126126 const options = getFinalOptions ( optionsCallback ( env ) , env ) ;
@@ -163,7 +163,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
163163 handler . queue = new Proxy ( handler . queue , {
164164 apply ( target , thisArg , args : Parameters < ExportedHandlerQueueHandler < Env , QueueHandlerMessage > > ) {
165165 const [ batch , env , ctx ] = args ;
166- const context = cloneExecutionContext ( ctx )
166+ const context = copyExecutionContext ( ctx )
167167 args [ 2 ] = context ;
168168
169169 return withIsolationScope ( isolationScope => {
@@ -215,7 +215,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
215215 handler . tail = new Proxy ( handler . tail , {
216216 apply ( target , thisArg , args : Parameters < ExportedHandlerTailHandler < Env > > ) {
217217 const [ , env , ctx ] = args ;
218- const context = cloneExecutionContext ( ctx )
218+ const context = copyExecutionContext ( ctx )
219219 args [ 2 ] = context ;
220220
221221 return withIsolationScope ( async isolationScope => {
0 commit comments