From dc02fbe33a89d8ea51ac42487893d03aff69708b Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Mon, 21 Mar 2022 01:10:31 -0400 Subject: [PATCH] Improve type hints & re-add missing log message in client.js --- node/src/client.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/node/src/client.js b/node/src/client.js index 7b04ae7..efaa17a 100644 --- a/node/src/client.js +++ b/node/src/client.js @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . import { Long } from "bson" + import { AuthApiClient, OAuthApiClient, @@ -22,10 +23,10 @@ import { KnownAuthStatusCode, util, } from "node-kakao" +/** @typedef {import("node-kakao").OAuthCredential} OAuthCredential */ + import chat from "node-kakao/chat" const { KnownChatType } = chat -/** @typedef {import("node-kakao").OAuthCredential} OAuthCredential */ -/** @typedef {import("./clientmanager.js").default} ClientManager} */ import { emitLines, promisify } from "./util.js" @@ -82,20 +83,21 @@ class UserClient { export default class PeerClient { /** - * @param {ClientManager} manager + * @param {import("./clientmanager.js").default} manager * @param {import("net").Socket} socket * @param {number} connID - * @param {Map} userClients */ constructor(manager, socket, connID) { this.manager = manager this.socket = socket this.connID = connID + this.stopped = false this.notificationID = 0 this.maxCommandID = 0 this.peerID = null + /** @type {Map} */ this.userClients = new Map() } @@ -444,6 +446,7 @@ export default class PeerClient { this.log("Ignoring old request", req.id) return } + this.log("Received request", req.id, "with command", req.command) this.maxCommandID = req.id let handler if (!this.peerID) {