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: fetch full list of team members when kalium consumers needs to #2284

Conversation

MohamadJaara
Copy link
Member


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

some consumers of kalium like Infinite Monkeys expect a full list of team members to be stored locally

Solutions

Add a flag on KaliumConfigs called fetchAllTeamMembersEagerly (false by default).

This flag, if true would actually fetch all team members in a paginated fashion during slow sync.

If false, it keeps the current behaviour of only fetching users with established connection + other people that are members of the same conversations as self user.

Dependencies (Optional)

If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link
Contributor

github-actions bot commented Dec 4, 2023

Test Results

1 895 tests   - 782   1 865 ✔️  - 708   10s ⏱️ - 2m 25s
   350 suites  - 130        30 💤  -   74 
   350 files    - 130          0 ±    0 

Results for commit 3353242. ± Comparison against base commit 8e02923.

This pull request removes 2677 and adds 1895 tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
com.wire.kalium.HttpClientConnectionSpecsTest ‑ givenTheHttpClientIsCreated_ThenEnsureOnlySupportedSpecsArePresent[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithAccessRoleAndDeprecatedAccessRoleField_whenDecoding_thenDeprecatedFieldIsPreferred[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayloadWithDeprecatedAccessRoleField_whenDecoding_thenSuccess[jvm]
com.wire.kalium.api.base.authenticated.notification.AccessUpdateTest ‑ givenPayload_whenDecoding_thenSuccess[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoLocationInHeader_whenCallingSendAcmeRequestApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ givenNoNonce_whenCallingSendAcmeRequestApi_theResponseShouldBeMissingNonce[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMEDirectoriesApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGetACMENonceApi_theResponseShouldBeConfigureCorrectly[jvm]
…
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenFailure_thenErrorIsPropagated[iosX64]
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenMLSClientHasBeenRegistered_thenMLSAndProteusSelfConversationAreReturned[iosX64]
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenMLSClientHasNotBeenRegistered_thenProteusSelfConversationIsReturned[iosX64]
com.wire.kalium.logic.client.E2EIClientProviderTest ‑ givenMLSClientWithE2EI_whenGettingE2EIClient_callsNewActivationEnrollment[iosX64]
com.wire.kalium.logic.client.E2EIClientProviderTest ‑ givenMLSClientWithoutE2EI_whenGettingE2EIClient_callsNewRotateEnrollment[iosX64]
com.wire.kalium.logic.client.E2EIClientProviderTest ‑ givenSelfUserNotFound_whenGettingE2EIClient_ReturnsError[iosX64]
com.wire.kalium.logic.configuration.ServerConfigMapperTest ‑ givenACommonApiVersion_whenMapping_thenValuesAreMappedCorrectly[iosX64]
com.wire.kalium.logic.configuration.ServerConfigMapperTest ‑ givenANetworkConfigEntity_whenMappingFromNetworkConfig_thenValuesAreMappedCorrectly[iosX64]
com.wire.kalium.logic.configuration.ServerConfigMapperTest ‑ givenAServerConfig_whenMappingToBackendConfig_thenValuesAreMappedCorrectly[iosX64]
com.wire.kalium.logic.configuration.ServerConfigMapperTest ‑ givenAServerConfig_whenMappingToNetworkConfig_thenValuesAreMappedCorrectly[iosX64]
…
This pull request removes 104 skipped tests and adds 30 skipped tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingSendChallengeRequestApi_theResponseShouldBeConfigureCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenActivationEmailWIthCode_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenRegisteringAccountWithEMail_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenAValidEmail_whenSendingActivationEmail_theRequestShouldBeConfiguredCorrectly[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenActivationCodeFail_thenErrorIsPropagated[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenRegistrationFail_whenRegisteringAccountWithEMMail_thenErrorIsPropagated[jvm]
com.wire.kalium.api.v0.user.register.RegisterApiV0Test ‑ givenSendActivationCodeFail_thenErrorIsPropagated[jvm]
com.wire.kalium.cryptography.CryptoUtilsTest ‑ givenDummyText_whenEncryptedAndDecryptedWithAES256_returnsOriginalText[js, browser]
…
com.wire.kalium.logic.data.reaction.ReactionRepositoryTest ‑ givenSelfUserReactionWasPersisted_whenObservingMessageReactions_thenShouldReturnReactionsPreviouslyStored[iosX64]
com.wire.kalium.logic.feature.backup.CreateBackupUseCaseTest ‑ givenSomeInvalidDBData_whenCreatingNonEncryptedBackup_thenTheRightErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.CreateBackupUseCaseTest ‑ givenSomeValidData_whenCreatingAnEncryptedBackup_thenTheFinalBackupFileIsCreatedCorrectly[iosX64]
com.wire.kalium.logic.feature.backup.CreateBackupUseCaseTest ‑ givenSomeValidData_whenCreatingNonEncryptedBackup_thenTheFinalBackupFileIsCreatedCorrectly[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectNonEncryptedBackupFileWithWrongAuthor_whenRestoring_thenTheCorrectErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectNonEncryptedBackupFileWithWrongMetadataFileName_whenRestoring_thenTheCorrectErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectNonEncryptedBackupFile_whenRestoring_thenTheBackupIsRestoredSuccessfully[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectlyEncryptedBackup_whenRestoringWithADBImportError_thenTheRightErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectlyEncryptedBackup_whenRestoringWithWrongPassword_thenTheRightErrorIsThrown[iosX64]
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenAValidEncryptedBackupFile_whenRestoring_thenTheBackupIsRestoredCorrectly[iosX64]
…

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2023

Codecov Report

Merging #2284 (3353242) into develop (8e02923) will increase coverage by 0.01%.
The diff coverage is 97.56%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2284      +/-   ##
=============================================
+ Coverage      57.87%   57.89%   +0.01%     
  Complexity        21       21              
=============================================
  Files           1093     1093              
  Lines          41359    41392      +33     
  Branches        3816     3820       +4     
=============================================
+ Hits           23938    23965      +27     
- Misses         15811    15815       +4     
- Partials        1610     1612       +2     
Files Coverage Δ
...e/kalium/logic/feature/team/SyncSelfTeamUseCase.kt 95.00% <100.00%> (+2.14%) ⬆️
...om/wire/kalium/logic/featureFlags/KaliumConfigs.kt 100.00% <100.00%> (ø)
.../com/wire/kalium/logic/data/team/TeamRepository.kt 91.58% <96.29%> (+1.46%) ⬆️

... and 5 files with indirect coverage changes


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 8e02923...3353242. Read the comment docs.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Dec 4, 2023

Datadog Report

All test runs 1d1158c 🔗

2 Total Test Services: 2 Failed, 0 with New Flaky, 0 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-ios 1 0 0 1864 30 12.1s Link
kalium-jvm 1 0 0 2551 52 6m 29.02s Link

❌ Failed Tests (2)

  • givenTeamIdAndUserDomain_whenFetchingTeamMembers_thenTeamMembersShouldBeSuccessful[iosX64] - com.wire.kalium.logic.data.team.TeamRepositoryTest - Details

    Expand for error
     io.mockative.MissingExpectationError: A function was called without a matching expectation.
     
         An expectation was not given on the function:
             TeamsApiMock.getTeamMembers(teamId, 200)
     
         Set up an expectation using:
             given(instance).coroutine { getTeamMembers(teamId, 200) }
                 .then { ... }
         
         The following expectations were configured on the mock:
     ...
    
  • givenTeamIdAndUserDomain_whenFetchingTeamMembers_thenTeamMembersShouldBeSuccessful[jvm] - com.wire.kalium.logic.data.team.TeamRepositoryTest - Details

    Expand for error
     io.mockative.MissingExpectationError: A function was called without a matching expectation.
     
         An expectation was not given on the function:
             TeamsApiMock.getTeamMembers(teamId, 200)
     
         Set up an expectation using:
             given(instance).coroutine { getTeamMembers(teamId, 200) }
                 .then { ... }
         
         The following expectations were configured on the mock:
     ...
    

@MohamadJaara MohamadJaara added this pull request to the merge queue Dec 5, 2023
Merged via the queue into develop with commit 1ad916c Dec 5, 2023
17 checks passed
@MohamadJaara MohamadJaara deleted the feat/fetch_full_list_of_team_members_when_kalium_consumers_needs_to branch December 5, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants