Open
Conversation
Updates to freenet-stdlib 0.1.30 which fixes WebSocket send silently failing when the connection is closed. The fix adds: 1. Check WebSocket ready_state before sending, returns error if not OPEN 2. Enables onclose callback to notify when connection drops This fixes the bug where River would log "Successfully sent update" even when the WebSocket was closed and messages were being silently dropped. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
River UI was logging "Successfully sent update" even when messages were being silently dropped due to a closed WebSocket connection. This caused messages between users to not be delivered with no error indication.
Root cause: The WebSocket spec specifies that
send()silently discards data when the socket is in CLOSING or CLOSED state.freenet-stdlib'sWebApi::send()was returningOk(())even when the underlying WebSocket wasn't open.Solution
freenet-stdlib 0.1.30 adds:
ready_statebefore sending - returns error if WebSocket is not OPENonclosecallback to notify clients when connection dropsRiver will now properly receive errors when WebSocket sends fail, enabling proper error handling and reconnection logic.
Testing
cargo checkpasses[AI-assisted - Claude]