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: conversation message timer update event - WPB-10171 #2098

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jullianm
Copy link
Contributor

@jullianm jullianm commented Oct 29, 2024

TaskWPB-10171 [iOS] Process ConversationMessageTimerUpdateEvent

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

Testing

UTs cover the following use cases, ensuring that

  • event is processed with repo/store methods correctly invoked

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.

@@ -59,25 +58,29 @@ public protocol ConversationLocalStoreProtocol {
/// - Parameter isFederationEnabled: A flag indicating whether a `Federation` is enabled.

func storeConversation(
_ conversation: WireAPI.Conversation,
_ conversation: WireDomain.Conversation,
Copy link
Contributor Author

@jullianm jullianm Oct 29, 2024

Choose a reason for hiding this comment

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

94b4ad4 introduces a WireDomain conversation object that replaces the WireAPI.Conversation object passed as parameter here to avoid introducing API layer elements in our local stores. (local stores should be agnostic of the API layer).

remoteConversation: WireAPI.Conversation,
remoteConversationID: UUID,
from conversation: Conversation,
withID id: UUID,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

many changes like this in this PR: renaming parameters for more clarity

@@ -173,7 +173,7 @@ public final class ConversationRepository: ConversationRepositoryProtocol {
}

await conversationsLocalStore.storeConversation(
conversation,
conversation.toDomainModel(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

preparing data for the local store by converting the API object to a Domain object.

Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

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

looks good, can you ping me again on this one once other related PRs are merged (message system...)

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.

2 participants