godot icon indicating copy to clipboard operation
godot copied to clipboard

WebsocketPeer not handling last message when server send that message right before closing the connection

Open lare-dn42 opened this issue 5 months ago • 1 comments
trafficstars

Tested versions

  • tested in 4.4.1

System information

Godot v4.4.1.stable (49a5bc7b6) - Freedesktop SDK 24.08 (Flatpak runtime) on Wayland - X11 display driver, Multi-window, 2 monitors - OpenGL 3 (Compatibility) - AMD Radeon 760M (radeonsi, phoenix, LLVM 19.1.7, DRM 3.61, 6.12.32-1-lts) - AMD Ryzen 5 7640U w/ Radeon 760M Graphics (12 threads)

Issue description

when the a (external) websocket server sends a message and immediately after that closes the connection, the last message won't get processed by the client (or at least isn't available to be handled by client code)

Steps to reproduce

  • connect to a websocket server via WebsocketPeer
  • (optional: send a message to the server)
  • wait for server to send message, but server sends a message and immediately closes the connection after that
  • no packets available in client via get_available_packet_count() or get_packet()

Minimal reproduction project (MRP)

websocket-closing-no-packet.zip

also included a minimal websocket server in python which after receiving a "PING" sends a "PONG" and then closes the connection

lare-dn42 avatar Jun 12 '25 09:06 lare-dn42