RediStack icon indicating copy to clipboard operation
RediStack copied to clipboard

Subscriptions don't call `onUnsubscribe` if a socket is unexpectedly closed

Open Joannis opened this issue 11 months ago • 0 comments

onUnsubscribe is currently only called when a subscription is formally cancelled by the user. If a socket error closes the connection, the subscription isn't alive anymore, but because onUnsubscribe isn't triggered there's no good way of knowing that this event was omitted.

I've currently worked around it using ARC retain/release calls. On deinit of a reference type, the onUnsubscribe is implied, though I'm not even certain that this works in practice.

Joannis avatar Mar 22 '25 09:03 Joannis