@@ -2,6 +2,7 @@ import type { ExecutionContext } from '@cloudflare/workers-types';
22import type { Client } from '@sentry/core' ;
33import { debug , flush } from '@sentry/core' ;
44import { DEBUG_BUILD } from './debug-build' ;
5+ import type { ExecutionContextCompat } from './executionContext' ;
56
67type FlushLock = {
78 readonly ready : Promise < void > ;
@@ -34,7 +35,7 @@ const flushLockRegistries = new WeakMap<ExecutionContext['waitUntil'], FlushLock
3435 *
3536 * By using the original waitUntil for flush operations, we bypass this issue.
3637 */
37- export function getOriginalWaitUntil ( context : ExecutionContext ) : ExecutionContext [ 'waitUntil' ] | undefined {
38+ export function getOriginalWaitUntil ( context : ExecutionContextCompat ) : ExecutionContext [ 'waitUntil' ] | undefined {
3839 // eslint-disable-next-line @typescript-eslint/unbound-method
3940 const currentWaitUntil = context . waitUntil ;
4041 const original = flushLockRegistries . get ( currentWaitUntil ) ?. originalWaitUntil ;
@@ -49,7 +50,7 @@ export function getOriginalWaitUntil(context: ExecutionContext): ExecutionContex
4950 * @param {ExecutionContext } context - The execution context to be enhanced. If no context is provided, the function returns undefined.
5051 * @return {FlushLock } Returns a flusher function if a valid context is provided, otherwise undefined.
5152 */
52- export function makeFlushLock ( context : ExecutionContext ) : FlushLock {
53+ export function makeFlushLock ( context : ExecutionContextCompat ) : FlushLock {
5354 const registry = getOrCreateFlushLockRegistry ( context ) ;
5455 let resolveAllDone : ( ) => void = ( ) => undefined ;
5556 const allDone = new Promise < void > ( res => {
@@ -81,7 +82,7 @@ export function makeFlushLock(context: ExecutionContext): FlushLock {
8182 return Object . freeze ( lock ) ;
8283}
8384
84- function getOrCreateFlushLockRegistry ( context : ExecutionContext ) : FlushLockRegistry {
85+ function getOrCreateFlushLockRegistry ( context : ExecutionContextCompat ) : FlushLockRegistry {
8586 // eslint-disable-next-line @typescript-eslint/unbound-method
8687 const waitUntil = context . waitUntil ;
8788 const existingRegistry = flushLockRegistries . get ( waitUntil ) ;
0 commit comments