Emit resume instead of connect on resumed connections

Raise "resume" instead of "connect" when a connection is re-established
after a connection drop.  This prevents logic meant to resynchronize
state after a full reconnection from being invoked whenever the
connection was temporarily dropped.
This commit is contained in:
Hornwitser committed 2021-02-19 14:28:19 +01:00
1 parent b4cbe2355d
commit 1de8b76303
6 files changed
+26 -18

No files matched your search

+3 -3
View File
@@ -34,17 +34,17 @@ describe("Integration of lib/link", function() {
it("should reconnect on connection lost", async function() {
controlConnector._socket.close(1008, "Test");
await events.once(controlConnector, "connect");
await events.once(controlConnector, "resume");
});
it("should reconnect on connection terminated", async function() {
controlConnector._socket.terminate();
await events.once(controlConnector, "connect");
await events.once(controlConnector, "resume");
});
it("should reconnect on connection heartbeat timeout", async function() {
controlConnector.stopHeartbeat();
await events.once(controlConnector, "connect");
await events.once(controlConnector, "resume");
});
it("should invalidate on reconnection with bad session token", async function() {