From 3f87b6af1a6574cc402c28aa174600722b3447a1 Mon Sep 17 00:00:00 2001 From: Joey Stanford Date: Sun, 19 Jul 2026 08:50:20 -0600 Subject: [PATCH] feat: handle LoginFail push frames Push code 0x86 (LoginFail) was defined but unused, so failed room/repeater logins fell through to the unhandled-frame console log. Emit LoginFail with the same reserved + 6-byte pubkey prefix layout as LoginSuccess. Carried as a pnpm patch in Colorado-Mesh/mesh-client. --- src/connection/connection.js | 9 +++++++++ src/constants.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/connection/connection.js b/src/connection/connection.js index af6f6d6..9e26a25 100644 --- a/src/connection/connection.js +++ b/src/connection/connection.js @@ -400,6 +400,8 @@ class Connection extends EventEmitter { this.onRawDataPush(bufferReader); } else if(responseCode === Constants.PushCodes.LoginSuccess){ this.onLoginSuccessPush(bufferReader); + } else if(responseCode === Constants.PushCodes.LoginFail){ + this.onLoginFailPush(bufferReader); } else if(responseCode === Constants.PushCodes.StatusResponse){ this.onStatusResponsePush(bufferReader); } else if(responseCode === Constants.PushCodes.LogRxData){ @@ -459,6 +461,13 @@ class Connection extends EventEmitter { }); } + onLoginFailPush(bufferReader) { + this.emit(Constants.PushCodes.LoginFail, { + reserved: bufferReader.readByte(), // reserved + pubKeyPrefix: bufferReader.readBytes(6), // 6 bytes of public key this login fail is from + }); + } + onStatusResponsePush(bufferReader) { this.emit(Constants.PushCodes.StatusResponse, { reserved: bufferReader.readByte(), // reserved diff --git a/src/constants.js b/src/constants.js index 4ba7e78..5888057 100644 --- a/src/constants.js +++ b/src/constants.js @@ -101,7 +101,7 @@ class Constants { MsgWaiting: 0x83, RawData: 0x84, LoginSuccess: 0x85, - LoginFail: 0x86, // not usable yet + LoginFail: 0x86, StatusResponse: 0x87, LogRxData: 0x88, TraceData: 0x89,