From e56677acc551a936094197d8bd80f68f67555ca4 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Fri, 10 Apr 2026 16:02:02 -0500 Subject: [PATCH] fix: address review feedback (#120) - Remove cache write in user-team fallback path of _get_channel_embed_color() to prevent cross-user color contamination in non-team channels (e.g. #general) - Invalidate _standings_cache on recalculate_standings() so admin-triggered recalculations are reflected immediately rather than after 10min TTL Co-Authored-By: Claude Sonnet 4.6 --- commands/dice/rolls.py | 2 -- services/standings_service.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/commands/dice/rolls.py b/commands/dice/rolls.py index 1b4139c..d7c619c 100644 --- a/commands/dice/rolls.py +++ b/commands/dice/rolls.py @@ -417,8 +417,6 @@ class DiceRollCommands(commands.Cog): team = await get_user_major_league_team(user_id=interaction.user.id) if team is not None and team.color is not None: color = int(team.color, 16) - if channel_id is not None: - _channel_color_cache[channel_id] = (color, time.time()) return color return EmbedColors.PRIMARY diff --git a/services/standings_service.py b/services/standings_service.py index 7dc8b3d..b2e0eab 100644 --- a/services/standings_service.py +++ b/services/standings_service.py @@ -249,6 +249,7 @@ class StandingsService: ) logger.info(f"Recalculated standings for season {season}") + _standings_cache.pop(season, None) return True except Exception as e: