davidstump / SwiftPhoenixClient

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

Converts Socket's stateChangeCallbacks arrays to SynchronizedArrays #239

Closed msandel6 closed 11 months ago

msandel6 commented 1 year ago

Issue:

If a socket action is dispatched asynchronously, SwiftPhoenixClient sometimes crashes on line 463 of Socket.swift when one of the stateChangeCallback arrays is changed asynchronously.

Screenshot 2023-05-09 at 6 36 09 PM Screenshot 2023-05-10 at 10 13 38 AM

Solution:

This PR takes the same approach that was taken to achieve thread-safe access to the bindingsDel array here.