diff --git a/src/Simplex/Messaging/Agent/Client.hs b/src/Simplex/Messaging/Agent/Client.hs index 5dfffc52b..a9c6d6745 100644 --- a/src/Simplex/Messaging/Agent/Client.hs +++ b/src/Simplex/Messaging/Agent/Client.hs @@ -1181,8 +1181,8 @@ subscribeQueues c qs = do subscribeQueues_ env sessionsUsed smp qs' = do rs <- sendBatch subscribeSMPQueues smp qs' let sessId = sessionId $ thParams smp - alive <- atomically $ activeClientSession c (transportSession' smp) sessId - if alive + active <- atomically $ activeClientSession c (transportSession' smp) sessId + if active then do atomically $ modifyTVar' sessionsUsed (sessId :) mapM_ (uncurry $ processSubResult c) rs