Skip to content

fix(websocket): respond to getState requests directly over WebSocket#418

Merged
Splode merged 1 commit intomainfrom
bugfix/fix-websocket-getstate-response
Apr 30, 2026
Merged

fix(websocket): respond to getState requests directly over WebSocket#418
Splode merged 1 commit intomainfrom
bugfix/fix-websocket-getstate-response

Conversation

@Splode
Copy link
Copy Markdown
Owner

@Splode Splode commented Apr 30, 2026

The getState handler was calling app.emit("timer:state-query", ...) which fires a Tauri frontend IPC event instead of writing back through the WebSocket connection. The requesting client received nothing.

The fix introduces a tokio mpsc channel per connection so the receive task can push direct replies to the send task, which holds the WebSocket sender. handle_client_message is refactored to accept Option<TimerSnapshot> and an unbounded sender, removing the AppHandle dependency and making the function unit-testable without a full Tauri app.

Adds five unit tests and one network-level integration test (tokio-tungstenite).

Closes #415

The getState handler was calling app.emit("timer:state-query", ...) which
fires a Tauri frontend IPC event instead of writing back through the
WebSocket connection. The requesting client received nothing.

The fix introduces a tokio mpsc channel per connection so the receive task
can push direct replies to the send task, which holds the WebSocket sender.
handle_client_message is refactored to accept Option<TimerSnapshot> and an
unbounded sender, removing the AppHandle dependency and making the function
unit-testable without a full Tauri app.

Adds five unit tests and one network-level integration test (tokio-tungstenite).

Closes #415
@Splode Splode merged commit 8ff986e into main Apr 30, 2026
8 checks passed
@Splode Splode deleted the bugfix/fix-websocket-getstate-response branch April 30, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Websocket API | getState returns no response

1 participant