Need help troubleshooting communications error messages

I am using Communications.makeImageRequest in my WUradar widget. I am getting reports from users where the app fails to download the image. With limited exception, I can not reproduce the errors on my side. The errors are all part of the Communications module since that is the only place I capture the response code and if not 200 or 404, show the error code on the screen. The two users I have had reports from are getting different messages, but apparently every time they run the app. I suspect that there is something going on with their link between GCM to the watch, but I don't know the best way to troubleshoot that. Here are the two scenarios and I am currently trying to troubleshoot. I don't think it is my app because I know of cases for the app running fine on other devices of the same type.

Case 1
Device: Fenix 5
Device FW: 6.00
Phone: iPhone 6s
GCM version: GCM-IOS version not provided.

User reports getting comm error 0, UNKNOWN_ERROR. The user claims the watch is syncing with GCM and see the steps update etc. The watch has been restarted, but still gets error code 0 when trying to run the widget. I have been able to reproduce this on my watch if I turn off mobile data and try to start the widget. My differnce is I am running GCM on android and it is only happening under a very specific scenario and not every time the widget is started.

Case 2
Device: Vivoactive
Device FW: 4.40
Phone: Samsung Galaxy S5 Neo
GCM version: GCM-Android 3.22.1.2

This users is reporting error code -300, NETWORK_REQUEST_TIMED_OUT. I have been unable to reproduce this error and I don't know what to suggest to the user to try to fix the issue. I know the URL with Weather Underground can respond for this area.

Any suggestions for either problem would be appreciated.
  • I'd do the phoneConnected check right before makeWebRequest, and in the case of non-wearables, when you might be getting an update.

    You're doing it at a point where time can pass getting a GPS fix and things can change. With GPS, it just takes walking a bit into "clear sky" with your phone left behind.

    When I do timed updates, I only do those every 10 minutes or so, and have a state variable so I don't do one if the last one hasn't completed to stay safe (in some of my stuff, the user can manually request an update, so there's a chance a manual update could be requested at the same time as one driven by the timer)
  • Jim,

    Thanks for your feedback. I found a bug in that I was not refreshing the variable for getDeviceSettings(), so I was not properly detecting when the connection dropped within the app. I think this may help reduce the error messages and will better highlight if there is an unstable connection to the phone. I did a build and put it on my Edge1000 and played around to see how it behaves when I kill the BT while the widget is running. Seems to catch those errors more gracefully now. Time to roll it out and see if it helps those who had problems.
  • Over the weekend I did roll out the fixes for not refreshing the device settings variable and checking it right before issuing the makeImageRequest. After some additional feedback from the two users I have been working with, my sideloaded version of the app still works 100%, but the version downloaded from Garmin's store gives an error every time. The only difference in the code is the sideloaded version has the values for the settings fixed.

    I don't get why one build fails and the other works in the same device. :mad::mad::mad: