Closed JCWA2023 closed 5 months ago
We weren't seeing that logged at all - so it seems like it was potentially invoking it correctly but we were somehow just not getting it. I don't know if there could have been some throttling under the hood in swift?
There is no throttling I am aware of. If the invocation is not working it usually means there is some mismatch between how your callback is registered and the invocation message. Without seeing logs I don't have any way to tell where the problem is.
We are implementing a feature where we receive both captions and audio over two different web socket callbacks both registered using the on(method: callback) function. Thee callbacks are both fired multiple times a second when we are actively receiving audio. When I add additional log statements into the signal R code I can see that we are landing in connectionDidReceiveData for each of the messages, each one is successfully finding the registered callback - however we are only ever executing our callback code for one of the events (the more frequent one is being preferred).
Is there some sort of throttling that is happening in the swift signal R client that could cause these events to not actually be invoked?
Consumed via cocoa pods: SwiftSignalRClient -> 0.8.0
.debug
level and attach/past to the issue - Unable to attach logs because our logs are mixed and I can't share those.Registration (our code) this is done after the socket is connected
hubConnection.on(method: "broadcast", callback: { [weak self] in guard let self else { return } handleBroadcast() }
hubConnection.on(method: "broadcastCaptions", callback: { [weak self] in guard let self else { return } handleCaptions() }
We are not ever executing the "handleCaptions" function. However I can see that the handleCaptions message being received by the signalRClient
So these printStatements I added in these functions:
Are printing out the following:
&&& connection received data with: 1 messages: [SwiftSignalRClient.ClientInvocationMessage] &&& connection received data: Invocation &&&& broadcast &&&& in sync to get callback for method: broadcast &&& found callback for method: broadcast &&& in do try block for for method: broadcast &&& connection received data with: 1 messages: [SwiftSignalRClient.ClientInvocationMessage] &&& connection received data: Invocation &&&& broadcastCaptions &&&& in sync to get callback for method: broadcastCaptions &&& found callback for method: broadcastCaptions &&& in do try block for for method: broadcastCaptions
However like stated above I only ever end up executing our callback code for handleBroadcast().
We are getting about 4 broadcast events for every one broadcastCaptions event