You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 12, 2026. It is now read-only.
The rate limiter uses hardcoded values (50 requests/10s) and doesn't adapt to actual API responses. Basecamp returns rate limit information that we currently ignore.
"The first rate limit you'll commonly encounter is currently 50 requests per 10 second period per IP address."
"Multiple dynamic limits exist for different request types (GET vs POST) and time windows."
Proposed Solution
1. Add header parsing in internal/api/ratelimit.go
typeRateLimitInfostruct {
Limitint// Total requests allowed per windowRemainingint// Requests remaining in current windowReset time.Time// When the window resetsRetryAfterint// Seconds to wait (from 429 responses)
}
funcParseRateLimitHeaders(headers http.Header) *RateLimitInfofunc (rl*RateLimiter) UpdateFromHeaders(info*RateLimitInfo)
2. Modify internal/api/client.go to extract headers
After each successful response, check for rate limit headers
Update the global rate limiter with actual remaining capacity
When Remaining is low (< 5), proactively increase delay between requests
Problem
The rate limiter uses hardcoded values (50 requests/10s) and doesn't adapt to actual API responses. Basecamp returns rate limit information that we currently ignore.
Current behavior (
internal/api/ratelimit.go:26):Per Basecamp API docs:
Proposed Solution
1. Add header parsing in
internal/api/ratelimit.go2. Modify
internal/api/client.goto extract headersRemainingis low (< 5), proactively increase delay between requests3. Handle 429 with
Retry-AfterRetry-Afterheader when presentFiles to Modify
internal/api/ratelimit.goRateLimitInfo,ParseRateLimitHeaders(),UpdateFromHeaders()internal/api/client.go:64-67httpClient.Do()internal/api/ratelimit_test.goHeaders to Parse
Based on common API patterns (Basecamp may use some/all):
Acceptance Criteria
Retry-Afterheader on 429 responses (confirmed in API docs)X-RateLimit-*headers if presentTesting
Retry-Afterparsing (integer seconds)