core: fix channel deletion for relay client (#6676)

This commit is contained in:
spaced4ndy
2026-03-16 11:31:08 +00:00
committed by GitHub
parent 2db92ff6ed
commit 6daee3a5da
2 changed files with 36 additions and 2 deletions
+33
View File
@@ -249,6 +249,8 @@ chatGroupTests = do
describe "multiple relays" $ do
it "2 relays: should deliver messages to members" testChannels2RelaysDeliver
it "should share same incognito profile with all relays" testChannels2RelaysIncognito
describe "channel operations" $ do
it "should delete channel and clean up relay connections" testChannelDeleteGroup
describe "channel message operations" $ do
it "should update channel message" testChannelMessageUpdate
it "should delete channel message" testChannelMessageDelete
@@ -8813,6 +8815,37 @@ testChannels2RelaysIncognito ps =
[bob, cath] *<# ("#team " <> danIncognito <> "> hey")
[alice, eve, frank] *<# ("#team " <> danIncognito <> "> hey [>>]")
testChannelDeleteGroup :: HasCallStack => TestParams -> IO ()
testChannelDeleteGroup ps =
withNewTestChat ps "alice" aliceProfile $ \alice -> do
withNewTestChatOpts ps relayTestOpts "bob" bobProfile $ \bob -> do
withNewTestChat ps "cath" cathProfile $ \cath -> do
(shortLink, fullLink) <- prepareChannel1Relay "team" alice bob
memberJoinChannel "team" [bob] shortLink fullLink cath
-- verify message delivery works
alice #> "#team hi"
bob <# "#team> hi"
cath <# "#team> hi [>>]"
-- owner deletes channel
alice ##> "/d #team"
concurrentlyN_
[ alice <## "#team: you deleted the group",
do
bob <## "#team: alice deleted the group"
bob <## "use /d #team to delete the local copy of the group",
do
cath <## "#team: alice deleted the group"
cath <## "use /d #team to delete the local copy of the group"
]
-- restart relay, verify no extra subscriptions and no errors
withTestChatOpts ps relayTestOpts "bob" $ \bob -> do
bob <## "subscribed 1 connections on server localhost"
bob ##> "/groups"
bob <## "#team (group deleted, delete local copy: /d #team)"
testChannelMessageUpdate :: HasCallStack => TestParams -> IO ()
testChannelMessageUpdate ps =
withNewTestChat ps "alice" aliceProfile $ \alice ->