Skip to content

fix: type build_di_container's connection as ASGIConnection - #86

Merged
lesnik512 merged 1 commit into
mainfrom
fix/asgi-connection-kwarg
Oct 19, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/asgi-connection-kwarg

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Litestar 2.25.0 (released 2026-10-18) warns when a reserved kwarg's annotation doesn't match the handler's connection class. build_di_container declared request: litestar.Request, but it also serves websocket handlers. So every websocket route that injects with FromDI raised a LitestarDeprecationWarning at startup, and the warning says this "will stop working in Litestar 3.0". The test suite turns warnings into errors, so three websocket tests on main fail against 2.25.0.

The parameter is now typed as ASGIConnection, which Litestar accepts for both Request and WebSocket handlers. The body already dispatches through classify_connection, so nothing else changes.

The three failing websocket tests are the regression tests. Ran on 3.11, 3.14 and 3.14t (22 passed each), and at the declared floor (litestar 2.23.0).

@lesnik512
lesnik512 merged commit 00d0312 into main Oct 19, 2026
12 checks passed
@lesnik512
lesnik512 deleted the fix/asgi-connection-kwarg branch October 19, 2026 05: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.

1 participant