From 452f005aea304ab6298f4a8b1f19662c7e03b556 Mon Sep 17 00:00:00 2001 From: indifferentketchup Date: Tue, 19 May 2026 18:38:18 +0000 Subject: [PATCH] silence secondary-bot 429 fallback noise from debug channel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two paired logWarn calls used to post to DEBUGGING_CHANNEL_ID every time the RENAMER_BOT secondary token hit Discord's per-channel rename quota: Warning: renamer — "429 rename channel=… retry_after=…" Warning: renameQueue — "secondary-bot 429; falling back to primary…" Both fire on the recoverable path: the channelQueue immediately falls back to the primary discord.js client, and that client's REST handler transparently waits out the retry_after and retries — the rename lands without operator action. Posting these to the debug channel was pure noise; staff were reading them as failures when nothing had failed. Demoted both to console.warn so they still appear in `docker logs broccolini` for diagnostic purposes but no longer post to Discord. Kept untouched: - utils/renamer.js:64 — 401/403 logWarn on secondary-bot auth/permission errors (real config problems; the operator does need to know). - services/channelQueue.js next.catch logError for status 401/403/429 — only fires when the fallback itself also failed (rare and worth a debug-channel post). --- services/channelQueue.js | 11 +++++++---- utils/renamer.js | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/services/channelQueue.js b/services/channelQueue.js index c6eefe1..19a60b6 100644 --- a/services/channelQueue.js +++ b/services/channelQueue.js @@ -25,10 +25,13 @@ async function executeRename(channel, entry) { // (403), or no token configured — fall back to the primary Discord.js client. // Non-fallback errors rethrow so enqueueRename's catch can classify/log. if (err && err.fallback === true && channel && typeof channel.setName === 'function') { - logWarn( - 'renameQueue', - `secondary-bot ${err.status ?? 'unavailable'}; falling back to primary channel=${channel.id}` - ).catch(() => {}); + // Local log only; discord.js's REST client transparently handles 429s + // on the primary fallback, so this used to post a paired warning to + // the debug channel for every secondary-bot quota event with no + // operator action required. Keep the visibility in container logs. + console.warn( + `[renameQueue] secondary-bot ${err.status ?? 'unavailable'}; falling back to primary channel=${channel.id}` + ); await channel.setName(currentName); } else { throw err; diff --git a/utils/renamer.js b/utils/renamer.js index 006cacc..55fd226 100644 --- a/utils/renamer.js +++ b/utils/renamer.js @@ -41,7 +41,10 @@ async function renameChannel(channelId, newName) { if (res.status === 429) { const retryAfterSec = (body && typeof body === 'object' && body.retry_after) || null; const retryAfterMs = retryAfterSec != null ? Math.ceil(Number(retryAfterSec) * 1000) : null; - logWarn('renamer', `429 rename channel=${channelId} retry_after=${retryAfterSec}`).catch(() => {}); + // Local log only; the channelQueue fallback path handles recovery + // transparently via discord.js's built-in 429 retry. Posting these to + // the debug channel was non-actionable noise. + console.warn(`[renamer] 429 rename channel=${channelId} retry_after=${retryAfterSec}`); // Respect retry_after up to 2000ms; otherwise fail over immediately. if (retryAfterMs != null && retryAfterMs > 0 && retryAfterMs <= 2000) {