Fix WebSocket 1009 — increase Godot receive buffer and NATS max payload
Godot's WebSocketPeer.inbound_buffer_size defaults to 65535 bytes (64 KB). content.sync.ack for a full card catalog (200 cards with assets and animation bindings) exceeds this, causing Godot to close the connection with code 1009 "Message too big" every time content.sync is called. - Network.gd: set inbound_buffer_size = 4 MB before connect_to_url so the client can receive large sync responses without dropping the connection. - deployment-nats.yaml: raise NATS max_payload from 1 MB to 8 MB (-max_payload 8388608) so the content service can reply with large card batches through NATS without hitting a publish-too-large error as the card catalog grows. Note: NATS pod needs a rollout restart to apply the new max_payload arg: kubectl rollout restart deployment/nats -n stone-server Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -126,6 +126,9 @@ func is_online() -> bool:
|
||||
|
||||
func _connect_now() -> void:
|
||||
_ws = WebSocketPeer.new()
|
||||
# content.sync.ack for a full card catalog can be several hundred KB.
|
||||
# Godot's default is 65535 bytes which triggers code 1009 on large responses.
|
||||
_ws.inbound_buffer_size = 4 * 1024 * 1024 # 4 MB
|
||||
_state = _State.CONNECTING
|
||||
var err := _ws.connect_to_url(SERVER_URL)
|
||||
if err != OK:
|
||||
|
||||
@@ -22,6 +22,8 @@ spec:
|
||||
- "-js"
|
||||
- "-m"
|
||||
- "8222"
|
||||
- "-max_payload"
|
||||
- "8388608" # 8 MB — allows large content.sync payloads through NATS
|
||||
ports:
|
||||
- name: client
|
||||
containerPort: 4222
|
||||
|
||||
Reference in New Issue
Block a user