src: Remove _trace from different places in the WS (#3679)

* src: Remove `ws._trace` from READY

* src: Remove `ws._trace` from RESUME

* lint: Fix lint by removing unused packet (#7)

Co-authored-by: bdistin <bdistin@gmail.com>
This commit is contained in:
Vlad Frangu
2020-01-13 19:54:15 +02:00
committed by Amish Shah
parent f6d1db6a24
commit 684bb1bf36
2 changed files with 3 additions and 6 deletions

View File

@@ -74,8 +74,7 @@ class ReadyHandler extends AbstractHandler {
const ws = this.packetManager.ws;
ws.sessionID = data.session_id;
ws._trace = data._trace;
client.emit('debug', `READY ${ws._trace.join(' -> ')} ${ws.sessionID}`);
client.emit('debug', `READY ${ws.sessionID}`);
ws.checkIfReady();
}
}

View File

@@ -2,18 +2,16 @@ const AbstractHandler = require('./AbstractHandler');
const Constants = require('../../../../util/Constants');
class ResumedHandler extends AbstractHandler {
handle(packet) {
handle() {
const client = this.packetManager.client;
const ws = client.ws.connection;
ws._trace = packet.d._trace;
ws.status = Constants.Status.READY;
this.packetManager.handleQueue();
const replayed = ws.sequence - ws.closeSequence;
ws.debug(`RESUMED ${ws._trace.join(' -> ')} | replayed ${replayed} events.`);
ws.debug(`RESUMED | replayed ${replayed} events.`);
client.emit(Constants.Events.RESUME, replayed);
ws.heartbeat();
}