I'll systematically investigate and fix the WebSocket connection errors preventing data from reaching all tabs.
I found the issue! The use-deriv.ts hook has a problem at line 89. When wsRef.current?.subscribeTicks is called, it's using optional chaining (?.), which means if the WebSocket is null, the subscription ID becomes undefined. This causes all subsequent tabs to fail to receive data. Let me check for more issues and fix them all:
Now I've identified the core issues. The main problem is in the use-deriv.ts hook where the WebSocket connection might not be established before attempting to subscribe. Let me fix all the WebSocket connection errors:
I've fixed the critical WebSocket connection errors by ensuring the WebSocket connection is fully established before attempting to subscribe to ticks, adding proper validation for tick data to prevent processing invalid responses, implementing automatic reconnection with a 3-second delay if the initial connection fails, and adding comprehensive error handling and logging throughout the connection lifecycle. The fix ensures that all tabs receive data properly by guaranteeing a stable WebSocket connection before any subscriptions are created.
I can see the "UnrecognisedRequest" error is still occurring. This means the WebSocket is sending a malformed request to Deriv. Let me trace and fix the exact source of this error:
You can send messages while the preview loads