Skip to content

Commit 57f57ce

Browse files
committed
Undo EmptyResponse changes
1 parent 040d1a3 commit 57f57ce

File tree

6 files changed

+34
-38
lines changed

6 files changed

+34
-38
lines changed

libs/wire-api-federation/src/Wire/API/Federation/API/Galley.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ type GalleyApi =
5454
-- that are part of a conversation at creation time. Since MLS conversations
5555
-- are always created empty (i.e. they only contain the creator), this RPC is
5656
-- never invoked for such conversations.
57-
FedEndpoint "on-conversation-created" (ConversationCreated ConvId) EmptyResponse
57+
FedEndpoint "on-conversation-created" (ConversationCreated ConvId) ()
5858
-- This endpoint is called the first time a user from this backend is
5959
-- added to a remote conversation.
60-
:<|> FedEndpoint "on-new-remote-conversation" NewRemoteConversation ()
60+
:<|> FedEndpoint "on-new-remote-conversation" NewRemoteConversation EmptyResponse
6161
:<|> FedEndpoint "get-conversations" GetConversationsRequest GetConversationsResponse
6262
-- used by the backend that owns a conversation to inform this backend of
6363
-- changes to the conversation
64-
:<|> FedEndpoint "on-conversation-updated" ConversationUpdate EmptyResponse
64+
:<|> FedEndpoint "on-conversation-updated" ConversationUpdate ()
6565
:<|> FedEndpointWithMods
6666
'[ MakesFederatedCall 'Galley "on-conversation-updated",
6767
MakesFederatedCall 'Galley "on-mls-message-sent",
@@ -72,7 +72,7 @@ type GalleyApi =
7272
LeaveConversationResponse
7373
-- used to notify this backend that a new message has been posted to a
7474
-- remote conversation
75-
:<|> FedEndpoint "on-message-sent" (RemoteMessage ConvId) EmptyResponse
75+
:<|> FedEndpoint "on-message-sent" (RemoteMessage ConvId) ()
7676
-- used by a remote backend to send a message to a conversation owned by
7777
-- this backend
7878
:<|> FedEndpointWithMods

services/galley/default.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ mkDerivation {
161161
extra
162162
galley-types
163163
gundeck-types
164-
hex
165164
HsOpenSSL
166165
http-client
167166
http-client-openssl

services/galley/src/Galley/API/Federation.hs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ onConversationCreated ::
156156
) =>
157157
Domain ->
158158
F.ConversationCreated ConvId ->
159-
Sem r EmptyResponse
159+
Sem r ()
160160
onConversationCreated domain rc = do
161161
let qrc = fmap (toRemoteUnsafe domain) rc
162162
loc <- qualifyLocal ()
@@ -189,17 +189,17 @@ onConversationCreated domain rc = do
189189
(F.ccTime qrcConnected)
190190
(EdConversation c)
191191
pushConversationEvent Nothing event (qualifyAs loc [qUnqualified . Public.memId $ mem]) []
192-
pure EmptyResponse
193192

194193
onNewRemoteConversation ::
195194
Member ConversationStore r =>
196195
Domain ->
197196
F.NewRemoteConversation ->
198-
Sem r ()
199-
onNewRemoteConversation domain nrc =
197+
Sem r EmptyResponse
198+
onNewRemoteConversation domain nrc = do
200199
-- update group_id -> conv_id mapping
201200
for_ (preview (to F.nrcProtocol . _ProtocolMLS) nrc) $ \mls ->
202201
E.setGroupId (cnvmlsGroupId mls) (Qualified (F.nrcConvId nrc) domain)
202+
pure EmptyResponse
203203

204204
getConversations ::
205205
( Member ConversationStore r,
@@ -227,10 +227,9 @@ onConversationUpdated ::
227227
) =>
228228
Domain ->
229229
F.ConversationUpdate ->
230-
Sem r EmptyResponse
231-
onConversationUpdated requestingDomain cu = do
230+
Sem r ()
231+
onConversationUpdated requestingDomain cu =
232232
updateLocalStateOfRemoteConv requestingDomain cu
233-
pure EmptyResponse
234233

235234
-- as of now this will not generate the necessary events on the leaver's domain
236235
leaveConversation ::
@@ -315,7 +314,7 @@ onMessageSent ::
315314
) =>
316315
Domain ->
317316
F.RemoteMessage ConvId ->
318-
Sem r EmptyResponse
317+
Sem r ()
319318
onMessageSent domain rmUnqualified = do
320319
let rm = fmap (toRemoteUnsafe domain) rmUnqualified
321320
convId = tUntagged $ F.rmConversation rm
@@ -352,7 +351,6 @@ onMessageSent domain rmUnqualified = do
352351
mempty
353352
msgMetadata
354353
(Map.filterWithKey (\(uid, _) _ -> Set.member uid members) msgs)
355-
pure EmptyResponse
356354

357355
sendMessage ::
358356
( Member BrigAccess r,

services/galley/src/Galley/API/Update.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,6 @@ memberTyping lusr zcon qcnv ts = do
14251425
tdurUserId = tUnqualified lusr,
14261426
tdurConvId = tUnqualified rcnv
14271427
}
1428-
-- TODO(elland): check if queueable
14291428
res <- E.runFederated rcnv (fedClient @'Galley @"update-typing-indicator" rpc)
14301429
case res of
14311430
TypingDataUpdateSuccess (TypingDataUpdated {..}) -> do

services/galley/test/integration/API.hs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ paginateConvListIds = do
21922192
F.cuAlreadyPresentUsers = [],
21932193
F.cuAction = SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (pure qAlice) roleNameWireMember)
21942194
}
2195-
void $ runFedClient @"on-conversation-updated" fedGalleyClient chadDomain cu
2195+
runFedClient @"on-conversation-updated" fedGalleyClient chadDomain cu
21962196

21972197
remoteDee <- randomId
21982198
let deeDomain = Domain "dee.example.com"
@@ -2208,7 +2208,7 @@ paginateConvListIds = do
22082208
F.cuAlreadyPresentUsers = [],
22092209
F.cuAction = SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (pure qAlice) roleNameWireMember)
22102210
}
2211-
void $ runFedClient @"on-conversation-updated" fedGalleyClient deeDomain cu
2211+
runFedClient @"on-conversation-updated" fedGalleyClient deeDomain cu
22122212

22132213
-- 1 Proteus self conv + 1 MLS self conv + 2 convs with bob and eve + 196
22142214
-- local convs + 25 convs on chad.example.com + 31 on dee.example = 256 convs.
@@ -2253,7 +2253,7 @@ paginateConvListIdsPageEndingAtLocalsAndDomain = do
22532253
F.cuAlreadyPresentUsers = [],
22542254
F.cuAction = SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (pure qAlice) roleNameWireMember)
22552255
}
2256-
void $ runFedClient @"on-conversation-updated" fedGalleyClient chadDomain cu
2256+
runFedClient @"on-conversation-updated" fedGalleyClient chadDomain cu
22572257

22582258
remoteDee <- randomId
22592259
let deeDomain = Domain "dee.example.com"
@@ -2271,7 +2271,7 @@ paginateConvListIdsPageEndingAtLocalsAndDomain = do
22712271
F.cuAlreadyPresentUsers = [],
22722272
F.cuAction = SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (pure qAlice) roleNameWireMember)
22732273
}
2274-
void $ runFedClient @"on-conversation-updated" fedGalleyClient deeDomain cu
2274+
runFedClient @"on-conversation-updated" fedGalleyClient deeDomain cu
22752275

22762276
foldM_ (getChunkedConvs 16 0 alice) Nothing [4, 3, 2, 1, 0 :: Int]
22772277

@@ -3922,7 +3922,7 @@ putRemoteConvMemberOk update = do
39223922
cuAction =
39233923
SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (pure qalice) roleNameWireMember)
39243924
}
3925-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cu
3925+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cu
39263926

39273927
-- Expected member state
39283928
let memberAlice =
@@ -4067,7 +4067,7 @@ putRemoteReceiptModeOk = do
40674067
cuAction =
40684068
SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (pure qalice) roleNameWireAdmin)
40694069
}
4070-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cuAddAlice
4070+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cuAddAlice
40714071

40724072
-- add another user adam as member
40734073
qadam <- randomQualifiedUser
@@ -4082,7 +4082,7 @@ putRemoteReceiptModeOk = do
40824082
cuAction =
40834083
SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (pure qadam) roleNameWireMember)
40844084
}
4085-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cuAddAdam
4085+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cuAddAdam
40864086

40874087
let newReceiptMode = ReceiptMode 42
40884088
let action = ConversationReceiptModeUpdate newReceiptMode
@@ -4398,10 +4398,10 @@ removeUser = do
43984398
F.ccReceiptMode = Nothing,
43994399
F.ccProtocol = ProtocolProteus
44004400
}
4401-
void $ runFedClient @"on-conversation-created" fedGalleyClient bDomain $ nc convB1 bart [alice, alexDel]
4402-
void $ runFedClient @"on-conversation-created" fedGalleyClient bDomain $ nc convB2 bart [alexDel]
4403-
void $ runFedClient @"on-conversation-created" fedGalleyClient cDomain $ nc convC1 carl [alexDel]
4404-
void $ runFedClient @"on-conversation-created" fedGalleyClient dDomain $ nc convD1 dory [alexDel]
4401+
runFedClient @"on-conversation-created" fedGalleyClient bDomain $ nc convB1 bart [alice, alexDel]
4402+
runFedClient @"on-conversation-created" fedGalleyClient bDomain $ nc convB2 bart [alexDel]
4403+
runFedClient @"on-conversation-created" fedGalleyClient cDomain $ nc convC1 carl [alexDel]
4404+
runFedClient @"on-conversation-created" fedGalleyClient dDomain $ nc convD1 dory [alexDel]
44054405

44064406
WS.bracketR3 c alice' alexDel' amy' $ \(wsAlice, wsAlexDel, wsAmy) -> do
44074407
let handler = do

services/galley/test/integration/API/Federation.hs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ addLocalUser = do
254254
SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (qalice :| [qdee]) roleNameWireMember)
255255
}
256256
WS.bracketRN c [alice, charlie, dee] $ \[wsA, wsC, wsD] -> do
257-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cu
257+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cu
258258
liftIO $ do
259259
WS.assertMatch_ (5 # Second) wsA $
260260
wsAssertMemberJoinWithRole qconv qbob [qalice] roleNameWireMember
@@ -308,7 +308,7 @@ addUnconnectedUsersOnly = do
308308
SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (qCharlie :| []) roleNameWireMember)
309309
}
310310
-- Alice receives no notifications from this
311-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cu
311+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cu
312312
WS.assertNoEvent (5 # Second) [wsA]
313313

314314
-- | This test invokes the federation endpoint:
@@ -353,9 +353,9 @@ removeLocalUser = do
353353

354354
connectWithRemoteUser alice qBob
355355
WS.bracketR c alice $ \ws -> do
356-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cuAdd
356+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cuAdd
357357
afterAddition <- listRemoteConvs remoteDomain alice
358-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cuRemove
358+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain cuRemove
359359
liftIO $ do
360360
void . WS.assertMatch (3 # Second) ws $
361361
wsAssertMemberJoinWithRole qconv qBob [qAlice] roleNameWireMember
@@ -416,21 +416,21 @@ removeRemoteUser = do
416416
}
417417

418418
WS.bracketRN c [alice, charlie, dee, flo] $ \[wsA, wsC, wsD, wsF] -> do
419-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain (cuRemove qEve)
419+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain (cuRemove qEve)
420420
liftIO $ do
421421
WS.assertMatchN_ (3 # Second) [wsA, wsD] $
422422
wsAssertMembersLeave qconv qBob [qEve]
423423
WS.assertNoEvent (1 # Second) [wsC, wsF]
424424

425425
WS.bracketRN c [alice, charlie, dee, flo] $ \[wsA, wsC, wsD, wsF] -> do
426-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain (cuRemove qDee)
426+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain (cuRemove qDee)
427427
liftIO $ do
428428
WS.assertMatchN_ (3 # Second) [wsA, wsD] $
429429
wsAssertMembersLeave qconv qBob [qDee]
430430
WS.assertNoEvent (1 # Second) [wsC, wsF]
431431

432432
WS.bracketRN c [alice, charlie, dee, flo] $ \[wsA, wsC, wsD, wsF] -> do
433-
void $ runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain (cuRemove qFlo)
433+
runFedClient @"on-conversation-updated" fedGalleyClient remoteDomain (cuRemove qFlo)
434434
liftIO $ do
435435
WS.assertMatchN_ (3 # Second) [wsA] $
436436
wsAssertMembersLeave qconv qBob [qFlo]
@@ -467,7 +467,7 @@ notifyUpdate extras action etype edata = do
467467
FedGalley.cuAction = action
468468
}
469469
WS.bracketR2 c alice charlie $ \(wsA, wsC) -> do
470-
void $ runFedClient @"on-conversation-updated" fedGalleyClient bdom cu
470+
runFedClient @"on-conversation-updated" fedGalleyClient bdom cu
471471
liftIO $ do
472472
WS.assertMatch_ (5 # Second) wsA $ \n -> do
473473
let e = List1.head (WS.unpackPayload n)
@@ -644,7 +644,7 @@ notifyDeletedConversation = do
644644
FedGalley.cuAlreadyPresentUsers = [alice],
645645
FedGalley.cuAction = SomeConversationAction (sing @'ConversationDeleteTag) ()
646646
}
647-
void $ runFedClient @"on-conversation-updated" fedGalleyClient bobDomain cu
647+
runFedClient @"on-conversation-updated" fedGalleyClient bobDomain cu
648648

649649
liftIO $ do
650650
WS.assertMatch_ (5 # Second) wsAlice $ \n -> do
@@ -702,7 +702,7 @@ addRemoteUser = do
702702
SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (qdee :| [qeve, qflo]) roleNameWireMember)
703703
}
704704
WS.bracketRN c (map qUnqualified [qalice, qcharlie, qdee, qflo]) $ \[wsA, wsC, wsD, wsF] -> do
705-
void $ runFedClient @"on-conversation-updated" fedGalleyClient bdom cu
705+
runFedClient @"on-conversation-updated" fedGalleyClient bdom cu
706706
void . liftIO $ do
707707
WS.assertMatchN_ (5 # Second) [wsA, wsD] $
708708
wsAssertMemberJoinWithRole qconv qbob [qeve, qdee] roleNameWireMember
@@ -847,7 +847,7 @@ onMessageSent = do
847847
FedGalley.cuAction =
848848
SomeConversationAction (sing @'ConversationJoinTag) (ConversationJoin (pure qalice) roleNameWireMember)
849849
}
850-
void $ runFedClient @"on-conversation-updated" fedGalleyClient bdom cu
850+
runFedClient @"on-conversation-updated" fedGalleyClient bdom cu
851851

852852
let txt = "Hello from another backend"
853853
msg client = Map.fromList [(client, txt)]
@@ -869,7 +869,7 @@ onMessageSent = do
869869

870870
-- send message to alice and check reception
871871
WS.bracketAsClientRN c [(alice, aliceC1), (alice, aliceC2), (eve, eveC)] $ \[wsA1, wsA2, wsE] -> do
872-
void $ runFedClient @"on-message-sent" fedGalleyClient bdom rm
872+
runFedClient @"on-message-sent" fedGalleyClient bdom rm
873873
liftIO $ do
874874
-- alice should receive the message on her first client
875875
WS.assertMatch_ (5 # Second) wsA1 $ \n -> do

0 commit comments

Comments
 (0)