over 2 years ago


Cannot Reproduce

makeWebRequest: bad request on some devices

Some devices got a bad request on next makeWebRequest: 

Communications.makeWebRequest("[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
    2. the user even tested it works for his account in the simulator, but not in the device through his phone


  • 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.

  • The calendar will either not show, or it will continue to give new source codes. 

  • calendar feature still not working, very disapponting. it was working with android device.

  • I also facing the same issue, the code keep updating but my calendar is not synchronized, could someone kindly help please?

  • Ok -- apologies for the spam, but I've figured out what is going on and believe we need a fix through Garmin.

    Anybody in the + GMT timezone will have this error because the encoding is probably incorrect.  "+" needs to be encoded as %2B and I'm guessing on the device it is not.

    I confirmed the first part (forcing it into a - GMT timezone) fixed my issue (but now has the wrong data).  I know this ticket is closed, but can we get this fixed?  Should I open a new ticket?

  • (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.