Improve type hints & re-add missing log message in client.js

This commit is contained in:
Andrew Ferrazzutti 2022-03-21 01:10:31 -04:00
parent ee3daab48d
commit dc02fbe33a
1 changed files with 7 additions and 4 deletions

View File

@ -14,6 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
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<string, UserClient>} 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<string, UserClient>} */
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) {