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: New user properties for Analytics [WPB-16121] #3312

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

Conversation

borichellow
Copy link
Contributor

@borichellow borichellow commented Feb 25, 2025

TaskWPB-16121 [Android] Implement new user properties

What's new in this PR?

Need to implement new user properties 2 of them: amount of users contacts AND amount of team member in users team.

Solutions

  • Implement "caching" of users contacts and team size by saving values in MetaDataDao. That caches should refresh after 7 days.
  • added GetAnalyticsContactsDataUseCase for getting cached values and combining all the necessary data into AnalyticsContactsData data class
  • added UpdateContactsAmountsCacheUseCase for refreshing the cache and run it in UserSessionScope
  • added tests

Copy link
Contributor

github-actions bot commented Feb 26, 2025

Test Results

2 991 tests   - 538   2 981 ✅  - 438   4m 43s ⏱️ - 1m 53s
    2 suites  - 601      10 💤  - 100 
    2 files    - 601       0 ❌ ±  0 

Results for commit 7c36450. ± Comparison against base commit 678cab5.

This pull request removes 3529 and adds 2991 tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
PocIntegrationTest ‑ givenEmailAndPasswordWhenLoggingInThenRegisterClientAndLogout
PocIntegrationTest ‑ givenUserWhenHandlingTextMessagesThenProcessShouldSucceed
QualifiedIdTest ‑ givenIdsWithDifferentDomains_whenEqualsIgnoringBlankDomain_thenReturnsFalse[jvm]
QualifiedIdTest ‑ givenIdsWithDifferentValues_whenEqualsIgnoringBlankDomain_thenReturnsFalse[jvm]
QualifiedIdTest ‑ givenIdsWithSameDomains_whenEqualsIgnoringBlankDomain_thenReturnsTrue[jvm]
QualifiedIdTest ‑ givenIdsWithoutDomains_whenEqualsIgnoringBlankDomain_thenReturnsTrue[jvm]
QualifiedIdTest ‑ givenOneIdWithoutDomain_whenEqualsIgnoringBlankDomain_thenReturnsTrue[jvm]
com.wire.backup.BackupEndToEndTest ‑ givenBackedUpAssetMessage_whenRestoring_thenShouldReadTheSameContent[js, browser]
com.wire.backup.BackupEndToEndTest ‑ givenBackedUpAssetMessage_whenRestoring_thenShouldReadTheSameContent[jvm]
…
.QualifiedIdTest ‑ givenIdsWithDifferentDomains_whenEqualsIgnoringBlankDomain_thenReturnsFalse
.QualifiedIdTest ‑ givenIdsWithDifferentValues_whenEqualsIgnoringBlankDomain_thenReturnsFalse
.QualifiedIdTest ‑ givenIdsWithSameDomains_whenEqualsIgnoringBlankDomain_thenReturnsTrue
.QualifiedIdTest ‑ givenIdsWithoutDomains_whenEqualsIgnoringBlankDomain_thenReturnsTrue
.QualifiedIdTest ‑ givenOneIdWithoutDomain_whenEqualsIgnoringBlankDomain_thenReturnsTrue
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenFailure_thenErrorIsPropagated
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenMLSClientHasBeenRegistered_thenMLSAndProteusSelfConversationAreReturned
com.wire.kalium.logic.cache.SelfConversationIdProviderTest ‑ givenMLSClientHasNotBeenRegistered_thenProteusSelfConversationIsReturned
com.wire.kalium.logic.client.E2EIClientProviderTest ‑ givenIsNewClientTrue_whenGettingE2EIClient_newAcmeEnrollmentCalled
com.wire.kalium.logic.client.E2EIClientProviderTest ‑ givenMLSClientWithE2EI_whenGettingE2EIClient_callsNewActivationEnrollment
…
This pull request removes 110 skipped tests and adds 10 skipped tests. Note that renamed tests count towards both.
PocIntegrationTest ‑ givenApiWhenGettingACMEDirectoriesThenReturnAsExpectedBasedOnNetworkState
com.wire.kalium.api.common.ACMEApiTest ‑ whenCallingGeTrustAnchorsApi_theResponseShouldBeConfigureCorrectly[jvm]
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.conversation.ConversationRepositoryTest ‑ givenAGroupConversationHasNotNewMessages_whenGettingConversationDetails_ThenReturnZeroUnreadMessageCount
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenACorrectlyEncryptedBackup_whenRestoringWithWrongPassword_thenTheRightErrorIsThrown
com.wire.kalium.logic.feature.backup.RestoreBackupUseCaseTest ‑ givenAnEncryptedBackupFileFromDifferentUserID_whenRestoring_thenTheRightErrorIsThrown
com.wire.kalium.logic.feature.call.CallManagerTest ‑ givenCallManager_whenCallingMessageIsReceived_then_wcall_recv_msg_IsCalled
com.wire.kalium.logic.feature.conversation.ObserveConversationInteractionAvailabilityUseCaseTest ‑ givenProteusConversationAndUserSupportsOnlyMLS_whenObserving_thenShouldReturnUnsupportedProtocol
com.wire.kalium.logic.feature.conversation.ObserveConversationListDetailsUseCaseTest ‑ null
com.wire.kalium.logic.feature.session.DeleteSessionUseCaseTest ‑ givenSuccess_WhenDeletingSessionLocally_thenSuccessAndResourcesAreFreed
com.wire.kalium.logic.sync.incremental.EventProcessingHistoryTest ‑ measureContainsTimeOverLargeAmountOfEvents
com.wire.kalium.persistence.dao.message.MessageDAOBenchmarkTest ‑ null
com.wire.kalium.persistence.kmmSettings.EncryptedSettingsBuilderTest ‑ givenShouldEncryptDataIsTrue_whenEncryptingData_thenShouldEncryptWithoutFailing

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Feb 26, 2025

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.76%. Comparing base (db3bd82) to head (96cfab5).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3312      +/-   ##
===========================================
+ Coverage    50.72%   50.76%   +0.03%     
===========================================
  Files         1610     1612       +2     
  Lines        58206    58317     +111     
  Branches      5255     5272      +17     
===========================================
+ Hits         29525    29603      +78     
- Misses       26649    26670      +21     
- Partials      2032     2044      +12     

see 7 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 db3bd82...96cfab5. Read the comment docs.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Feb 26, 2025

Datadog Report

Branch report: feat/new_user_properties_for_analytics
Commit report: dd49bb0
Test service: kalium-jvm

✅ 0 Failed, 1 Passed, 0 Skipped, 0s Total Time

Copy link
Member

@MohamadJaara MohamadJaara left a comment

Choose a reason for hiding this comment

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

only one question about where to add the new functions

@borichellow borichellow requested a review from ohassine February 27, 2025 12:00
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