refactor(recovery): remove session persistence, simplify 24/7 auto-join & fix gateway races

- Remove boot-time recovery.json session persistence (RecoveryManager)
- Replace 401 circuit-breaker with exponential backoff + 5-min guild ban
- Add global voice join queue in FluxerRevoice (one join at a time, 3s gap)
- Add 15s startup GuildDelete deferral to avoid wiping state during outages
- Fix pendingSpawns Set/Map API mismatch in disconnect handler
- Fix cross-guild join suppressing recovery for unrelated guild disconnects
- Expose client._recoveryManager; remove shutdown recovery-save hooks
- Increase guildMinJoinInterval from 7000ms to 8000ms
This commit is contained in:
NoLogicAlan committed 2026-05-12 16:38:24 +03:00
1 parent 0d23d1bd50
commit 7b2d29e229
6 files changed
+488 -666

No files matched your search

+1 -3
View File
@@ -541,12 +541,10 @@ export default class Player extends EventEmitter {
// keep retrying — 401 is a permission problem, not a transient failure.
// Retrying just creates more 401 errors and recovery loops.
// Instead, give up on recovery and let the 24/7 system schedule a
// delayed respawn with proper cooldown.
// delayed respawn.
if (this._lastDisconnectReason === "401") {
const timeSinceDisconnect = Date.now() - this._lastDisconnectTime;
if (timeSinceDisconnect < 60_000) {
// Within 60 seconds of a 401 — don't attempt recovery.
// Let the 24/7 system handle reconnection with its own delay.
logger.warn(
`[Player] Skipping recovery for guild ${this._guildId} — ` +
`last disconnect was 401 Unauthorized (${timeSinceDisconnect / 1000}s ago). ` +