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

feat: Disable remote domain users for Proteus conversation [WPB-10788] #3432

Merged

Conversation

borichellow
Copy link
Contributor

@borichellow borichellow commented Sep 11, 2024

StoryWPB-10788 [Android] Disable adding remote domain users in Proteus Conversations

What's new in this PR?

Issues

We need to disable adding users from another domain into the Proteus conversation or if the team's default protocol is Proteus.

Solutions

add isOtherDomainAllowed field into AddMembersSearchNavArgs and use it in SearchUserViewModel by passing to FederatedSearchParser.
in updated kalium FederatedSearchParser accept new isOtherDomainAllowed and "do the magic".

Waiting for kalium PR wireapp/kalium#3004

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 44.88%. Comparing base (e5614ee) to head (78b4e30).

Files with missing lines Patch % Lines
...i/home/conversations/search/SearchUserViewModel.kt 88.88% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3432      +/-   ##
===========================================
+ Coverage    44.83%   44.88%   +0.04%     
===========================================
  Files          466      466              
  Lines        15667    15683      +16     
  Branches      2637     2642       +5     
===========================================
+ Hits          7024     7039      +15     
  Misses        7885     7885              
- Partials       758      759       +1     
Files with missing lines Coverage Δ
...i/home/conversations/search/SearchUserViewModel.kt 94.93% <88.88%> (-0.31%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5614ee...78b4e30. Read the comment docs.

Copy link
Contributor

Built wire-android-staging-compat-pr-3432.apk is available for download

Copy link
Contributor

Built wire-android-dev-debug-pr-3432.apk is available for download

Copy link
Contributor

@alexandreferris alexandreferris left a comment

Choose a reason for hiding this comment

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

Just a question 🤔

@@ -82,7 +82,7 @@ class SearchUserViewModel @Inject constructor(
}

private suspend fun search(query: String) {
val (searchTerm, domain) = federatedSearchParser(query)
val (searchTerm, domain) = federatedSearchParser(query, addMembersSearchNavArgs?.isOtherDomainAllowed ?: true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should really the default be true if isOtherDomainAllowed is null? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that question made me to think more about the implementation and I've noticed that all the addMembersSearchNavArgs might be null here (in case of creating a new conversation).

So I've updated PR and moved all the isOtherDomainAllowed logic directly into SearchUserViewModel.

Answering your question: if addMembersSearchNavArgs is null we use only default team protocol to get if other domain allowed.

Copy link
Contributor

Built wire-android-staging-compat-pr-3432.apk is available for download

Copy link
Contributor

Built wire-android-dev-debug-pr-3432.apk is available for download

@MohamadJaara MohamadJaara added this pull request to the merge queue Sep 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Sep 16, 2024
…disable_remote_domain_users_for_proteus_conversation

# Conflicts:
#	kalium
Copy link

@MohamadJaara MohamadJaara added this pull request to the merge queue Sep 16, 2024
Copy link
Contributor

Built wire-android-staging-compat-pr-3432.apk is available for download

Copy link
Contributor

Built wire-android-dev-debug-pr-3432.apk is available for download

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 16, 2024
@MohamadJaara MohamadJaara added this pull request to the merge queue Sep 16, 2024
Merged via the queue into develop with commit 9672f87 Sep 16, 2024
12 of 13 checks passed
@MohamadJaara MohamadJaara deleted the feat/disable_remote_domain_users_for_proteus_conversation branch September 16, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/initiative: federation-and-mls-on-wire-c... Activate Federation with MLS on Wire Cloud size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants