centrifugal / centrifuge-swift

Swift client SDK for bidirectional real-time communication with Centrifugo and Centrifuge-based server over WebSocket
MIT License
48 stars 43 forks source link

Fix missing "unsubscribe" server request #86

Closed antonselyanin closed 1 year ago

antonselyanin commented 1 year ago

This PR fixes "unsubscription" issues during removeSubscription call.

Steps to reproduce the issues:

  1. Connect to a server
  2. Subscribe to channel
  3. Remove the subscription using client.removeSubscription and immediately nullify your reference to the subscription

The async block inside processUnsubscribe might not witness a strong ref to the subscription object.

FZambia commented 1 year ago

Thanks!