Skip to content

Conversation

@jottakka
Copy link
Contributor

Reponse 403 was returning RateLimiting all the time, but it was due only checking if rate limiting header exists, but it should be checked if it is 0 also.

@jottakka jottakka self-assigned this Nov 10, 2025
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ade-tdk/arcade_tdk/providers/http/error_adapter.py 92.30% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jottakka jottakka requested a review from EricGustin November 10, 2025 19:47
return any(header.lower() in [h.lower() for h in headers] for header in RATE_HEADERS)
# Check if rate limit is actually exhausted (remaining requests is 0)
headers_lower = {k.lower(): v for k, v in headers.items()}
remaining = headers_lower.get("x-ratelimit-remaining")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x-ratelimit-remaining is probably not universal (?). Quick search for equivalent headers could help us make this more robust ratelimit-remaining, x-rate-limit-remaining, x-app-rate-limit-remaining, etc.

# Check if rate limit is actually exhausted (remaining requests is 0)
headers_lower = {k.lower(): v for k, v in headers.items()}
remaining = headers_lower.get("x-ratelimit-remaining")
return remaining is not None and remaining.isdigit() and int(remaining) == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the value isn't a digit then are there other common formats that we could handle here?

@jottakka jottakka requested a review from EricGustin November 14, 2025 00:31
@jottakka jottakka merged commit b4720c2 into main Nov 14, 2025
43 checks passed
@jottakka jottakka deleted the francisco/fixing-http-error-interceptor-403 branch November 14, 2025 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants