Skip to content

Check we're not misusing JSONValue(ablyCocoaData:) #421

@lawrence-forooghian

Description

@lawrence-forooghian

see e.g.

internal extension PresenceMessage {
init(ablyCocoaPresenceMessage: ARTPresenceMessage) {
clientId = ablyCocoaPresenceMessage.clientId
timestamp = ablyCocoaPresenceMessage.timestamp
action = ablyCocoaPresenceMessage.action
if let ablyCocoaData = ablyCocoaPresenceMessage.data {
data = JSONValue(ablyCocoaData: ablyCocoaData).objectValue
}
if let ablyCocoaExtras = ablyCocoaPresenceMessage.extras {
extras = JSONValue.objectFromAblyCocoaExtras(ablyCocoaExtras)
}
}
}

— what if the ably-cocoa message contains something else (e.g. Data, or something else that came over the wire that it couldn't decode, as represented by encoding?); we don't want to crash

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working. It’s clear that this does need to be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions