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
This commit is contained in:
Classic298 2026-10-03 15:05:00 +02:00 • committed by GitHub
parent cd64930c05
commit 914ff1f116
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
)