Skip to content

Fix for Issue 320 re Rate Limit #321

Merged
merged 1 commit into from Apr 12, 2016

2 participants

@jeremylow
Collaborator

Regex was wrong such that GetStatus and GetUser would both try to get an endpoint that didn't exist. The previous error catching failed, because an AttributeError was never raised when trying to get a rate limit for an endpoint that didn't exist. So GetStatus was looking for rate limit information re /statuses/show/123, but the URL that method calls is just /statuses/show.json and the status_id is a query parameter. Same basic idea for /users/show/456 v /users/show.json

This fixes that and amends the behavior to return a default rate limit object in the case that an endpoint is not found the first time around and then sets it the next time. This might cause some issues if Twitter consistently doesn't update their /application/rate_limit_status.json endpoint, but I think we should cross that bridge when we come to it.


This change is Reviewable

@jeremylow jeremylow fixes rate limit error for /statuses/show/:id and /users/show endpoint
67575e0
@bear
Owner
bear commented Apr 12, 2016

Reviewed 2 of 2 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@bear
Owner
bear commented Apr 12, 2016

LGTM

@jeremylow jeremylow merged commit 006d6ab into master Apr 12, 2016

1 of 2 checks passed

Details code-review/reviewable Checking review status...
Details ci/circleci Your tests passed on CircleCI!
@jeremylow jeremylow deleted the fixes/issue320 branch Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.