mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 23:14:37 +00:00
Enhance socket connection logging and URL handling
- Added logging for the backend URL in the `runtime_socket_connect` function to improve traceability. - Updated the `SocketManager` to convert HTTP/HTTPS URLs to WebSocket URLs, enhancing connection handling. - Improved error logging to capture detailed error chains during connection failures, aiding in debugging.
This commit is contained in:
@@ -37,10 +37,14 @@ export async function connectRustSocket(token: string): Promise<void> {
|
||||
if (!isTauri()) return;
|
||||
|
||||
try {
|
||||
console.log('[TauriSocket] Connecting Rust socket to', BACKEND_URL);
|
||||
await invoke('runtime_socket_connect', { token, url: BACKEND_URL });
|
||||
console.log('[TauriSocket] Rust socket connecting');
|
||||
console.log('[TauriSocket] Rust socket connect call succeeded');
|
||||
} catch (error) {
|
||||
console.error('[TauriSocket] Failed to connect Rust socket:', error);
|
||||
// Ensure Redux status reflects the failure
|
||||
const uid = getSocketUserId();
|
||||
store.dispatch(setStatusForUser({ userId: uid, status: 'disconnected' }));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user