Acknowledged
CIQQA-4933

makeWebRequest: responses with Transfer-Encoding: chunked arrive empty or time out (Android, Garmin Connect)

  • Device: fēnix 9 Pro 51 mm, firmware 7.22
  • Phone: Android 17, Garmin Connect 5.31.1
  • Connect IQ SDK 9.3.0, app built with minApiLevel 4.0.0

Communications.makeWebRequest() does not handle HTTP responses that use Transfer-Encoding: chunked without a Content-Length header. This is valid HTTP/1.1, and many dynamic endpoints respond this way. One example is the Nextcloud/SabreDAV calendar export (/remote.php/dav/calendars/<user>/<cal>?export).

Results for the same URL (about 9.5 KB, server responds in about 1.6 s, plain HTTP GET with Basic auth):

responseType result
HTTP_RESPONSE_CONTENT_TYPE_OCTET_STREAM callback with 200 and an empty ByteArray (0 bytes)
HTTP_RESPONSE_CONTENT_TYPE_TEXT_PLAIN -300 (timeout)
HTTP_RESPONSE_CONTENT_TYPE_JSON (jCal variant) -300 (timeout)
octet stream, larger chunked response (~130 KB) -1004 (connection dropped)

Adding the request headers Accept-Encoding: identity and Connection: close makes no difference.

Static files with a Content-Length header, such as .ics files from Google Calendar or municipal waste calendars, load correctly through the same code path.

Chunked responses are read completely, like any HTTP client does, and passed to the callback with code 200 and the full body.

Notes

  • The 200-with-empty-body case is particularly hard to diagnose, because the app cannot tell an empty response from a lost one.
  • A public chunked endpoint such as https://httpbin.org/stream-bytes/9000 may be a simple way to reproduce this. I have not tested it myself.

Also opened an issue on github for nextcloud/calendar: https://github.com/nextcloud/calendar/issues/9291

But at least, its a bug on garmin side!

Parents Comment Children
No Data