From 6936060ec8791b32ed369d5a289b564ec83c4b91 Mon Sep 17 00:00:00 2001 From: NoLogicAlan Date: Sun, 15 Nov 2026 02:01:47 +0300 Subject: [PATCH] fix(status): resolve audioNode incident on nodeConnect and add status card self-healing - Listen for Lavalink nodeConnect event in Bot.mjs to resolve audioNode incidents on connection - Check audio node connection status immediately after LavalinkManager.init() - Add auto-resolution self-healing in StatusChannelManager if audio node or gateway is active --- src/core/Bot.mjs | 10 ++++++++++ src/services/StatusChannelManager.mjs | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/src/core/Bot.mjs b/src/core/Bot.mjs index 1825357..7e9153e 100644 --- a/src/core/Bot.mjs +++ b/src/core/Bot.mjs @@ -394,6 +394,13 @@ class Remix { this.players?.resumeAllOnNodeReconnect?.(); } }); + this.lavalink.on("nodeConnect", (node) => { + logger.lavalink("[Lavalink] Node connected: " + (node?.id ?? "main")); + this.statusChannel?.resolveIncident("audioNode"); + if (this._hasBooted) { + this.players?.resumeAllOnNodeReconnect?.(); + } + }); this.lavalink.on("nodeReconnect", () => { this.statusChannel?.resolveIncident("audioNode"); if (this._hasBooted) { @@ -426,6 +433,9 @@ class Remix { }); await this.lavalink.init(); this.playerContext.lavalink = this.lavalink; + if (this.lavalink?._nodeConnected || Boolean(this.lavalink?.getNode?.())) { + this.statusChannel?.resolveIncident("audioNode"); + } } this.gatewayHandler.onReady(); diff --git a/src/services/StatusChannelManager.mjs b/src/services/StatusChannelManager.mjs index 9d9e4f6..39553d1 100644 --- a/src/services/StatusChannelManager.mjs +++ b/src/services/StatusChannelManager.mjs @@ -369,6 +369,14 @@ export class StatusChannelManager { list.push({ name: inc.name, status: `⚪ ${this.t("responses.statusChannel.disabled")}` }); continue; } + if (key === "audioNode" && inc.down && (this.remix.lavalink?._nodeConnected || Boolean(this.remix.lavalink?.getNode?.()))) { + /* Self-heal: audio engine node is connected and operational */ + this.resolveIncident("audioNode", "Audio engine reconnected successfully").catch?.(() => {}); + } + if (key === "gateway" && inc.down && this.remix._gatewayConnected) { + /* Self-heal: gateway connection is operational */ + this.resolveIncident("gateway", "Fluxer Gateway reconnected").catch?.(() => {}); + } if (inc.down) { list.push({ name: inc.name, status: `🔴 ${this.t("responses.statusChannel.outage")}` }); if (inc.impact === "Critical") hasCriticalDown = true;