Summary
Follow-up to #126. The bugs and resource leaks found in that audit are all merged; this issue tracks the remaining findings — duplication, dead code, and bad practices. None of these are correctness bugs on their own, but they make the codebase harder to maintain and, in a couple of cases, hide real inconsistencies (e.g. differing retry behavior between two code paths that look interchangeable).
Sub-issues
All 9 real findings are merged to master. VERSION is now 1.8.22.
Closed as invalid (3 of 12)
Checked each premise against the actual code before implementing rather than shipping the change:
Follow-ups filed for scope split out of a merged PR
Process
Lower risk than #126's items, but larger/more opinionated refactors — no fixed merge order needed since these are mostly independent of each other. Pick them up individually as time allows, each as its own PR.
🤖 Generated with Claude Code
Summary
Follow-up to #126. The bugs and resource leaks found in that audit are all merged; this issue tracks the remaining findings — duplication, dead code, and bad practices. None of these are correctness bugs on their own, but they make the codebase harder to maintain and, in a couple of cases, hide real inconsistencies (e.g. differing retry behavior between two code paths that look interchangeable).
Sub-issues
AudioManager.Stop()duplicates its stop-message logic across two branches — merged in refactor(audiomanager): factor the duplicated stop-clip logic into one helper #161AudioPlayerFactory.NewPlayer()is dead branching around a single-member enum — merged in refactor(audioplayerfactory): fail loudly on an unsupported player type #160FFmpegAudioPlayerhas two duplicate network-fetch implementations with inconsistent retry behavior — merged in refactor(ffmpeg): share the ffmpeg stdin write and cleanup between fetch paths #170 (partial scope; retry parity split to CF-bypass (curl_cffi) streaming has no retry, unlike the aiohttp path #169)TorchlightHandlerawaits independent async setup calls sequentially instead of concurrently — closed as invalid, see belowCommands.py/URLInfo.py/FlareSolverr.py— merged in refactor(commands): replace hand-rolled fetch-with-timeout blocks with helpers #166Config/AccessManager/Sourcemod/TriggerManagerduplicate path-resolution and JSON-loading instead of composingConfig— merged in refactor(config): share config path resolution and JSON loading via ConfigFile #165 (error-handling consistency split to Config loading error handling is inconsistent: two files tolerate malformed JSON, two crash #164)self.logger = logging.getLogger(...)instead of a shared helper — closed as invalid, see belowAsyncClient/SourceRCONClient/SourceRCONServereach hand-roll a different reconnect/retry policy — closed as invalid, see belowFFmpegAudioPlayerhardcodes MyInstants-specific headers inside the generic streaming path — merged in refactor(ffmpeg): resolve per-domain request headers from a registry #168FFmpegAudioPlayerhardcodes the ffmpeg binary path instead of reading it fromConfig— merged in feat(ffmpeg): make the ffmpeg binary path configurable #162CommandHandleruses a string class-name comparison instead of aBaseCommandflag for menu-echo behavior — merged in refactor(commandhandler): replace the menu-echo class-name check with a flag #163FlareSolverr's bypass URL is module-global mutable state rather than configured — merged in refactor(flaresolverr): replace module-global state with a configured client #167All 9 real findings are merged to
master. VERSION is now1.8.22.Closed as invalid (3 of 12)
Checked each premise against the actual code before implementing rather than shipping the change:
asyncio.gatheragainst the realAsyncClient.Send: it holdssend_lockacross the whole round-trip with one sharedrecv_future, so concurrent sends serialize anyway.gatherwas 0.98x (marginally slower), not faster.super().__init__()at all, so a mixin would need adding cooperative super-calls project-wide — more churn than the line it saves.Follow-ups filed for scope split out of a merged PR
Range-resume support and a live voice-server/Cloudflare-source test setup to verify safelyProcess
Lower risk than #126's items, but larger/more opinionated refactors — no fixed merge order needed since these are mostly independent of each other. Pick them up individually as time allows, each as its own PR.
🤖 Generated with Claude Code