mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-07-09 08:01:56 +00:00
be58967a86
* docs: plan for service subscriptions memory leak * fix: remove leaked service delivery subscriptions The CSAEndServiceSub handler decremented subscription counters but did not remove the per-queue delivery Sub from the service client's subscriptions map. Over queue churn a long-lived service connection accumulated orphaned Sub entries until disconnect, leaking memory. Mirror CSAEndSub via endServiceQueueSub (reusing endSub) so the entry is removed and its delivery thread cancelled. Add a regression test with white-box access to the server Env via runSMPServerBlocking_; verified failing without the fix. * test: remove service subs leak regression test Remove testServiceSubsRemovedOnQueueDelete and the test-only Env exposure (runSMPServerBlocking_, withSmpServerConfigEnvOn, serviceSubsMapSize), leaving only the server fix. * refactor: simplify unsubPrev with applicative Express the cancel-if-present logic as sequence_ (unsub_ <*> s_).