Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance mock stravalib rate limiting behavior #82

Open
aaron-schroeder opened this issue Jan 17, 2023 · 0 comments
Open

Enhance mock stravalib rate limiting behavior #82

aaron-schroeder opened this issue Jan 17, 2023 · 0 comments
Labels
enhancement New feature or request Ideas

Comments

@aaron-schroeder
Copy link
Owner

aaron-schroeder commented Jan 17, 2023

Update 4/7/23: Now that the middle man of stravalib has been cut out, there is less behavior to mock. I think a version of this specialized mocking strategy is still called for. Maybe I can still use the stravalib mock until(/unless) I get something hand-rolled.


Right now, the mock client doesn't throw errors based on rate limiting, it just shows a stub rate limiter with user-supplied usage and limits.

Wondering if it's possible/easy to just plug in an actual stravalib limiter into my mocked version.

Exceptions to throw

  • RateLimitExceeded
  • RateLimitTimeout

Stravalib points of contact

  • pages.saved_activity
    • client.get_activity_streams() in layout()
    • Does not use get_activity for scalar data - relies on saved activity
  • strava_api.manage: Each account uses stravalib to display basic summary info
  • pages.strava_table: At least one stravalib request per page view
  • pages.strava_activity
    • client.get_activity_streams() in layout()
    • client.get_activity() in layout()
    • But generally, if someone is above their rate limit, what would the value be of showing a dashboard at all? It's 100% strava data.
  • tasks.async_save_activity: does it multiple times per task
@aaron-schroeder aaron-schroeder added enhancement New feature or request Ideas labels Jan 17, 2023
aaron-schroeder added a commit that referenced this issue Jan 21, 2023
- Also included some ratelimit error handling as it came up (incomplete)
- Re: #48 and #82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Ideas
Projects
None yet
Development

No branches or pull requests

1 participant