-
Notifications
You must be signed in to change notification settings - Fork 333
[WPB-1085] Two-event member adding process during conversation creation #3359
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
Conversation
- Conversation creation at this point was able to fail only because remotes were unreachable. As of recently this is handled gracefully: no more throwing in IO, but rather reporting to the creator that some remote users could not be added
allRemoteMembersQualified = remoteMemberQualify <$> allRemoteMembers | ||
allRemoteBuckets :: [Remote [RemoteMember]] = bucketRemote allRemoteMembersQualified | ||
rc = toConversationCreated now c | ||
failedToNotify <- fmap (foldMap (either (sequenceA . fst) mempty)) $ |
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.
this looks weird.
the type of the second argument of this fmap
is [Either (Remote [RemoteMember], FederationError) (Remote ())]
.
- shouldn't we keep the buckets with the different remotes, rather than filtering out again below in line 786?
- why does the
FederationError
have to be the same value for all remote members? shouldn't it be allowed to differ between members?
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 comment is referring to old code so I'm not sure my reply will address your concerns, but here's an attempt:
- Regarding keeping them in buckets, there are a few variations of the same data, but in different types, each suitable for a slightly different need. We do have buckets around too.
- The same
FederationError
question is, I believe, addressed by the observation I made yesterday during the call: there's no incremental update from a remote backend on the progress of processing member updates, so either all of members are added successfully or there is a failure, e.g., aFederationError
is returned, in which case none of the remote backend's users are considered to be conversation members.
…-conversation-create
…-conversation-create
- It is not actually used in the PR, hence removed
@fisx and @battermann , I've merged the latest Let me know if you have any further feedback, remarks, or questions. |
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.
LGTM
Co-authored-by: Leif Battermann <[email protected]>
This PR is a carved out part of #3324 that relates to conversation creation only.
When a Proteus conversation is created and remote members are added to it as part of the request to
POST /conversations
, remote clients now get two events: aconversation.create
event as before with a subset of other members, and also aconversation.member-join
event once the list of all remote members is confirmed. Local users get only theconversation.create
event as before with the full list of members.For details see https://wearezeta.atlassian.net/wiki/spaces/CORE/pages/751435862/Offline+backend+handling+-+analysis+of+creating+a+conversation#Events-for-joining-clients.
Tracked by https://wearezeta.atlassian.net/browse/WPB-1085.
Checklist
changelog.d