Fix 7 corner cases found in second review pass

Critical:
- Persist serverProtocol/ts6ApiKey in database schema so TS6 config
  survives restarts (added columns + manager save/load)

Medium:
- Clear udpErrorTimer on disconnect to prevent memory leak and stale
  log messages from firing after teardown
- Guard against double connect() by disconnecting old client first
- Add settled guard in TS6HttpQuery.request() to prevent double
  reject when both res error and req error fire
- Add res.on("error") handler to TS6HttpQuery response stream

Low:
- Cap probeTS3Query banner buffer at 256 bytes to prevent memory abuse
  from non-TS3 services sending large data on port 10011
- Remove unnecessary EventEmitter inheritance from TS6HttpQuery
- Update database test fixtures with new serverProtocol/ts6ApiKey fields

https://claude.ai/code/session_016WhH58avUD9xy2dgADJgTh
This commit is contained in:
Claude committed 2026-04-03 13:38:49 +00:00
1 parent 9e45193e2c
commit 6184f38330
6 files changed
+54 -15

No files matched your search

+4
View File
@@ -60,6 +60,8 @@ describe("database", () => {
defaultChannel: "Music",
channelPassword: "",
autoStart: true,
serverProtocol: "",
ts6ApiKey: "",
};
botDb.saveBotInstance(instance);
@@ -86,6 +88,8 @@ describe("database", () => {
defaultChannel: "Music",
channelPassword: "",
autoStart: false,
serverProtocol: "",
ts6ApiKey: "",
});
expect(botDb.deleteBotInstance("bot1")).toBe(true);