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:
dingo
2026-02-28 20:03:10 -05:00
co-authored by Claude Happy
parent 502f1c16f6
commit 2ed7ad2ba9
2 changed files with 5 additions and 0 deletions
@@ -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:
+2
View File
@@ -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