Skip to content

Exception when failing to decode a message with unexpected payload type #425

@paddybyers

Description

@paddybyers

The reported error is:

10-29 11:08:50.655 20895-21155/I/System.out: (ERROR): io.ably.lib.transport.WebSocketTransport: Unexpected exception processing received binary message
10-29 11:08:50.657 20895-21155/I/System.out: io.ably.lib.types.AblyException: java.lang.ClassCastException: java.lang.String cannot be cast to byte[]

The likely problem is that a message is being received with an encoding ending in utf-8, which implies that the data field is a byte[], but the error message tells us it in fact is a String. Strictly, that's a malformed message, but the library should handle it gracefully by returning the unchanged data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions