ably-cocoa icon indicating copy to clipboard operation
ably-cocoa copied to clipboard

`-[ARTRest time:]` will fail, but without an error, if no decoder found for response’s MIME type

Open lawrence-forooghian opened this issue 2 years ago • 1 comments

If self->_encoders[response.MIMEType] is nil, then we'll end up calling the callback with both time and error being nil, which is not a valid behaviour.

https://github.com/ably/ably-cocoa/blob/0fe3c59658ce7d0b7181571cdad1f068d4085088/Source/ARTRest.m#L519

We need to handle this (if the feature spec has something to say about how this should be handled, then we should do that, else we should probably define it in the spec – the SDK should generate some sort of error).

┆Issue is synchronized with this Jira Task by Unito

lawrence-forooghian avatar Jul 05 '22 17:07 lawrence-forooghian

As in case of Accept header in this comment https://github.com/ably/ably-cocoa/pull/1420#discussion_r917117828 I think it's a legacy code in the _time function. Error creation is handled for all requests in the executeRequest:... method:

https://github.com/ably/ably-cocoa/blob/0fe3c59658ce7d0b7181571cdad1f068d4085088/Source/ARTRest.m#L372

Issue to update _time function - https://github.com/ably/ably-cocoa/issues/1445

maratal avatar Jul 08 '22 21:07 maratal