agent: fix async join to avoid sending HELLO again after restart (#829)

* agent: fix async join to avoid sending HELLO again after restart

* update test

* add callstack to test

* improve test
This commit is contained in:
Evgeny Poberezkin authored and GitHub committed 2023-08-21 14:35:46 +01:00
1 parent d09adb5cd6
commit 44abb90c63
3 files changed
+29 -25

No files matched your search

+4 -3
View File
@@ -640,10 +640,11 @@ joinConnSrv c userId connId enableNtfs (CRContactUri ConnReqUriData {crAgentVRan
joinConnSrvAsync :: AgentMonad m => AgentClient -> UserId -> ConnId -> Bool -> ConnectionRequestUri c -> ConnInfo -> SMPServerWithAuth -> m ()
joinConnSrvAsync c userId connId enableNtfs inv@CRInvitationUri {} cInfo srv = do
(aVersion, cData, q, rc, e2eSndParams) <- startJoinInvitation userId connId enableNtfs inv
withStore c $ \db -> runExceptT $ do
void . ExceptT $ updateNewConnSnd db connId q
dbQueueId <- withStore c $ \db -> runExceptT $ do
liftIO $ createRatchet db connId rc
confirmQueueAsync aVersion c cData q srv cInfo $ Just e2eSndParams
ExceptT $ updateNewConnSnd db connId q
let q' = (q :: SndQueue) {dbQueueId}
confirmQueueAsync aVersion c cData q' srv cInfo $ Just e2eSndParams
joinConnSrvAsync _c _userId _connId _enableNtfs (CRContactUri _) _cInfo _srv = do
throwError $ CMD PROHIBITED