Acknowledged
CIQQA-3210

Inconsistent handling of empty 200 OK responses between simulator and device (SDK 8.1.1, Epix 2 Pro)

I am using Communication.makeWebRequest to poll a REST API. The server appears to have an issue and intermittently returns an empty response instead of a JSON payload.

The response has HTTP/1.1 200 OK but includes Content-Length: 0.

In the simulator, this results in a responseCode of -400 (INVALID_HTTP_BODY_IN_NETWORK_RESPONSE).

However, on the actual watch, the responseCode is 200 and data is null.

I am using SDK 8.1.1 and testing on an Epix 2 Pro 47mm, both in the simulator and on the physical device.

The code for the app is available here: https://github.com/TheNinth7/ohg. Reproducing the issue requires access to a server that is protected by basic authentication. I'm happy to share the necessary credentials or details via direct message or another secure method to help reproduce the issue.

Parents
  • If there is real data at times, maybe use the last real data when this situation comes up? Or display "00" or something like "?" when it does.  Treat 200+null or -400 the same as far as an error.

    Yes to all of the above. I cache the content to improve startup speed. Temporary errors are shown only as toast notifications. If an error persists for more than 10 seconds, it's treated as fatal and triggers a full-screen error message. So far this never happened with the error in question. If the issue isn’t resolved server-side, I may suppress the toasts entirely and ignore the error until it reaches that fatal threshold.

Comment
  • If there is real data at times, maybe use the last real data when this situation comes up? Or display "00" or something like "?" when it does.  Treat 200+null or -400 the same as far as an error.

    Yes to all of the above. I cache the content to improve startup speed. Temporary errors are shown only as toast notifications. If an error persists for more than 10 seconds, it's treated as fatal and triggers a full-screen error message. So far this never happened with the error in question. If the issue isn’t resolved server-side, I may suppress the toasts entirely and ignore the error until it reaches that fatal threshold.

Children
No Data