mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-04 22:05:55 +00:00
* core: chat relays protocol wip * types, notes * remove file * removal protocol * schema * status * update * recovery * update * formatting * rename * more types * comment * more docs * decrease number of steps * format * correct * update * update protocol * update * typo * todo * update doc * update * update * remove added * update * update * XGrpRelayReady * link to chat relays * update * remove from protocol * update * json * wip * remove comment * wip * update * wip * wip * update * wip * wip * plans * better view * fix * fix * relay acceptance * rework api * add relays to link * comment * active on con, fix send * comments * direct in group plan * prepare * member connection wip * comments * member connection wip * fix forwarding * introduce moderators to new member * enable relay tests * plans * security objectives * refactor * add to threat model * stress test wip * stress test wip * Revert "stress test wip" This reverts commitacde8a1fb3. * Revert "stress test wip" This reverts commit6435808438. * remove stress test * improve output * invert relay fkey * postgres schema * comments * group in progress, remove auto-select relays commented code * comments * corrections * comment * lint * redundant import * core: chat relay request worker (#6509) * update plans * strict tables * core: update group link asynchronously with relay link (#6548) * update simplexmq * docs: connection to chat relays rfc (#6554) * add test for 2 relays (doesn't pass) * create unknown member in same transaction as checking * fix relays choosing different memberId (XContactRelay) * plans, api * use same incognito profile for relays, connect concurrently, save correct link for plan * test * don't duplicate items on group connection * check relay record exists when joining * use mapConcurrently when adding relays, update schemas * fix multi-relay join for postgres (savepoint) * core: async retry connection to chat relays (#6584) * update simplexmq * fix api tests * prefer throwing temp error on connection * check group relays when deleting from configuration * relay_request_err_reason * relay role * rename, fix syntax * plans * rename, style --------- Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
51 lines
1.6 KiB
Haskell
51 lines
1.6 KiB
Haskell
module ChatTests.ChatRelays where
|
|
|
|
import ChatClient
|
|
import ChatTests.DBUtils
|
|
import ChatTests.Utils
|
|
import Test.Hspec hiding (it)
|
|
|
|
-- TODO [relays] test deleting relay (from configuration), referenced in group_relays.
|
|
chatRelayTests :: SpecWith TestParams
|
|
chatRelayTests = do
|
|
describe "configure chat relays" $ do
|
|
it "get and set chat relays" testGetSetChatRelays
|
|
|
|
testGetSetChatRelays :: HasCallStack => TestParams -> IO ()
|
|
testGetSetChatRelays ps =
|
|
withNewTestChat ps "alice" aliceProfile $ \alice ->
|
|
withNewTestChatOpts ps relayTestOpts "bob" bobProfile $ \bob -> do
|
|
withNewTestChatOpts ps relayTestOpts "cath" cathProfile $ \cath -> do
|
|
bob ##> "/ad"
|
|
(bobSLink, _cLink) <- getContactLinks bob True
|
|
|
|
cath ##> "/ad"
|
|
(cathSLink, _cLink) <- getContactLinks cath True
|
|
|
|
alice ##> ("/relays name=bob_relay " <> bobSLink)
|
|
alice <## "ok"
|
|
|
|
alice ##> "/relays"
|
|
alice <## "Your servers"
|
|
alice <## " Chat relays"
|
|
alice <## (" bob_relay: " <> bobSLink)
|
|
|
|
alice ##> ("/relays name=cath_relay " <> cathSLink)
|
|
alice <## "ok"
|
|
|
|
alice ##> "/relays"
|
|
alice <## "Your servers"
|
|
alice <## " Chat relays"
|
|
alice <## (" cath_relay: " <> cathSLink)
|
|
|
|
alice ##> ("/relays name=bob_relay " <> bobSLink <> " name=cath_relay " <> cathSLink)
|
|
alice <## "ok"
|
|
|
|
alice ##> "/relays"
|
|
alice <## "Your servers"
|
|
alice <## " Chat relays"
|
|
alice
|
|
<### [ ConsoleString $ " bob_relay: " <> bobSLink,
|
|
ConsoleString $ " cath_relay: " <> cathSLink
|
|
]
|