File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,6 @@ export class Canceller {
2929 }
3030
3131 withCancellation < T > ( originalPromise : Promise < T > ) : Promise < T > {
32- if ( this . abortSignal === undefined ) {
33- return originalPromise ;
34- }
35-
3632 const { promise, resolve, reject } = promiseWithResolvers < T > ( ) ;
3733 const abort = ( ) => reject ( this . abortSignal . reason ) ;
3834 this . _aborts . add ( abort ) ;
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ class IncrementalPublisher {
127127 IteratorResult < SubsequentIncrementalExecutionResult , void >
128128 > => {
129129 if ( isDone ) {
130+ this . _context . canceller ?. unsubscribe ( ) ;
130131 await this . _returnAsyncIteratorsIgnoringErrors ( ) ;
131132 return { value : undefined , done : true } ;
132133 }
@@ -173,6 +174,8 @@ class IncrementalPublisher {
173174 batch = await this . _incrementalGraph . nextCompletedBatch ( ) ;
174175 } while ( batch !== undefined ) ;
175176
177+ // TODO: add test for this case
178+ /* c8 ignore next */
176179 this . _context . canceller ?. unsubscribe ( ) ;
177180 await this . _returnAsyncIteratorsIgnoringErrors ( ) ;
178181 return { value : undefined , done : true } ;
Original file line number Diff line number Diff line change @@ -379,6 +379,8 @@ export function experimentalExecuteQueryOrMutationOrSubscriptionEvent(
379379 }
380380 return buildDataResponse ( exeContext , graphqlWrappedResult ) ;
381381 } catch ( error ) {
382+ // TODO: add test case for synchronous null bubbling to root with cancellation
383+ /* c8 ignore next */
382384 exeContext . canceller ?. unsubscribe ( ) ;
383385 return { data : null , errors : withError ( exeContext . errors , error ) } ;
384386 }
@@ -2205,6 +2207,8 @@ function executeSubscription(
22052207 const promise = canceller ?. withCancellation ( result ) ?? result ;
22062208 return promise . then ( assertEventStream ) . then (
22072209 ( resolved ) => {
2210+ // TODO: add test case
2211+ /* c8 ignore next */
22082212 canceller ?. unsubscribe ( ) ;
22092213 return resolved ;
22102214 } ,
You can’t perform that action at this time.
0 commit comments