mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-07-17 23:00:11 +00:00
The periodic cleanup in SubscribersMap.cleanUp deleted subscribers whose elapsed time since last activity was *less* than the idle timeout, and kept those that had gone idle. This is backwards: active subscribers (that keep their subscription alive via pings, which call Refresh) were being dropped within a cleanup cycle, while genuinely idle subscribers were never reaped and leaked forever. Flip the comparison so a subscriber is removed only once it has been idle for longer than the timeout. Also rewrite TestCleanup (which previously encoded the buggy behavior) and add TestCleanupKeepsActiveSubscribers, which fails on the old inverted check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>