Skip to content

Commit

Permalink
chore: clear old code for _id init
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeg committed Oct 19, 2024
1 parent ef4f30f commit b2a4bb4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
4 changes: 0 additions & 4 deletions modules/Connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
13 changes: 0 additions & 13 deletions public/js/connection.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b2a4bb4

Please sign in to comment.