ios: deliver notifications even if iOS fails to fire expiration notice, prevent repeat delivery of stale notifications (#5861)

* ios: deliver notification when iOS fails to fire expiration notice for NSE

* update core api

* update ui

* sha256map.nix

* do not enable background processes in maintenance mode

* fix ios

* fix parser

* ios: fix command

* compatible parser for connection ID

* log

* pass DB queue ID

* simplexmq

* query plans

* fix broadcast bot test
This commit is contained in:
Evgeny authored and GitHub committed 2025-05-02 12:23:05 +01:00
1 parent 38b8e0cee6
commit e7a4611be9
12 files changed
+179 -135

No files matched your search

+9 -3
View File
@@ -357,7 +357,7 @@ data ChatCommand
| APICheckToken DeviceToken
| APIDeleteToken DeviceToken
| APIGetNtfConns {nonce :: C.CbNonce, encNtfInfo :: ByteString}
| ApiGetConnNtfMessages {connIds :: NonEmpty AgentConnId}
| APIGetConnNtfMessages (NonEmpty ConnMsgReq)
| APIAddMember GroupId ContactId GroupMemberRole
| APIJoinGroup {groupId :: GroupId, enableNtfs :: MsgFilter}
| APIAcceptMember GroupId GroupMemberId GroupMemberRole
@@ -1131,12 +1131,18 @@ instance FromJSON ChatTagData where
parseJSON invalid = JT.prependFailure "bad ChatTagData, " (JT.typeMismatch "Object" invalid)
data NtfConn = NtfConn
{ user_ :: Maybe User,
connEntity_ :: Maybe ConnectionEntity,
{ user :: User,
agentConnId :: AgentConnId,
agentDbQueueId :: Int64,
connEntity :: ConnectionEntity,
-- Decrypted ntf meta of the expected message (the one notification was sent for).
-- Nothing means it failed to decrypt or to decode, we can still show event for entity
expectedMsg_ :: Maybe NtfMsgInfo
}
deriving (Show)
-- brokerTs is the same msgTs, it is used in ConnMsgReq / APIGetConnNtfMessages
-- to set it as last connection message in case queue is empty
data NtfMsgInfo = NtfMsgInfo {msgId :: Text, msgTs :: UTCTime}
deriving (Show)