Complete
over 3 years ago

WERETECH-8848

Cannot Reproduce

makeWebRequest: bad request on some devices

Some devices got a bad request on next makeWebRequest: 

Communications.makeWebRequest("https://www.googleapis.com/calendar/v3/calendars/[email protected]/events",
{timeMin=>2020-4-30T12:19:00+02:00, timeMax=>2020-5-1T12:19:00+02:00},
{:method=>Communications.HTTP_REQUEST_METHOD_GET, :headers=>{ "Authorization"=>"Bearer "+"ya29…valid-oauth-token…
OpxLk" }}, method(:onEvents));

  1. in simulator it works fine
  2. in majority of devices it works fine
  3. the oauth token is valid: the login was confirmed and another request was successful
  4. Error 400: Bad Request on some devices: e.g.  iPhone X, iOS 13.4.1, Garmin Connect: 4.30
    1. same parameters work on https://developers.google.com/calendar/v3/reference/events/list
    2. the user even tested it works for his account in the simulator, but not in the device through his phone

Testing: 

  • by previous testing I realised in another request the device translated "showDeleted"=>false  to "showDeleted"=>0 and that was not accepted by Google on some devices while worked fine on most of them. So I fixed that one. 
  • but in the request above all the parameters are strings, so I don't see anything that can go wrong. 
  • from debugging couple of devices, I am almost sure the problem is caused inside the makeWebRequest. But I don't know what can go wrong. The debug data just looks good yet it replies with the Bad Request. 

What can be wrong there? 

The only idea I have is that it is something phone/app specific inside the makeWebRequest itself. 

Source, app.

  • (one additional comment) -- probably unrelated, but location is also not updating.  Despite starting maps and activating running, location is still coming back as null on the device.

  • I am also running into this issue.  Interestingly, the same code on the same device/watch was working for me.  I traveled out of country (over seas) and now I'm running into the same issue.  Simulator still works fine.  Consistent 400 error code even after uninstall/reinstall.  Any thoughts/updates/ideas?

  • I got a device that still reproduces this bug: iPhone SE iOS 14.6 and Mobile Connect app version 4.44.0.33 (all latest version for the iPhone SE)

    The bug is in the app: same watch (F6x) works with Android, but not with the iOS above. 

    What else do you need to reproduce and fix it? 

  • What do you need to reproduce it? 

    1. you have an exact line causing an error

    2. you have a user log from Gildas82 you asked for

    3. you have 21 users here you can ask for more to identify devices or mobiles with the problem

    4. you have all the devices you manufacture to test it

    5. the error still occurs, I still get reports from users of my watch face