mbxmapkit icon indicating copy to clipboard operation
mbxmapkit copied to clipboard

Make an NSError error code for "account over limit"

Open ghost opened this issue 11 years ago • 13 comments

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.

ghost avatar Mar 18 '14 17:03 ghost

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.

incanus avatar Mar 18 '14 18:03 incanus

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.

tmcw avatar Mar 18 '14 18:03 tmcw

Oh, my bad. That.

incanus avatar Mar 18 '14 18:03 incanus

Ah, I see...

Scale as you grow with a simple rate of $0.50 USD per 1,000 map views until you upgrade plans.

ghost avatar Mar 18 '14 18:03 ghost

@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).

ghost avatar Mar 18 '14 18:03 ghost

Yes - thanks for the nudge ;) need to get to that today: https://github.com/mapbox/www.mapbox.com/issues/3586

geografa avatar Mar 18 '14 20:03 geografa

@wsnook hm, interesting. we usually use mocking frameworks to test this kind of thing rather than having it hit the service directly.

tmcw avatar Mar 18 '14 21:03 tmcw

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

ghost avatar Mar 18 '14 22:03 ghost

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

ghost avatar May 01 '14 04:05 ghost

@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?

ghost avatar Jul 14 '14 19:07 ghost

Tokens only apply to v4. We'll still have lots of v3 in the wild, so we need to detect this.

incanus avatar Jul 14 '14 19:07 incanus

@incanus Can this issue be closed now that v3 support was removed for the 0.7.0 release?

ghost avatar Feb 20 '15 01:02 ghost

Hmm, I think 404 still applies to v4 API. What I said above was in case this changed with v4, which it hasn't.

incanus avatar Feb 20 '15 01:02 incanus