fix: [Experimental hotfix 1] Fix Signaling issues Toju App

1. Server: WebSocket ping/pong heartbeat (index.ts)
Added a 30-second ping interval that pings all connected clients
Connections without a pong response for 45 seconds are terminated and cleaned up
Extracted removeDeadConnection() to deduplicate the cleanup logic between close events and dead connection reaping
2. Server: Fixed sendServerUsers filter bug (handler.ts:13)
Removed && cu.displayName from the filter — users who joined a server before their identify message was processed were silently invisible to everyone. This was the direct cause of "can't see each other" in session 2.
3. Client: Typing message now includes serverId
Added serverId: this.webrtc.currentServerId to the typing payload
Added a currentServerId getter on WebRTCService
This commit is contained in:
2026-03-12 23:53:10 +01:00
parent 7bf37ba510
commit 778e75bef5
5 changed files with 71 additions and 17 deletions

View File

@@ -513,6 +513,11 @@ export class WebRTCService implements OnDestroy {
this.activeServerId = serverId;
}
/** The server ID currently being viewed / active, or `null`. */
get currentServerId(): string | null {
return this.activeServerId;
}
/**
* Send an identify message to the signaling server.
*