@@ -92,6 +92,32 @@ testPastStaleApplicationMessage otherDomain = do
9292 -- bob's application messages are now rejected
9393 void $ postMLSMessage bob1 msg2. message >>= getJSON 409
9494
95+ testEpochZeroApplicationMessage :: (HasCallStack ) => App ()
96+ testEpochZeroApplicationMessage = do
97+ [alice] <- createAndConnectUsers [make OwnDomain ]
98+ alice1 <- createMLSClient def alice
99+ conv <- createNewGroup def alice1
100+ void $ createAddCommit alice1 conv [] >>= sendAndConsumeCommitBundle
101+ mlsConv <- getMLSConv conv
102+
103+ -- send message, make sure that's succeeding
104+ msg <- createApplicationMessage mlsConv. convId alice1 " group is initialised"
105+ postMLSMessage alice1 msg. message >>= assertStatus 201
106+
107+ -- reset conversation
108+ conv' <- resetMLSConversation alice1 conv
109+ convId' <- objConvId conv'
110+ mlsConv' <- getMLSConv convId'
111+ keys <- getMLSPublicKeys alice1. qualifiedUserId >>= getJSON 200
112+ resetClientGroup mlsConv'. ciphersuite alice1 mlsConv'. groupId convId' keys
113+
114+ -- send message, make sure that's failing
115+ msg' <- createApplicationMessage convId' alice1 " group not initialised"
116+ postMLSMessage alice1 msg'. message >>= flip withResponse \ resp -> do
117+ j <- getJSON 400 resp
118+ j %. " label" `shouldMatch` " mls-protocol-error"
119+ j %. " message" `shouldMatch` " Application messages at epoch 0 are not supported"
120+
95121testFutureStaleApplicationMessage :: (HasCallStack ) => App ()
96122testFutureStaleApplicationMessage = do
97123 [alice, bob, charlie] <- createAndConnectUsers [OwnDomain , OwnDomain , OwnDomain ]
0 commit comments