From b2a4bb4dacce35a5948d05a29ffb401e3531a281 Mon Sep 17 00:00:00 2001 From: Timothee Groleau Date: Sat, 19 Oct 2024 16:24:29 +0800 Subject: [PATCH] chore: clear old code for _id init --- modules/Connection.js | 4 ---- public/js/connection.js | 13 ------------- 2 files changed, 17 deletions(-) diff --git a/modules/Connection.js b/modules/Connection.js index 3986e576..cfbfc592 100644 --- a/modules/Connection.js +++ b/modules/Connection.js @@ -53,10 +53,6 @@ class Connection extends EventEmitter { id: this.id, }, ]); - - // for backward compatibility - // TODO: remove after a while - this.send(['_id', this.id]); } send(message) { diff --git a/public/js/connection.js b/public/js/connection.js index d9751f42..c72e87fb 100644 --- a/public/js/connection.js +++ b/public/js/connection.js @@ -1,7 +1,5 @@ import BinaryFrame from '/js/BinaryFrame.js'; -const ID_MIN_RESET_TIME_IN_SECONDS = 5; - export default class Connection { constructor(uri = null, extra_search_params = null) { let url; @@ -70,17 +68,6 @@ export default class Connection { this.onInit(); return; } - case '_id': { - if ( - data[1] !== this.id || - Date.now() - this.id_ts > ID_MIN_RESET_TIME_IN_SECONDS * 1000 - ) { - this.id = data[1]; - this.id_ts = Date.now(); - this.onInit(); - } - return; - } case '_kick': { const reason = data[1]; console.log('Socket kicked', reason);