@persistica/flux-agent 0.0.20 → 0.0.22
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.
- package/index.js +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -523,7 +523,6 @@ var ChannelStateManager = class {
|
|
|
523
523
|
async joinChannel(channelName, fluxWebSocketConnection, webSocketClient) {
|
|
524
524
|
if (webSocketClient) {
|
|
525
525
|
return new Promise((resolve, reject) => {
|
|
526
|
-
webSocketClient.send(`${SUBSCRIBE_NETWORK_CHANNEL_NAME}:${channelName}`);
|
|
527
526
|
const existingTimeout = this.connectionTimeouts.get(channelName);
|
|
528
527
|
if (existingTimeout) {
|
|
529
528
|
clearTimeout(existingTimeout);
|
|
@@ -543,6 +542,10 @@ var ChannelStateManager = class {
|
|
|
543
542
|
}
|
|
544
543
|
resolve(new FluxNetworkChannel(channelName, fluxWebSocketConnection));
|
|
545
544
|
};
|
|
545
|
+
fluxWebSocketConnection.interceptPackageTypeMessages(
|
|
546
|
+
SUBSCRIBED_NETWORK_CHANNEL_NAME,
|
|
547
|
+
cb
|
|
548
|
+
);
|
|
546
549
|
this.connectionTimeouts.set(
|
|
547
550
|
channelName,
|
|
548
551
|
setTimeout(() => {
|
|
@@ -551,10 +554,7 @@ var ChannelStateManager = class {
|
|
|
551
554
|
reject(new Error(`Channel subscription timed out for channel "${channelName}"`));
|
|
552
555
|
}, CONNECTION_TIMEOUT_MS)
|
|
553
556
|
);
|
|
554
|
-
|
|
555
|
-
SUBSCRIBED_NETWORK_CHANNEL_NAME,
|
|
556
|
-
cb
|
|
557
|
-
);
|
|
557
|
+
webSocketClient.send(`${SUBSCRIBE_NETWORK_CHANNEL_NAME}:${channelName}`);
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
560
|
return Promise.reject(new Error("Not connected"));
|