diff --git a/client/public/changelog.json b/client/public/changelog.json index f16602e..46933d9 100644 --- a/client/public/changelog.json +++ b/client/public/changelog.json @@ -3,6 +3,7 @@ { "date": "February 28, 2026", "items": [ + "Added Item Management menu with z, to transfer items or delete them. Shift+D is gone now.", "Added initial delay and loop delay for widgets, letting you do looped audio that has pauses." ] }, diff --git a/client/public/help.json b/client/public/help.json index 468ac94..a8722f7 100644 --- a/client/public/help.json +++ b/client/public/help.json @@ -88,10 +88,6 @@ { "keys": "Enter", "description": "Use item" - }, - { - "keys": "Piano mode", - "description": "When using a piano: press question mark for piano help. 1-9 (and 0 for the 10th slot) changes instrument, -/= changes octave, ASDFGHJKL;' plays C major notes, WETYUOP] plays sharps, Z starts/pauses/resumes recording, X plays recording, Enter plays demo, C stops demo/playback/recording, Escape exits" } ] }, diff --git a/client/public/version.js b/client/public/version.js index 2705062..bc2eef4 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.03.01 R330"; +window.CHGRID_WEB_VERSION = "2026.03.01 R331"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/server/app/server.py b/server/app/server.py index 1234d92..c6070a9 100644 --- a/server/app/server.py +++ b/server/app/server.py @@ -2094,6 +2094,13 @@ class SignalingServer: await self._activate_authenticated_client(client) return + if isinstance(packet, PingPacket): + await self._send( + client.websocket, + PongPacket(type="pong", clientSentAt=packet.clientSentAt), + ) + return + if not client.world_ready: PACKET_LOGGER.info("ignoring pre-ready packet id=%s type=%s", client.id, packet.type) return @@ -2332,13 +2339,6 @@ class SignalingServer: ) return - if isinstance(packet, PingPacket): - await self._send( - client.websocket, - PongPacket(type="pong", clientSentAt=packet.clientSentAt), - ) - return - if isinstance(packet, ItemAddPacket): if not self._client_has_permission(client, "item.create"): await self._send_item_result(client, False, "add", "Not authorized to create items.") diff --git a/server/tests/test_server_message_handling.py b/server/tests/test_server_message_handling.py index a36a4d6..796a023 100644 --- a/server/tests/test_server_message_handling.py +++ b/server/tests/test_server_message_handling.py @@ -314,6 +314,34 @@ async def test_auth_login_defers_activation_until_welcome_ready(monkeypatch: pyt assert any("has logged in" in getattr(packet, "message", "") for packet in broadcast_payloads) +@pytest.mark.asyncio +async def test_ping_works_before_welcome_ready(monkeypatch: pytest.MonkeyPatch) -> None: + server = SignalingServer("127.0.0.1", 8765, None, None) + username = f"ping_{uuid.uuid4().hex[:8]}" + server.auth_service.register(username, "password99") + ws = _fake_ws() + client = ClientConnection(websocket=ws, id="u1", nickname="tester") + + send_payloads: list[object] = [] + + async def fake_send(websocket: ServerConnection, packet: object) -> None: + send_payloads.append(packet) + + monkeypatch.setattr(server, "_send", fake_send) + + await server._handle_message( + client, + json.dumps({"type": "auth_login", "username": username, "password": "password99"}), + ) + assert client.world_ready is False + + await server._handle_message(client, json.dumps({"type": "ping", "clientSentAt": -1})) + + pong_packets = [packet for packet in send_payloads if getattr(packet, "type", "") == "pong"] + assert pong_packets + assert pong_packets[-1].clientSentAt == -1 + + @pytest.mark.asyncio async def test_auth_resume_failure_message_is_generic(monkeypatch: pytest.MonkeyPatch) -> None: server = SignalingServer("127.0.0.1", 8765, None, None)