mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 23:46:41 +00:00
core: group fixes/improvements (#7660)
* core: group fixes/improvements * Large messages dropped by relays and hosts (the same 15602 limit was applied, without accounting for forwarding header) * Members below v18 did not receive forwarded messages or history in p2p groups. * Join confirmations near the size limit could fail. * SMP servers are limited to 2 host names each. * simplify * remove legacy forwarding and history support * only restrict p2p groups --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
1 parent
dd7768e543
commit
0c1ffa65bc
11 files changed
+112
-18
No files matched your search
@@ -33,6 +33,7 @@ import Simplex.Chat.Protocol
|
||||
GrpMsgForward (GrpMsgForward),
|
||||
MsgContent (MCText),
|
||||
VerifiedMsg (VMUnsigned),
|
||||
fwdMemberName,
|
||||
maxBatchElementCount,
|
||||
maxEncodedMsgLength,
|
||||
mcSimple,
|
||||
@@ -49,6 +50,7 @@ batchingTests = describe "message batching tests" $ do
|
||||
it "splits a batch that exceeds the element count limit" testBatchElementCountLimit
|
||||
it "does not create a relay delivery body when every task is oversized" testRelayBatchAllLarge
|
||||
it "classifies a task that fits raw but not as a framed singleton as large" testRelayBatchSingletonOverflow
|
||||
it "shortens forwarded member names" testFwdMemberName
|
||||
|
||||
instance IsString SndMessage where
|
||||
fromString s = SndMessage {msgId, sharedMsgId = SharedMsgId "", msgBody = s', signedMsg_ = Nothing}
|
||||
@@ -190,6 +192,11 @@ testRelayBatchSingletonOverflow = do
|
||||
map deliveryTaskId accepted `shouldBe` []
|
||||
map deliveryTaskId large `shouldBe` [1]
|
||||
|
||||
testFwdMemberName :: IO ()
|
||||
testFwdMemberName = do
|
||||
fwdMemberName "sixteen_chars_ab" `shouldBe` "sixteen_chars_ab"
|
||||
fwdMemberName "seventeen_chars_a" `shouldBe` "seventeen_chars_…"
|
||||
|
||||
runBatcherTest :: BatchMode -> Int -> [SndMessage] -> [ChatError] -> [ByteString] -> Spec
|
||||
runBatcherTest mode maxLen msgs expectedErrors expectedBatches =
|
||||
it
|
||||
|
||||
Reference in new issue
Block a user