Hi all,
I’ve been struggling with an issue for the last day or two with no luck. I have a certain call within my app that is returning status code 0 sometimes. It’s happening frequently enough that it’s impacting usability. It works 100% of the time in chrome (and postman), I’m only seeing this problem on device. Furthermore, all other requests within my app seem to work just fine. I have one request in particular that fails about 20% of the time I call it with the infamous http status 0. I have cordova-plugin-whitelist installed, and the following lines in my config.xml:
<access origin="*"/> <access origin="cdvfile://*" /> <allow-navigation href="*"/> <allow-intent href="*"/>
From my understanding this should allow all requests through, and that seems to be working with most of my other calls. The fact that it only fails with this one particular call seems to point towards some sort of race condition, but I’ve re-written the code multiple times in different ways and I’m getting this error no matter what I do. I don’t think this is a network connectivity issue, because all my other calls are working.
I’m using angular v1.5.0, ionic bundle v1.2.4, ngCordova v0.1.24-alpha, angular-resource v1.5.0.
Here’s some example output of the error:
http error {"data":null,"status":0,"config":{"method":"PUT","transformRequest":[null],"transformResponse":[null],"data":[{"field":"user_master_id","condition":"=","value":97},{"field":"blob_type","condition":"=","value":"profile_img_primary"}],"url":"https://<my-domain>/blob","params":{"metadata":true},"headers":{"Accept":"application/json, text/plain, */*","x-latitude":<redacted>,"x-longitude":<redacted>,"x-token":"<redacted>","Content-Type":"application/json;charset=utf-8"}},"statusText":""}
Any advice here? I’m starting to run out of ideas.
Thanks!