v16 EXC_BAD_ACCESS
Hello,
We expirience an issue after updating to v16.0.0.
Previously we used v15.2 and this code worked:
var connectParams = ["apiKey": apiKey, "clientId": clientId, "userToken": userToken]
self.socketManager = SocketManager(socketURL: url, config: ["path": path, "connectParams": connectParams])
self.socketManager?.reconnects = false
self.socket = self.socketManager?.socket(forNamespace: path)
But after updating to v16 this issue occurs:
Even if I try to create a totally new socket manager and socket - it crashes.
Also I've noticed that something weird happens when trying to print out the config right after creating the SocketManager - it goes to the setConfigs method and crashes with invaliderror:
Maybe we have something wrong with our config, but it worked fine with v15.2.
Could you please help? Thanks!
Make sure you're only changing properties on the handleQueue. Any interaction with the manager/client should happen on that queue.
Also, your server needs to be socket.io 3, or pass .version(.two) as an option.
Could you please clarify about the handleQueue? Doesn't the previous version 15.2 work the same way?
@olgadanylova In theory yes, but it's always a good idea to make sure you're on the same queue to avoid races. Is that error message from a debug build? Sometimes optimized builds can give erroneous crash points because of the optimizations.
Also what version is your server?
We use v2 on our server. But I don't think the issue is connected to the server version.. Just can't figure out right now what is the reason of crash and why it works fine with v15.2 and crashes with 16.0. Anyway its ok for us right now to stay on v15.2 and we'll try to fix this issue somehow for the future. Just wanted to clarify if there should be any code changes to make it work.
@olgadanylova v16 client would require .version(.two) to connect with a socket.io 2 server. There were some changes to engine message parsing that could cause issues like this.