whio-api-sdk 1.1.7 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -59,14 +59,15 @@ export class WebSocketModule extends BaseClient {
|
|
|
59
59
|
},
|
|
60
60
|
forceNew: true,
|
|
61
61
|
timeout: 10000,
|
|
62
|
-
autoConnect:
|
|
62
|
+
autoConnect: true,
|
|
63
|
+
transports: ['websocket'],
|
|
63
64
|
});
|
|
64
65
|
this.setupEventHandlers();
|
|
65
66
|
// Set up connection promise BEFORE connecting
|
|
66
67
|
const connectionPromise = new Promise((resolve, reject) => {
|
|
67
68
|
const timeout = setTimeout(() => {
|
|
68
|
-
reject(
|
|
69
|
-
},
|
|
69
|
+
reject('WebSocket connection timeout after 15 seconds');
|
|
70
|
+
}, 15000);
|
|
70
71
|
const onConnect = () => {
|
|
71
72
|
var _a;
|
|
72
73
|
clearTimeout(timeout);
|
|
@@ -77,6 +78,7 @@ export class WebSocketModule extends BaseClient {
|
|
|
77
78
|
var _a;
|
|
78
79
|
clearTimeout(timeout);
|
|
79
80
|
(_a = this.socket) === null || _a === void 0 ? void 0 : _a.off('connect', onConnect);
|
|
81
|
+
console.error('ERROR IN THE CONNECTING');
|
|
80
82
|
reject(error);
|
|
81
83
|
};
|
|
82
84
|
this.socket.once('connect', onConnect);
|
package/package.json
CHANGED
|
@@ -78,7 +78,8 @@ export class WebSocketModule extends BaseClient {
|
|
|
78
78
|
},
|
|
79
79
|
forceNew: true,
|
|
80
80
|
timeout: 10000,
|
|
81
|
-
autoConnect:
|
|
81
|
+
autoConnect: true, // Prevent automatic connection
|
|
82
|
+
transports: ['websocket'],
|
|
82
83
|
});
|
|
83
84
|
|
|
84
85
|
this.setupEventHandlers();
|
|
@@ -86,8 +87,8 @@ export class WebSocketModule extends BaseClient {
|
|
|
86
87
|
// Set up connection promise BEFORE connecting
|
|
87
88
|
const connectionPromise = new Promise<void>((resolve, reject) => {
|
|
88
89
|
const timeout = setTimeout(() => {
|
|
89
|
-
reject(
|
|
90
|
-
},
|
|
90
|
+
reject('WebSocket connection timeout after 15 seconds');
|
|
91
|
+
}, 15000);
|
|
91
92
|
|
|
92
93
|
const onConnect = () => {
|
|
93
94
|
clearTimeout(timeout);
|
|
@@ -98,6 +99,7 @@ export class WebSocketModule extends BaseClient {
|
|
|
98
99
|
const onError = (error: Error) => {
|
|
99
100
|
clearTimeout(timeout);
|
|
100
101
|
this.socket?.off('connect', onConnect);
|
|
102
|
+
console.error('ERROR IN THE CONNECTING');
|
|
101
103
|
reject(error);
|
|
102
104
|
};
|
|
103
105
|
|