-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: support Proteus federation if MLS not supported by backend (WPB-14250) #3126
feat: support Proteus federation if MLS not supported by backend (WPB-14250) #3126
Conversation
Quality Gate passedIssues Measures |
private suspend fun isConversationProtocolAbleToFederate(conversationId: ConversationId?): Boolean { | ||
val isProteusTeam = getDefaultProtocol() == SupportedProtocol.PROTEUS | ||
val isOtherDomainAllowed: Boolean = conversationId?.let { | ||
when (val result = getConversationProtocolInfo(it)) { | ||
is GetConversationProtocolInfoUseCase.Result.Failure -> !isProteusTeam | ||
|
||
is GetConversationProtocolInfoUseCase.Result.Success -> | ||
!isProteusTeam && result.protocolInfo !is Conversation.ProtocolInfo.Proteus | ||
} | ||
} ?: !isProteusTeam | ||
return isOtherDomainAllowed | ||
} |
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.
Note: Logic migrated as-is to preserve retro compatibility with, plus added tests for this here too
Datadog ReportBranch report: ✅ 0 Failed, 3162 Passed, 107 Skipped, 35.52s Total Time |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/candidate #3126 +/- ##
==================================================
Coverage 52.64% 52.64%
==================================================
Files 1321 1322 +1
Lines 51615 51645 +30
Branches 4781 4791 +10
==================================================
+ Hits 27172 27191 +19
- Misses 22487 22493 +6
- Partials 1956 1961 +5
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
…-14250) (#3126) * chore: use case template * feat: usecase for allowing federated search * feat: add usecase to check for federation search allowance * feat: cleanup * feat: adjust tests to new implementation * feat: adjust tests to new implementation
…-14250) (#3126) (#3132) * chore: use case template * feat: usecase for allowing federated search * feat: add usecase to check for federation search allowance * feat: cleanup * feat: adjust tests to new implementation * feat: adjust tests to new implementation Co-authored-by: Yamil Medina <[email protected]>
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
We need to support federation search, according to if MLS is enabled, or if it is configured or not in the backend.
Solutions
Create a new use case centralizing the logic to decide if we need to support federation or not for this: team/conversation/backend.
Before the logic was in the view model in AR, but here is centralized and we can test all the cases for it, therefore now the view model just calls this use case to decide if we need to enable cross domain search.
Dependencies (Optional)
Needs releases with:
Testing
Test Coverage (Optional)
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.