Fix WebSocket keepalive, modernize Riverpod, add connection monitoring UI#157
Draft
Copilot wants to merge 13 commits into
Draft
Fix WebSocket keepalive, modernize Riverpod, add connection monitoring UI#157Copilot wants to merge 13 commits into
Copilot wants to merge 13 commits into
Conversation
- Add flutter_webrtc dependency to pubspec.yaml - Create domain layer entities (VoiceUser, VoiceChannel, ChannelState, UserGroup) - Create voice chat provider for WebSocket communication - Create WebRTC provider for audio handling - Add voice chat page with tree-like channel structure - Add voice chat drawer item in navigation menu - Add voice chat route to app routing - Implement Go WebSocket server for signaling - Add server config with YAML-based channel and user group management - Support for Nostr npub-based authentication - Implement efficient state change broadcasting - Add speaking indicator and user mute functionality Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
- Add comprehensive VOICE_CHAT.md documentation - Rename createPeerConnection to initializePeerConnection to avoid naming conflict - Document architecture, protocol, and usage Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
- Add config.example.yaml with detailed comments and emoji icons - Add VOICE_CHAT_QUICKSTART.md for easy setup - Update voice_server README with better instructions - Include troubleshooting and remote access guide Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
- Fix mute toggle logic in WebRTC provider (track.enabled should be !state.isMuted) - Add null/empty check for displayName to prevent RangeError - Use list comprehension syntax for cleaner code - Add error handling for state update parsing - Add error logging for WebSocket message writes - Add TODO comment for CORS restriction in production Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Use explicit newMutedState variable and add comment explaining track.enabled relationship to mute state for better code clarity Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add voice channel features with user overview
Add voice chat with WebSocket signaling and tree-structured channels
Feb 13, 2026
- Replace WebSocket with WebRTC data channels for communication - Use pion/webrtc v4 for pure Go WebRTC implementation - Add HTTP signaling endpoint at /signaling - Implement WebRTC peer connection handling - Update all documentation to reflect WebRTC usage - Server now uses native WebRTC for better audio/video integration - Includes STUN server configuration for NAT traversal - Data channels provide encrypted, reliable messaging Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Copilot
AI
changed the title
Add voice chat with WebSocket signaling and tree-structured channels
Replace gorilla/websocket with pion/webrtc in voice server
Feb 13, 2026
- Use WebSocket (gorilla/websocket) for API/signaling - Use pion/webrtc for SFU (audio forwarding) - WebSocket handles state changes, channel management, user presence - WebRTC handles actual audio streams with SFU forwarding - Add both gorilla/websocket and pion/webrtc to dependencies - User struct has both WSConn and PeerConnection - WebRTC offers/answers/ICE sent via WebSocket messages - SFU forwards audio tracks to users in same channel - Update all documentation to reflect hybrid architecture - Server listens on ws://host:port for WebSocket - Tested: server compiles and runs successfully Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Copilot
AI
changed the title
Replace gorilla/websocket with pion/webrtc in voice server
Implement hybrid WebSocket + WebRTC SFU architecture for voice server
Feb 13, 2026
…th debug info - Update voice_chat_provider to use modern Riverpod (Notifier instead of StateNotifier) - Update webrtc_provider to use modern Riverpod with ref.onDispose cleanup - Add ConnectionStatus enum (disconnected, connecting, connected, error) - Add ping/pong support with latency tracking - Add automatic reconnection with backoff - Add connection status indicator in app bar with color coding - Add expandable debug info panel showing ping latency, reconnect attempts, etc - Reorganize server code into packages (models, websocket, server, handlers) - Add WebSocket ping/pong mechanism to keep connection alive - Fix WebSocket upgrade headers and CORS - Add proper connection timeouts and error handling - Server now properly handles ping/pong to prevent timeout issues Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
- Add pkg/README.md explaining new server package structure - Update voice_server/README.md with new build instructions - Update VOICE_CHAT.md with modern Riverpod info - Document connection state monitoring features - Document ping/pong latency tracking - Document automatic reconnection - Document new debug info panel - Update server architecture description Co-authored-by: 1-leo <58687994+1-leo@users.noreply.github.com>
Copilot
AI
changed the title
Implement hybrid WebSocket + WebRTC SFU architecture for voice server
Fix WebSocket keepalive, modernize Riverpod, add connection monitoring UI
Feb 13, 2026
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.
WebSocket connections were timing out due to missing upgrade headers and lack of keepalive. UI had no visibility into connection state. Server code was a 464-line monolith. Using legacy Riverpod StateNotifier pattern.
Client Changes
Riverpod 3.x Migration
StateNotifier→Notifierwithbuild()initializationref.onDispose()for cleanupNotifierProviderthroughoutConnection Lifecycle
Connection State UI
Server Restructure
WebSocket Fixes
Before/After
Protocol Additions
Latency calculated from round-trip timestamp delta.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.