Skip to content
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 member join event - WPB-10168 #2041

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jullianm
Copy link
Contributor

@jullianm jullianm commented Oct 16, 2024

TaskWPB-10168 [iOS] Process ConversationMemberJoinEvent

…ctor our system message, add UTs - WPB-10168

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 ConversationMemberJoin event.

Testing

UTs cover the following use cases, ensuring that

  • a participant is properly added to the conversation
  • a system message is properly added to a conversation
  • a conversation is properly pulled from backend

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

…ctor our system message, add UTs - WPB-10168
)

let role = member.conversationRole.map {
Role.fetchOrCreateRole(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could go to a specific repository, I'm thinking the UserRepository but I'm not certain where it makes the most sense. What do you think?

public func addSystemMessage(
_ message: SystemMessage,
to conversation: ZMConversation
) async {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was factored out of the ZMSystemMessage legacy extension, so we can use it directly from the repo. There are other places in WireDomain where we still use the legacy helper method that will be refactored as well if this change is approved.

Copy link
Contributor

Test Results

270 tests   270 ✅  10s ⏱️
 47 suites    0 💤
  2 files      0 ❌

Results for commit 700ea5d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant