We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24fb817 commit 5df567eCopy full SHA for 5df567e
src/py/reactpy/reactpy/backend/asgi.py
@@ -152,11 +152,14 @@ async def component_dispatch_app(
152
send: Callable[..., Coroutine],
153
) -> None:
154
"""ASGI app for rendering ReactPy Python components."""
155
+ ws_connected: bool = False
156
+
157
while True:
158
+ # Future WS events on this connection will always be received here
159
event = await receive()
160
- if event["type"] == "websocket.connect" and not self.connected:
- self.connected = True
161
+ if event["type"] == "websocket.connect" and not ws_connected:
162
+ ws_connected = True
163
await send({"type": "websocket.accept"})
164
run_dispatcher = self.run_dispatcher(scope, receive, send)
165
if self.backhaul_thread:
0 commit comments