Skip to content

Fix synchronous callbacks on rejected requests - #86

Open
bensynapse wants to merge 1 commit into
long2ice:mainfrom
bensynapse:fix-sync-callbacks
Open

bensynapse wants to merge 1 commit into
long2ice:mainfrom
bensynapse:fix-sync-callbacks

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

A synchronous callback returning JSONResponse currently crashes when the rate limit is reached. The error is TypeError: 'JSONResponse' object can't be awaited.

The shared callback helper now awaits awaitable results and returns other values directly. HTTP and WebSocket dependencies and middleware use it.

make ci passes all 17 tests on Python 3.10 and 3.14 with pyrate-limiter 4.0.2. make build and the Ruff formatting check pass. Three synchronous callback regressions fail on unchanged upstream. Nine async callback cases pass on both versions.

Python 3.9 has an existing dependency mismatch on unchanged upstream. Its locked pyrate-limiter 3.9.0 rejects the blocking argument before callbacks run. This PR leaves dependency metadata unchanged.

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.

1 participant