-
Notifications
You must be signed in to change notification settings - Fork 14
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
refactor: process conversation access update event - WPB-10164 #2028
base: develop
Are you sure you want to change the base?
refactor: process conversation access update event - WPB-10164 #2028
Conversation
Test Results2 669 tests 2 669 ✅ 8m 38s ⏱️ Results for commit 8f5048f. ♻️ This comment has been updated with latest results. |
|
||
await context.perform { | ||
localConversation.accessModeStrings = event.accessModes.map(\.rawValue) | ||
localConversation.accessRoleStringsV2 = accessRoles.map(\.rawValue) |
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.
context.save() ?
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 think saves should happen on a higher level. For instance:
- Get batch of pending events
- Process batch of events (no saves in-between)
- After successfully processing all events in batch, one single save, then delete those pending events (they are consumed now
We need to take care that any committed work isn't repeated in case of any interruption to the event processing.
await context.perform { | ||
localConversation.accessModeStrings = event.accessModes.map(\.rawValue) | ||
localConversation.accessRoleStringsV2 = accessRoles.map(\.rawValue) |
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.
Shouldn't this be part of the repository?
|
||
await context.perform { | ||
localConversation.accessModeStrings = event.accessModes.map(\.rawValue) | ||
localConversation.accessRoleStringsV2 = accessRoles.map(\.rawValue) |
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 think saves should happen on a higher level. For instance:
- Get batch of pending events
- Process batch of events (no saves in-between)
- After successfully processing all events in batch, one single save, then delete those pending events (they are consumed now
We need to take care that any committed work isn't repeated in case of any interruption to the event processing.
domain: conversationID.domain | ||
) | ||
|
||
let accessRoles = if let legacyAccessRole = event.legacyAccessRole { |
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.
Hmm... do we even need to handle the legacy roles anymore? The newer roles are always present.
WPB-10164
Key points
This PR is part of the quick sync refactoring plan and is related to processing the multiple events we receive from the backend or the push channel.
Specifically, this PR is about porting the existing implementation of the
ConversationAccessUpdate
event.Testing
UTs cover the following use cases, ensuring that:
Checklist
[WPB-XXX]
.UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: