adelevie / parse-ruby-client

A simple Ruby client for the parse.com REST API
MIT License
415 stars 137 forks source link

Upgraded Faraday to 0.9.1 #180

Closed rhymes closed 9 years ago

rhymes commented 9 years ago

I had to change a few things to make it work.

Faraday::BetterRetry middleware is a slightly modified version of the one shipped with Faraday with the two customizations we had before: logging of retries and the passing along of the number of retries left to the Faraday::ExtendedParseJson middleware.

The communication between the two middleware now it's done with a header because Faraday switched to closed structs to store the environent.

I also re-added in the default exceptions used to retry requests that Faraday has.

The logging and the header are tested. The header is deleted before making the HTTP request so it won't be sent to the server (though it's harmless).

The tests removed in better_retry_test are those that were testing the functionality of the middleware itself which is better tested in the Faraday library now.

rhymes commented 9 years ago

@ericcj would you like to take a look at this?

rhymes commented 9 years ago

@Xavdidtheshadow @adelevie any input on this?

xavdid commented 9 years ago

@rhymes nice! My only question is if faraday doesn't retry POST requests by default that's probably for a reason, right? Should we not follow suit?

I don't have strong feelings on it, just playing devil's advocate.

rhymes commented 9 years ago

@Xavdidtheshadow it seems too big a behavior to change and anyways the retry mechanism, I guess, was implemented because of how Parse rate limits.

We should aim at freezing the whole thing and release a 1.0 sooner rather than later but if you want to discuss that please open an issue and we shall.

xavdid commented 9 years ago

Nah, seems good enough. go ahead and merge at your leisure.

rhymes commented 9 years ago

Done