lakenen / node-box-view

A node client for the Box View API
MIT License
13 stars 2 forks source link

should automatically retry after 202 #13

Closed emmettnicholas closed 10 years ago

emmettnicholas commented 10 years ago

It's nice that the module retries after a 429 response if retry is true, but it'd be nice if it retried after a 202 as well.

I noticed this comment on issue https://github.com/lakenen/node-box-view/issues/5

The 202 w/ retry-after used in session/thumbnail/content calls is not necessarily rate-limiting per se, but actually just the API saying "wait, I'm still processing". So I think it's fundamentally different in that sense.

I'm not sure if I understand what's fundamentally different though. As I try to develop against the Box View API, should I care about the distinction between 429 and 202, as long as retry-after is supplied?

lakenen commented 10 years ago

Actually, as of v0.4.0, all methods should retry when passed the {retry: true} options. If this is not the case, then there must be a bug. Could you confirm that this is true?

emmettnicholas commented 10 years ago

Oops, my mistake. I misread the logic in createResponseHandler! You're right.