Skip to content

Crash when server returns a disconnect response #64

@dmorgereth

Description

@dmorgereth

Our rails server occasionally returns the following response

{"type":"disconnect","reason":"unauthorized","reconnect":false}"

This will cause the code to crash on line 112 of JSONSerializer.swift:

            return Message(channelIdentifier: channelIdentifier!,      // <<-- there is no "identifier" member in the response, so channelIdentfier will be nil
                           actionName: messageActionName,
                           messageType: MessageType.message,
                           data: messageValue,
                           error: messageError)

Recommend that the code be fixed to not force-unwrap channelIdentifier and treat the disconnect the same as a reject

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions