mbxmapkit
mbxmapkit copied to clipboard
Make an NSError error code for "account over limit"
We should figure out how to recognize resource loading failures which are caused by a mapbox.com hosting account going over its limit, and we should have an NSError error code specifically for that situation.
I've never actually seen what happens on an over limit account, so I have no idea what the current code would do in that situation. I'm guessing the results would be mysterious and frustrating.
We don't shut anything off when an account goes over limit, but rather keep the lights on to avoid outages + bill at a linear rate per map view per http://mapbox.com/plans.
We don't shut anything off when an account goes over limit, but rather keep the lights on to avoid outages + bill at a linear rate per map view per http://mapbox.com/plans.
Only if people have paid accounts. On free accounts + over limit, which is a common case, we send 404s with "Account over limit" text.
Oh, my bad. That.
Ah, I see...
Scale as you grow with a simple rate of $0.50 USD per 1,000 map views until you upgrade plans.
@tmcw is there an account that you keep maxed out for testing purposes, or perhaps a query parameter, cookie, etc which could be used to trigger the "Account over limit" 404? I'm wondering about a reliable way to test that MBXMapKit can detect and report over limit errors.
@geografa It seems like the plans page doesn't point out that free accounts can get shut off, which some people might find pretty surprising (in light of the "scale as you grow" text).
Yes - thanks for the nudge ;) need to get to that today: https://github.com/mapbox/www.mapbox.com/issues/3586
@wsnook hm, interesting. we usually use mocking frameworks to test this kind of thing rather than having it hit the service directly.
@tmcw Okay, got it. I'm not expecting to do anything about this in the immediate future, but I currently have zero examples to refer to of what an over limit account looks like. Eventually having some way to hit a test endpoint which is guaranteed to behave the same way (i.e. running the same code) as the live tile API seems like it would be pretty cool.
This would be good to look into in the future, but it can wait until after 0.3.0.
The implementation in the issue79 branch and PR #81 does not do anything special to handle this or to provide notification of a problem with loading tiles. It will either fail silently or possibly pull old stuff from cache, masking the problem.
The missing piece of information is what an HTTP response would look like for the error message (i.e. what is a reliable test to distinguish between a good tile and an error response saying your account is over limit).
@tmcw @geografa @incanus Is this ticket about "Account over limit" errors for the old free plans still relevant for the current plan structure and api? Do we maybe need a new ticket about detecting api access token issues instead?
Tokens only apply to v4. We'll still have lots of v3 in the wild, so we need to detect this.
@incanus Can this issue be closed now that v3 support was removed for the 0.7.0 release?
Hmm, I think 404 still applies to v4 API. What I said above was in case this changed with v4, which it hasn't.