marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
7.95k stars 278 forks source link

Proxy fixes mpl #2897

Closed maxtheman closed 3 days ago

maxtheman commented 3 days ago

📝 Summary

fixes this bug that happens on closed when the web socket is connected that wasn't caught in the previous PR:

  File "/Users/max/Documents/causal_quartets/.venv/lib/python3.12/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 358, in asgi_send
    raise RuntimeError(msg % message_type)
RuntimeError: Unexpected ASGI message 'websocket.close', after sending 'websocket.close' or response already completed.

🔍 Description of Changes

It simply checks the state of the WebSocket before trying to close it.

📋 Checklist

📜 Reviewers

@mscolnick

vercel[bot] commented 3 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 1:50am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 1:50am
mscolnick commented 3 days ago

thank you! theres going to be some typing errors, but ill fix this for you