File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public class WebSocketTransport {
51
51
52
52
@Atomic
53
53
private var subscribers = [ String : ( Result < JSONObject , any Error > ) -> Void ] ( )
54
+ @Atomic
54
55
private var subscriptions : [ String : String ] = [ : ]
55
56
let processingQueue = DispatchQueue ( label: " com.apollographql.WebSocketTransport " )
56
57
@@ -307,7 +308,7 @@ public class WebSocketTransport {
307
308
}
308
309
309
310
self . queue. removeAll ( )
310
- self . subscriptions. removeAll ( )
311
+ self . $ subscriptions. mutate { $0 . removeAll ( ) }
311
312
}
312
313
}
313
314
@@ -356,7 +357,7 @@ public class WebSocketTransport {
356
357
357
358
self . $subscribers. mutate { $0 [ identifier] = resultHandler }
358
359
if Operation . operationType == . subscription {
359
- self . subscriptions [ identifier] = message
360
+ self . $ subscriptions. mutate { $0 [ identifier] = message }
360
361
}
361
362
}
362
363
@@ -377,7 +378,7 @@ public class WebSocketTransport {
377
378
self . write ( str)
378
379
}
379
380
self . $subscribers. mutate { $0. removeValue ( forKey: subscriptionId) }
380
- self . subscriptions. removeValue ( forKey: subscriptionId)
381
+ self . $ subscriptions. mutate { $0 . removeValue ( forKey: subscriptionId) }
381
382
}
382
383
}
383
384
You can’t perform that action at this time.
0 commit comments