@@ -14,7 +14,7 @@ import { getFinalOptions } from './options';
14
14
import { wrapRequestHandler } from './request' ;
15
15
import { addCloudResourceContext } from './scope-utils' ;
16
16
import { init } from './sdk' ;
17
- import { cloneExecutionContext } from './utils/cloneExecutionContext ' ;
17
+ import { copyExecutionContext } from './utils/copyExecutionContext ' ;
18
18
19
19
/**
20
20
* Wrapper for Cloudflare handlers.
@@ -41,7 +41,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
41
41
const [ request , env , ctx ] = args ;
42
42
43
43
const options = getFinalOptions ( optionsCallback ( env ) , env ) ;
44
- const context = cloneExecutionContext ( ctx )
44
+ const context = copyExecutionContext ( ctx )
45
45
args [ 2 ] = context ;
46
46
47
47
return wrapRequestHandler ( { options, request, context } , ( ) => target . apply ( thisArg , args ) ) ;
@@ -75,7 +75,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
75
75
handler . scheduled = new Proxy ( handler . scheduled , {
76
76
apply ( target , thisArg , args : Parameters < ExportedHandlerScheduledHandler < Env > > ) {
77
77
const [ event , env , ctx ] = args ;
78
- const context = cloneExecutionContext ( ctx )
78
+ const context = copyExecutionContext ( ctx )
79
79
args [ 2 ] = context ;
80
80
return withIsolationScope ( isolationScope => {
81
81
const options = getFinalOptions ( optionsCallback ( env ) , env ) ;
@@ -120,7 +120,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
120
120
handler . email = new Proxy ( handler . email , {
121
121
apply ( target , thisArg , args : Parameters < EmailExportedHandler < Env > > ) {
122
122
const [ emailMessage , env , ctx ] = args ;
123
- const context = cloneExecutionContext ( ctx )
123
+ const context = copyExecutionContext ( ctx )
124
124
args [ 2 ] = context ;
125
125
return withIsolationScope ( isolationScope => {
126
126
const options = getFinalOptions ( optionsCallback ( env ) , env ) ;
@@ -163,7 +163,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
163
163
handler . queue = new Proxy ( handler . queue , {
164
164
apply ( target , thisArg , args : Parameters < ExportedHandlerQueueHandler < Env , QueueHandlerMessage > > ) {
165
165
const [ batch , env , ctx ] = args ;
166
- const context = cloneExecutionContext ( ctx )
166
+ const context = copyExecutionContext ( ctx )
167
167
args [ 2 ] = context ;
168
168
169
169
return withIsolationScope ( isolationScope => {
@@ -215,7 +215,7 @@ export function withSentry<Env = unknown, QueueHandlerMessage = unknown, CfHostM
215
215
handler . tail = new Proxy ( handler . tail , {
216
216
apply ( target , thisArg , args : Parameters < ExportedHandlerTailHandler < Env > > ) {
217
217
const [ , env , ctx ] = args ;
218
- const context = cloneExecutionContext ( ctx )
218
+ const context = copyExecutionContext ( ctx )
219
219
args [ 2 ] = context ;
220
220
221
221
return withIsolationScope ( async isolationScope => {
0 commit comments