mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 00:13:12 +09:00
Rewrite reconnection logic
Implement proper session tracking and resume on reconnect for the WebSocket server.
This commit is contained in:
1 parent
026b7f1306
commit
d4e072f376
24 files changed
+1403
-319
No files matched your search
@@ -27,25 +27,6 @@ describe("lib/link/link", function() {
|
||||
}));
|
||||
});
|
||||
|
||||
it("should close connector on invalid messages", function() {
|
||||
testConnector.sentMessages = [];
|
||||
testConnector.emit('message', { invalid: true });
|
||||
assert.deepEqual(
|
||||
testConnector.sentMessages,
|
||||
[{
|
||||
seq: testConnector._seq - 1,
|
||||
type: 'close',
|
||||
data: { reason: "Invalid message: Malformed" },
|
||||
}]
|
||||
);
|
||||
});
|
||||
|
||||
it("should disconnect on close", function() {
|
||||
testConnector.disconnectCalled = false;
|
||||
testConnector.emit('message', { seq: 1, type: 'close', data: { reason: "test" }});
|
||||
assert(testConnector.disconnectCalled, "disconnect was not called");
|
||||
});
|
||||
|
||||
it("should emitt error processing message to connector", async function() {
|
||||
testLink.setHandler('throws', () => { throw new Error("Handler error"); }, () => true);
|
||||
let result = events.once(testConnector, 'message');
|
||||
|
||||
Reference in new issue
Block a user