davidstump / SwiftPhoenixClient

Connect your Phoenix and iOS applications through WebSockets!
MIT License
506 stars 146 forks source link

Crash on channel connection #218

Closed srikanth-chetu closed 2 years ago

srikanth-chetu commented 2 years ago

Hi I am getting issue with channel classes where my app gets crash and crashanalystic shows its crashing at the time of connecting to the channel in delegateOnOpen delegates.

app functionality: I has online and offine feature for that i am disconnecting socket when user goes into the background and connect socekt when it comes inro the foregound.

for disconnecting socket we are using method : self.socket?.disconnect() and again reconnection : self.socket?.connect()

Follwing logs getting from crashlytics:-

0 libswiftCore.dylib _swift_release_dealloc + 32 1 SwiftPhoenixClient $s18SwiftPhoenixClient6SocketC3offyySaySSGF + 1784 2 SwiftPhoenixClient $s18SwiftPhoenixClient6SocketC6removeyyAA7ChannelCF + 72 3 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC5topic6params6socketACSS_SDySSypGAA6SocketCtcfcyAC_AA7MessageCtcfU6_Tf4nd_n + 472 4 SwiftPhoenixClient $s18SwiftPhoenixClient9DelegatedV8delegate2to4withyqd_q_qd_xtctRldClFq_SgxcfU_AA7MessageC_ytAA7ChannelCTG5TA + 92 5 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC7triggeryyAA7MessageCF + 512 6 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC7trigger5event7payload3ref7joinRefySS_SDySSypGS2SSgtF + 224 7 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC5leave7timeoutAA4PushCSd_tFyAC_AA7MessageCtcfU_Tf4ndn + 364 8 SwiftPhoenixClient $s18SwiftPhoenixClient9DelegatedV8delegate2to4withyqdq_qd_xtctRld__ClFq_SgxcfU_AA7MessageC_ytAA7ChannelCTG5TA + 92 9 SwiftPhoenixClient $s18SwiftPhoenixClient4PushC12matchReceive33_46DE6019B1AE8EF449A021794E42F7F1LL_7messageySS_AA7MessageCtF + 212 10 SwiftPhoenixClient $s18SwiftPhoenixClient4PushC12startTimeoutyyFyACAA7MessageCtcfU + 356 11 SwiftPhoenixClient $s18SwiftPhoenixClient9DelegatedV8delegate2to4withyqd_q_qd_xtctRldClFq_SgxcfU_AA7MessageC_ytAA4PushCTG5TA + 92 12 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC7triggeryyAA7MessageCF + 512 13 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC7trigger5event7payload3ref7joinRefySS_SDySSypGS2SSgtF + 224 14 SwiftPhoenixClient $s18SwiftPhoenixClient4PushC7trigger_7payloadySS_SDySSypGtF + 188 15 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC5leave7timeoutAA4PushCSd_tF + 460 16 SwiftPhoenixClient $s18SwiftPhoenixClient6SocketC14leaveOpenTopic5topicySS_tF + 816 17 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC6rejoinyySdSgF + 248 18 SwiftPhoenixClient $s18SwiftPhoenixClient7ChannelC4join7timeoutAA4PushCSdSg_tF + 48

dsrees commented 2 years ago

Can you please provide a better formatting for your error message. It is difficult to track what is going on in the raw-text format you've provided.

Also, based on your description, I suspect that you are not creating a new Channel but instead trying to reconnect to the old one and hitting the joinedOnce error thrown here