-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add failing test reproducing the issue * Only create one welcome notification per user * Add CHANGELOG entry * Lint * Test notifications for both clients
- Loading branch information
1 parent
4991a55
commit 9a881d5
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix bug where welcome notifications were generated for each client instead of for each user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module Test.MLS.Notifications where | ||
|
||
import API.Gundeck | ||
import MLS.Util | ||
import Notifications | ||
import SetupHelpers | ||
import Testlib.Prelude | ||
|
||
testWelcomeNotification :: HasCallStack => App () | ||
testWelcomeNotification = do | ||
[alice, bob] <- createAndConnectUsers [OwnDomain, OtherDomain] | ||
[alice1, alice2, bob1, bob2] <- traverse (createMLSClient def) [alice, alice, bob, bob] | ||
traverse_ uploadNewKeyPackage [alice2, bob1, bob2] | ||
|
||
void $ createNewGroup alice1 | ||
notif <- withWebSocket bob $ \ws -> do | ||
void $ createAddCommit alice1 [alice, bob] >>= sendAndConsumeCommitBundle | ||
awaitMatch isWelcomeNotif ws | ||
|
||
notifId <- notif %. "id" & asString | ||
|
||
for_ [bob1, bob2] $ \cid -> | ||
getNotifications | ||
bob | ||
def | ||
{ since = Just notifId, | ||
client = Just cid.client, | ||
size = Just 10000 | ||
} | ||
>>= getJSON 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters