@@ -363,7 +363,7 @@ data ServerSubscribers s = ServerSubscribers
363363 { subQ :: TQueue (ClientSub , ClientId ),
364364 queueSubscribers :: SubscribedClients s ,
365365 serviceSubscribers :: SubscribedClients s , -- service clients with long-term certificates that have subscriptions
366- totalServiceSubs :: TVar Int64 ,
366+ totalServiceSubs :: TVar ( Int64 , IdsHash ) ,
367367 subClients :: TVar IntSet , -- clients with individual or service subscriptions
368368 pendingEvents :: TVar (IntMap (NonEmpty (EntityId , BrokerMsg )))
369369 }
@@ -426,7 +426,7 @@ sameClient c cv = maybe False (sameClientId c) <$> readTVar cv
426426data ClientSub
427427 = CSClient QueueId (Maybe ServiceId ) (Maybe ServiceId ) -- includes previous and new associated service IDs
428428 | CSDeleted QueueId (Maybe ServiceId ) -- includes previously associated service IDs
429- | CSService ServiceId Int64 -- only send END to idividual client subs on message delivery, not of SSUB/NSSUB
429+ | CSService ServiceId ( Int64 , IdsHash ) -- only send END to idividual client subs on message delivery, not of SSUB/NSSUB
430430
431431newtype ProxyAgent = ProxyAgent
432432 { smpAgent :: SMPClientAgent 'Sender
@@ -440,8 +440,8 @@ data Client s = Client
440440 ntfSubscriptions :: TMap NotifierId () ,
441441 serviceSubscribed :: TVar Bool , -- set independently of serviceSubsCount, to track whether service subscription command was received
442442 ntfServiceSubscribed :: TVar Bool ,
443- serviceSubsCount :: TVar Int64 , -- only one service can be subscribed, based on its certificate, this is subscription count
444- ntfServiceSubsCount :: TVar Int64 , -- only one service can be subscribed, based on its certificate, this is subscription count
443+ serviceSubsCount :: TVar ( Int64 , IdsHash ) , -- only one service can be subscribed, based on its certificate, this is subscription count
444+ ntfServiceSubsCount :: TVar ( Int64 , IdsHash ) , -- only one service can be subscribed, based on its certificate, this is subscription count
445445 rcvQ :: TBQueue (NonEmpty (VerifiedTransmission s )),
446446 sndQ :: TBQueue (NonEmpty (Transmission BrokerMsg ), [Transmission BrokerMsg ]),
447447 msgQ :: TBQueue (NonEmpty (Transmission BrokerMsg )),
@@ -502,7 +502,7 @@ newServerSubscribers = do
502502 subQ <- newTQueueIO
503503 queueSubscribers <- SubscribedClients <$> TM. emptyIO
504504 serviceSubscribers <- SubscribedClients <$> TM. emptyIO
505- totalServiceSubs <- newTVarIO 0
505+ totalServiceSubs <- newTVarIO ( 0 , noIdsHash)
506506 subClients <- newTVarIO IS. empty
507507 pendingEvents <- newTVarIO IM. empty
508508 pure ServerSubscribers {subQ, queueSubscribers, serviceSubscribers, totalServiceSubs, subClients, pendingEvents}
@@ -513,8 +513,8 @@ newClient clientId qSize clientTHParams createdAt = do
513513 ntfSubscriptions <- TM. emptyIO
514514 serviceSubscribed <- newTVarIO False
515515 ntfServiceSubscribed <- newTVarIO False
516- serviceSubsCount <- newTVarIO 0
517- ntfServiceSubsCount <- newTVarIO 0
516+ serviceSubsCount <- newTVarIO ( 0 , noIdsHash)
517+ ntfServiceSubsCount <- newTVarIO ( 0 , noIdsHash)
518518 rcvQ <- newTBQueueIO qSize
519519 sndQ <- newTBQueueIO qSize
520520 msgQ <- newTBQueueIO qSize
0 commit comments