File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/utilities/subscriptions/urql Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @apollo/client " : patch
3
+ ---
4
+
5
+ Fix in-flight multipart urql subscription cancellation
Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ export function createFetchMultipartSubscription(
35
35
const currentFetch = preferredFetch || maybe ( ( ) => fetch ) || backupFetch ;
36
36
const observerNext = observer . next . bind ( observer ) ;
37
37
38
- currentFetch ! ( uri , options )
38
+ const abortController = new AbortController ( ) ;
39
+
40
+ currentFetch ! ( uri , { ...options , signal : abortController . signal } )
39
41
. then ( ( response ) => {
40
42
const ctype = response . headers ?. get ( "content-type" ) ;
41
43
@@ -51,6 +53,10 @@ export function createFetchMultipartSubscription(
51
53
. catch ( ( err : any ) => {
52
54
handleError ( err , observer ) ;
53
55
} ) ;
56
+
57
+ return ( ) => {
58
+ abortController . abort ( ) ;
59
+ } ;
54
60
} ) ;
55
61
} ;
56
62
}
You can’t perform that action at this time.
0 commit comments