From 914ff1f11666d54c2a25236f00fcceaa884d7a2e Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 3 Oct 2026 15:05:00 +0200 Subject: [PATCH] fix: large pastes into a note are lost after a reload (#31893) Pasting a large block of text (around 150 KB or more) into a note made the note's live connection drop and reconnect, and the text was never saved, so a reload showed the note without it. Each edit message carries the whole note in several formats, which pushed it past the server's 1 MB cap on a single message. That cap is now 16 MiB, the same size the server already accepts for a websocket message, so notes with up to about 2 MB of text save again. Fixes #26140 --- backend/open_webui/socket/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/open_webui/socket/main.py b/backend/open_webui/socket/main.py index b901c658c4..5c1039adfe 100644 --- a/backend/open_webui/socket/main.py +++ b/backend/open_webui/socket/main.py @@ -72,6 +72,9 @@ REDIS = None # Configure CORS for Socket.IO SOCKETIO_CORS_ORIGINS = '*' if CORS_ALLOW_ORIGIN == ['*'] else CORS_ALLOW_ORIGIN +# Large notes outgrow the 1 MB default; match uvicorn's 16 MiB websocket limit +SOCKETIO_MAX_HTTP_BUFFER_SIZE = 16 * 1024 * 1024 + def get_room_sid_map(manager, namespace: str, room: str): """Return this process's Socket.IO sid map for a room, without copying it.""" @@ -110,6 +113,7 @@ if WEBSOCKET_MANAGER == 'redis': logger=WEBSOCKET_SERVER_LOGGING, ping_interval=WEBSOCKET_SERVER_PING_INTERVAL, ping_timeout=WEBSOCKET_SERVER_PING_TIMEOUT, + max_http_buffer_size=SOCKETIO_MAX_HTTP_BUFFER_SIZE, engineio_logger=WEBSOCKET_SERVER_ENGINEIO_LOGGING, ) else: @@ -124,6 +128,7 @@ else: logger=WEBSOCKET_SERVER_LOGGING, ping_interval=WEBSOCKET_SERVER_PING_INTERVAL, ping_timeout=WEBSOCKET_SERVER_PING_TIMEOUT, + max_http_buffer_size=SOCKETIO_MAX_HTTP_BUFFER_SIZE, engineio_logger=WEBSOCKET_SERVER_ENGINEIO_LOGGING, )