fix(socket): added better debug logging and added polling as priority over websocket, for better iOS connection

This commit is contained in:
2025-12-07 20:38:37 +01:00
parent 91ef4158b7
commit d6d0a70116
2 changed files with 48 additions and 4 deletions

View File

@@ -186,7 +186,15 @@ class BrickSocket {
if (this.socket === undefined) {
this.socket = io.connect(`${window.location.origin}/${this.namespace}`, {
path: this.path,
transports: ["websocket"],
// Adding Polling as iOS is having issues with websockets
transports: ["polling", "websocket"],
// Increase timeout for slow mobile connections
timeout: 30000,
// Reconnection settings
reconnectionDelay: 1000,
reconnectionDelayMax: 5000,
// Allow upgrade from polling to websocket
upgrade: true,
});
// Complete