Skip to content

Commit 276132d

Browse files
committed
comment
1 parent 43a5c98 commit 276132d

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/Simplex/Messaging/Notifications/Server/Store.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ data NtfStore = NtfStore
3636
-- multiple registrations exist to protect from malicious registrations if token is compromised
3737
tokenRegistrations :: TMap DeviceToken (TMap ByteString NtfTokenId),
3838
subscriptions :: TMap NtfSubscriptionId NtfSubData,
39-
-- the first set is used to delete from `subscriptions` when token is deleted, the second - to cancel subsriptions.
39+
-- the first set is used to delete from `subscriptions` when token is deleted, the second - to cancel SMP subsriptions.
40+
-- TODO [notifications] it can be simplified once NtfSubData is fully removed.
4041
tokenSubscriptions :: TMap NtfTokenId (TMap SMPServer (TVar (Set NtfSubscriptionId), TVar (Set NotifierId))),
4142
-- TODO [notifications] for subscriptions that "migrated" to server subscription, we may replace NtfSubData with NtfTokenId here (Either NtfSubData NtfTokenId).
4243
subscriptionLookup :: TMap SMPServer (TMap NotifierId NtfSubData),

src/Simplex/Messaging/Notifications/Server/StoreLog.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ readNtfStore f st = mapM_ (addNtfLogRecord . LB.toStrict) . LB.lines =<< LB.read
236236
>>= mapM_ (\NtfTknData {tknUpdatedAt} -> atomically $ writeTVar tknUpdatedAt $ Just t)
237237
CreateSubscription r@NtfSubRec {ntfSubId} -> do
238238
sub <- mkSubData r
239-
atomically (addNtfSubscription st ntfSubId sub) >>= mapM_ (\_ -> logWarn $ "subscription " <> tshow (B64.encode $ unEntityId ntfSubId) <> " already exists")
239+
atomically (addNtfSubscription st ntfSubId sub)
240+
>>= mapM_ (\_ -> logWarn $ "subscription " <> tshow (B64.encode $ unEntityId ntfSubId) <> " already exists")
240241
SubscriptionStatus subId status -> do
241242
getNtfSubscriptionIO st subId
242243
>>= mapM_ (\NtfSubData {subStatus} -> atomically $ writeTVar subStatus status)

src/Simplex/Messaging/Protocol.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ instance Encoding QueueReqData where
559559

560560
data NtfServerCreds = NtfServerCreds
561561
{ ntfServer :: NtfServer,
562-
-- ntf server certificate chain that should match fingerpring in address
562+
-- ntf server certificate chain that should match fingerprint in address
563563
-- and Ed25519 key to verify server command NRDY, signed by key from certificate.
564564
ntfAuthPubKey :: (X.CertificateChain, X.SignedExact X.PubKey)
565565
}

src/Simplex/Messaging/Server/QueueStore.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ data QueueRec = QueueRec
4444

4545
data NtfCreds = NtfCreds
4646
{ notifierId :: NotifierId,
47-
-- `notifierKey` and `ntfServer` are mutually exclusive (and one of them is required),
48-
-- but for some period of time from switching to `ntfServer`
47+
-- `notifierKey` and `ntfServerHost` are mutually exclusive (and one of them is required),
48+
-- but for some period of time from switching to `ntfServerHost`
4949
-- we will continue storing `notifierKey` to allow ntf/smp server downgrades.
5050
-- we could use `These NtfPublicAuthKey TransportHost` type here (https://hackage.haskell.org/package/these-1.2.1/docs/Data-These.html)
5151
notifierKey :: Maybe NtfPublicAuthKey,

0 commit comments

Comments
 (0)