From f3b7c7451c5935d0dee8cf949259496c8513282a Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sat, 25 Jul 2026 02:04:56 -0700 Subject: [PATCH] refactor(bans): drop BanChannel.Configure, which only re-ran a swept Configure BanConfiguration.Configure() is a static Configure() on a static class, so the AssemblyHandler sweep already reaches it. BanChannel.Configure() did nothing but call it -- and was itself swept AND called explicitly from NetState.Configure(), so the same load was reached three ways. Nothing reads BanConfiguration.Settings during the Configure phase (only the accept path does, long after the sweep), so there was no ordering guarantee to preserve here. Removed the method and the explicit call. The equivalent-looking calls in BlocklistFilter.Configure() and CrowdSecReporter.Configure() are NOT the same thing and stay: those are instance methods the sweep never sees, invoked from Register(), and each reads its settings immediately -- so calling their configuration loader first is a real ordering guarantee, made free by the same idempotency guard. Co-Authored-By: Claude Opus 4.8 --- Projects/Server/Network/Bans/BanChannel.cs | 8 -------- Projects/Server/Network/Bans/BanConfiguration.cs | 4 ++-- Projects/Server/Network/NetState/NetState.cs | 4 ---- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Projects/Server/Network/Bans/BanChannel.cs b/Projects/Server/Network/Bans/BanChannel.cs index 91a6715a6..8b3b917e2 100644 --- a/Projects/Server/Network/Bans/BanChannel.cs +++ b/Projects/Server/Network/Bans/BanChannel.cs @@ -34,14 +34,6 @@ public static class BanChannel public static IReadOnlyList Reporters => _reporters; - public static void Configure() - { - // Load ban policy for the accept path. Reporters are NOT built here — content registers them - // via Register() during the same Configure() sweep, in any order relative to this call, so we - // must not clobber any registrations that may already have arrived. - BanConfiguration.Configure(); - } - /// /// Registers a contribution sink from content (inversion of control). Idempotent by /// : a second registration of the same name is ignored. Configures the diff --git a/Projects/Server/Network/Bans/BanConfiguration.cs b/Projects/Server/Network/Bans/BanConfiguration.cs index 2f48007e7..b1160f54e 100644 --- a/Projects/Server/Network/Bans/BanConfiguration.cs +++ b/Projects/Server/Network/Bans/BanConfiguration.cs @@ -33,8 +33,8 @@ public static class BanConfiguration public static void Configure() { - // Idempotent: this Configure() is auto-discovered and also called explicitly by BanChannel, - // so guard against a redundant second load. + // Reached by the Configure sweep, which is the only caller. Idempotent anyway, so a second call + // cannot re-deserialize or re-write the template over an operator's edits. if (Settings != null) { return; diff --git a/Projects/Server/Network/NetState/NetState.cs b/Projects/Server/Network/NetState/NetState.cs index 317ed46eb..6c6262ae4 100755 --- a/Projects/Server/Network/NetState/NetState.cs +++ b/Projects/Server/Network/NetState/NetState.cs @@ -96,10 +96,6 @@ public partial class NetState : IComparable, IValueLinkListNode