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

Unable to get response body from partial success batch response

Open owenpearson opened this issue 2 years ago • 2 comments
trafficstars

using batch response without the newBatchResponse format, when receiving a partial success response Rest.request throws an error and does not expose the response body which makes it impossible to programatically determine which members of the batch were successful.

┆Issue is synchronized with this Jira Task by Unito

owenpearson avatar Jul 18 '23 10:07 owenpearson

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3730

sync-by-unito[bot] avatar Jul 18 '23 10:07 sync-by-unito[bot]

On one hand, yeah, according to the spec, rest#request shouldn't be throwing an error if it receives an error response.

On the other hand... I kindof like this behaviour better than what the spec wants...? I don't really like the current rest#request behaviour, it's weird and different from every other api, and I've proposed changing it to basically this. The only sticking point would have been the batch-partial-success case, but the old batch response is deprecated, we can just push forward with the new format.

in any case -- fixing rest.request to be what the spec wants would be a breaking change, so we can't make it until the next major version of ably-java. In which case we may as well not bother, because the next major version can send v=3 and get the new format by default, so it won't be an issue any more.

wdyt?

SimonWoolf avatar Jul 18 '23 12:07 SimonWoolf