Includes fixes for two flavors of issues we've encountered in our SwiftUI application.
https://github.com/davidstump/SwiftPhoenixClient/issues/253
This one I'm having trouble reproducing locally, but the Object 0x303285e60 of class HeartbeatTimer deallocated with non-zero retain count 3. This object's deinit, or something called from it, may have created a strong reference to self which outlived deinit, resulting in a dangling reference error especially had me thinking it was an issue with a strong reference in HeartbeatTimer. Please let me know if there is a good way to test this!
Only log failure error messages if self is not nil in PhoenixTransport.receive
Disconnect the existing connection in Socket.connect so that old connections are cleaned up.
Ignore errors due to normal cancellations
Tested these changes in an app that calls socket.connect() twice whenever returning from the background and confirmed onOpen callback only invoked once and onError not invoked.
Includes fixes for two flavors of issues we've encountered in our SwiftUI application.
https://github.com/davidstump/SwiftPhoenixClient/issues/253 This one I'm having trouble reproducing locally, but the
Object 0x303285e60 of class HeartbeatTimer deallocated with non-zero retain count 3. This object's deinit, or something called from it, may have created a strong reference to self which outlived deinit, resulting in a dangling reference
error especially had me thinking it was an issue with a strong reference in HeartbeatTimer. Please let me know if there is a good way to test this!https://github.com/davidstump/SwiftPhoenixClient/issues/258 -
Error when receiving Error Domain=NSPOSIXErrorDomain Code=57 "Socket is not connected"
Error messagesfailure
error messages ifself
is not nil inPhoenixTransport.receive
Socket.connect
so that old connections are cleaned up.Tested these changes in an app that calls
socket.connect()
twice whenever returning from the background and confirmedonOpen
callback only invoked once andonError
not invoked.