You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In JSONSerializer.deserialize, unrecognized message is grouped with message, but ultimately fails since message may be malformed eg does not contain channelName
case .welcome,.ping,.unrecognized:return Message(channelName:nil,
actionName:nil,
messageType: messageType,
data:nil,
error:nil)
case .message:varmessageActionName:String?varmessageValue:AnyObject?varmessageError:Swift.Error?do{// No channel name was extracted from identifier
guard let _ = channelName
else{throwSerializationError.protocolViolation }// No message was extracted from identifier
guard let messageObj =JSONObj["message"]else{throwSerializationError.protocolViolation }
if let actionObj =messageObj["action"],let actionStr = actionObj as?String{
messageActionName = actionStr
}
messageValue = messageObj
}catch{
messageError = error
}return Message(channelName: channelName!,
actionName: messageActionName,
messageType:MessageType.message,
data: messageValue,
error: messageError)
In onMessage, unrecognized message is not further processed.
fileprivatefunc onMessage(_ message:Message){
switch(message.messageType){case.unrecognized:
break
case.welcome:
break
case.ping:
if let callback = onPing {DispatchQueue.main.async(execute: callback)}
case .message:
if let channel =channels[message.channelName!]{// Notify Channel
channel.onMessage(message)
I suggest unrecognized be grouped with welcome and ping message types.
The text was updated successfully, but these errors were encountered:
In JSONSerializer.deserialize, unrecognized message is grouped with message, but ultimately fails since message may be malformed eg does not contain channelName
In onMessage, unrecognized message is not further processed.
I suggest unrecognized be grouped with welcome and ping message types.
The text was updated successfully, but these errors were encountered: