FS-1467: Make conversation metadata APIs fault tolerant to federation errors#3229
FS-1467: Make conversation metadata APIs fault tolerant to federation errors#3229mdimjasevic merged 16 commits intowireapp:developfrom
Conversation
|
@mdimjasevic Can you have a look at this for me. |
| notifyConversationAction | ||
| -- Removing members should be fault tolerant. | ||
| ( case tag of | ||
| -- Removing members should be fault tolerant. |
There was a problem hiding this comment.
Should've brought this up before, but I'm feeling a case of boolean blindness here. Could we use a more descriptive type? 🤞
There was a problem hiding this comment.
Fair enough, I've swapped it for a new type with better names.
| let action = ConversationJoin neUsers role | ||
| pure (bmFromMembers lmems rmems, action) | ||
|
|
||
| data FederationFailEarly |
mdimjasevic
left a comment
There was a problem hiding this comment.
Looks good! I believe you forgot to invoke those tests in Federation.hs so please double-check that before merging.
| <!! const 200 === statusCode | ||
| liftIO $ map omQualifiedId (cmOthers (cnvMembers conv2)) @?= [bob] | ||
|
|
||
| -- @END |
There was a problem hiding this comment.
Please remove this comment tag as it will otherwise mess up a test report the QA team generates. Conversely, you can add its counterpart before the test to make it a whole, but I'm not sure what should go in there.
| mkMember quid = OtherMember quid Nothing roleNameWireMember | ||
| fedGalleyClient <- view tsFedGalleyClient | ||
|
|
||
| mapM_ (`connectWithRemoteUser` qbob) [alice] |
There was a problem hiding this comment.
Isn't this a strange way of saying connectWithRemoteUser alice qbob?
| notifyConvRenameUnavailable :: TestM () | ||
| notifyConvRenameUnavailable = do | ||
| let d = ConversationRename "gossip++" | ||
| notifyUpdateUnavailable [] (SomeConversationAction (sing @'ConversationRenameTag) d) ConvRename (EdConvRename d) | ||
|
|
||
| notifyMessageTimerUnavailable :: TestM () | ||
| notifyMessageTimerUnavailable = do | ||
| let d = ConversationMessageTimerUpdate (Just 5000) | ||
| notifyUpdateUnavailable | ||
| [] | ||
| (SomeConversationAction (sing @'ConversationMessageTimerUpdateTag) d) | ||
| ConvMessageTimerUpdate | ||
| (EdConvMessageTimerUpdate d) | ||
|
|
||
| notifyReceiptModeUnavailable :: TestM () | ||
| notifyReceiptModeUnavailable = do | ||
| let d = ConversationReceiptModeUpdate (ReceiptMode 42) | ||
| notifyUpdateUnavailable | ||
| [] | ||
| (SomeConversationAction (sing @'ConversationReceiptModeUpdateTag) d) | ||
| ConvReceiptModeUpdate | ||
| (EdConvReceiptModeUpdate d) | ||
|
|
||
| notifyAccessUnavailable :: TestM () | ||
| notifyAccessUnavailable = do | ||
| let d = ConversationAccessData (Set.fromList [InviteAccess, LinkAccess]) (Set.fromList [TeamMemberAccessRole]) | ||
| notifyUpdateUnavailable | ||
| [] | ||
| (SomeConversationAction (sing @'ConversationAccessDataTag) d) | ||
| ConvAccessUpdate | ||
| (EdConvAccessUpdate d) |
There was a problem hiding this comment.
You forgot to list and therefore actually call these tests in the tests function on line 67, didn't you?
- Maybe it works now. Integration test SSL certificates expired and a merged PR from less than an hour ago fixed that
|
@lepsa , this still hasn't run in the CI so please don't merge just yet. |
| ((), _fedRequests) <- | ||
| withTempMockFederator' (throw $ MockErrorResponse Http.status500 "Down for maintenance") $ | ||
| runFedClient @"on-conversation-updated" fedGalleyClient bdom cu | ||
| putStrLn $ "on-conversation-updated: " <> show _fedRequests |
There was a problem hiding this comment.
Can you remove this debugging line?
|
@lepsa , before merging there are conflicts to be resolved in these files: |
I started resolving these. |
Checklist
changelog.dChanges
Making conversation metadata APIs fault tolerant of unavailable federation servers.
Adding new tests to check that we get the expected results when federation servers are unavailable.