mapzen / ios

Where you can find everything iOS from Mapzen
https://mapzen.com/projects/mobile/
Apache License 2.0
40 stars 24 forks source link

Investigate Crash in sample app related to autocomplete #273

Closed msmollin closed 7 years ago

msmollin commented 7 years ago

Description

The latest nightlies (Circle Build 560) have a fairly reproducible crash occurring in search tab. However its not exactly the same steps each time to reproduce it, and it's not reproducible (so far) locally.

Steps to Reproduce

  1. Install nightly build from Circle CI
  2. Launch app
  3. Attempt to use search.

Mapzen SDK & iOS Version

SDK: 1.0.0 Sample App: Nightly 560.

sarahsnow1 commented 7 years ago

I was finally able to repro this locally. It happens because we force unwrap "features" from the autocomplete response. When this key didn't exist the response I got back was:

meta =     {
        "status_code" = 429;
        version = 1;
    };
    results =     {
        error =         {
            message = "Queries per second exceeded: Queries exceeded (6 allowed).";
            type = QpsExceededError;
        };
    };

I'm going to update the SDK code to not force unwrap and also configure a better default autocompleteTimeDelay on MapzenSearch (the current delay is 0). I'll also notify the pelias folks about this response because it isn't documented and we removed code to handle this case

missinglink commented 7 years ago

heya, sorry for the confusion, the pelias service itself only returns geoJSON and we try to keep it nice and consistent.

The message you are getting is from the apiaxle proxy, it's the same message that is returned from all mz services when rate limits are reached.

There should be sufficient headers/ a 400/500 level error code in the response which can help you identify this case.