-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FS-1148] Resilient member adding in presence of unreachable backends (1/2) #3248
Conversation
As agreed with client devs on Apr 4, 2023 in the Squad - Federation chat, the absence of the `failed_to_send` field in response to an MLS message send request has the same meaning as an empty list provided in the same field.
d2475ce
to
fa0be89
Compare
- The definition of `(<\>)` was exactly the same as `Semigroup a => Semigroup Maybe`, which I confused with the `Alternative Maybe` instance.
Sem r LocalConversationUpdate | ||
notifyConversationAction failEarly tag quid notifyOrigDomain con lconv targets action = do | ||
Sem r (LocalConversationUpdate, FailedToProcess) | ||
notifyConversationAction tag quid notifyOrigDomain con lconv targets action = do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use something other than bool here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The remaining Bool
argument wasn't introduced with this PR. While in general I would consider converting it into a simple sum type that is more descriptive, I'd ask you to not consider this to be a blocker and leave that for future work, as this PR has been going on for quite some time now.
. fmap fst | ||
$ newUserClients | ||
let failedAdding = | ||
Set.toList $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably simplify this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be much simpler yesterday when we looked at this, but I couldn't make it so. It is a bit simpler now, though. See commit fc010ea.
… (1/2) (#3248) * Refactoring: use FailedToProcess * Refactoring: make UnreachableUsers a NonEmpty As agreed with client devs on Apr 4, 2023 in the Squad - Federation chat, the absence of the `failed_to_send` field in response to an MLS message send request has the same meaning as an empty list provided in the same field. * executeProposalAction: return failed-to-add users * MLS test utility: reuse code among utilities * Move and generalise mockUnreachableFor * Introduce failed to remove (via failed to fetch client info) * Propagate FailedToProcess across federation API arising from conversation updates * Fix/align an MLS integration test * Use a V4 add members endpoint in tests * Rethrow the invalid-domain exception * Rethrow federation-not-available error * Fix a golden test for LeaveConversationResponse * Golden tests for MLSMessageSendingStatus * Fix a test with an unreachable user * Test: clean up debugging leftovers * Test utility: fix wording of a haddoc * Clean up conv action federation failure handling * Move unreachability stuff into its own module
… (1/2) (#3248) * Refactoring: use FailedToProcess * Refactoring: make UnreachableUsers a NonEmpty As agreed with client devs on Apr 4, 2023 in the Squad - Federation chat, the absence of the `failed_to_send` field in response to an MLS message send request has the same meaning as an empty list provided in the same field. * executeProposalAction: return failed-to-add users * MLS test utility: reuse code among utilities * Move and generalise mockUnreachableFor * Introduce failed to remove (via failed to fetch client info) * Propagate FailedToProcess across federation API arising from conversation updates * Fix/align an MLS integration test * Use a V4 add members endpoint in tests * Rethrow the invalid-domain exception * Rethrow federation-not-available error * Fix a golden test for LeaveConversationResponse * Golden tests for MLSMessageSendingStatus * Fix a test with an unreachable user * Test: clean up debugging leftovers * Test utility: fix wording of a haddoc * Clean up conv action federation failure handling * Move unreachability stuff into its own module
… (1/2) (#3248) * Refactoring: use FailedToProcess * Refactoring: make UnreachableUsers a NonEmpty As agreed with client devs on Apr 4, 2023 in the Squad - Federation chat, the absence of the `failed_to_send` field in response to an MLS message send request has the same meaning as an empty list provided in the same field. * executeProposalAction: return failed-to-add users * MLS test utility: reuse code among utilities * Move and generalise mockUnreachableFor * Introduce failed to remove (via failed to fetch client info) * Propagate FailedToProcess across federation API arising from conversation updates * Fix/align an MLS integration test * Use a V4 add members endpoint in tests * Rethrow the invalid-domain exception * Rethrow federation-not-available error * Fix a golden test for LeaveConversationResponse * Golden tests for MLSMessageSendingStatus * Fix a test with an unreachable user * Test: clean up debugging leftovers * Test utility: fix wording of a haddoc * Clean up conv action federation failure handling * Move unreachability stuff into its own module
This is the first part of https://wearezeta.atlassian.net/browse/FS-1148, namely of the support for a partial success of adding unreachable remote users to an MLS conversation. The PR touches surrounding code, e.g., it adds scaffolding for support of partial success to remove users too; the actual support for that is to be implemented.
A follow-up PR will implement the two-phase conversation creation with remote backends when adding participants to a conversation, per the design that came out of the refinement session on Apr 20, 2023. In that scenario remote non-creator participants will be notified (by their owning backends) of being added to the conversation only once the whole operation is finalized. This will be quite a change in its own (including a DB schema change), which justifies a separate PR.
Checklist
changelog.d