Hi,
Not sure whether this is a known issue with the simulator (or perhaps the devices if you look at it that way), or if there's an item to fix this on the backlog, but the simulator does not behave in the same way as all the hardware when making web requests. Specifically, on the simulator, a request with params:
var params = {
"sort" => "date-desc",
"deviceid" => deviceId.toString(),
"formatForDevice" =>true
};
will generate a query string with
GET /api/routes/?deviceid=<mydeviceid>&sort=date-desc&formatForDevice=true HTTP/1.1" 200 922 "-" "Mozilla/5.0" "80.229.6.38"
on the simulator. It does the same on the vivoactive 3. On the physical Fenix it generates:
GET /api/routes/?sort=date-desc&formatForDevice=1&deviceid=<mydeviceid>
Note the 1 versus 'true' for the formatForDevice.
This may seem like a tiny bug but I just spent 2 days and various back and forth with a user trying to determine this was the cause of my app crashing on the Fenix. It also meant I had to pull the latest version of my app from the store while I worked it out.
It's not possible to detect this in testing because the simulator and the Fenix (at least) diverge and so without a physical device I can't prevent this.
Has anyone else seen this, and is it something that could be looked at by the team? I imagine it's a matter of the web library toString() having a different implementation on different devices. At the very least, could you replicate this behaviour in the simulator for the devices this affects so others aren't caught out. I could easily do this again without noticing.
Clearly the fix for my code is trivial (pass "true"); it's just knowing it's there that is tricky.
Worst case, is there a 'common pitfuls' document somewhere that could be shared?
Thanks
David