Skip to content

Commit fdbc922

Browse files
committed
comment
1 parent 9f0540c commit fdbc922

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Simplex/Messaging/Agent.hs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,19 @@ subscribeAllConnections' c onlyNeeded activeUserId_ = handleErr $ do
14511451
Just activeUserId -> sortOn (\(uId, _) -> if uId == activeUserId then 0 else 1 :: Int) userSrvs
14521452
Nothing -> userSrvs
14531453
useServices <- readTVarIO $ useClientServices c
1454+
-- These options are possible below:
1455+
-- 1) services fully disabled:
1456+
-- No service subscriptions will be attempted, and existing services and association will remain in in the database,
1457+
-- but they will be ignored because of hasService parameter set to False.
1458+
-- This approach preserves performance for all clients that do not use services.
1459+
-- 2) at least one user ID has services enabled:
1460+
-- Service will be loaded for all user/server combinations:
1461+
-- a) service is enabled for and service record exists: subscription will be attempted,
1462+
-- b) service is disabled and record exists: service record and all associations will be removed,
1463+
-- c) service is disabled or no record: no subscription attempt.
1464+
-- On successful service subscription, only unassociated queues will be subscribed.
1465+
-- TODO [certs rcv] improve logic to differentiate between permanent and temporary service subscription errors,
1466+
-- as the current logic would fall back to per-queue subscriptions on ANY service subscription error (e.g., network connection error).
14541467
userSrvs'' <-
14551468
if any id useServices
14561469
then lift $ mapConcurrently (subscribeService useServices) userSrvs'

0 commit comments

Comments
 (0)