Skip to content

feat(new-registration): add flows anonymous usage data (WPB-17529) #4088

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

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

Conversation

yamilmedina
Copy link
Contributor

@yamilmedina yamilmedina commented Jun 27, 2025

StoryWPB-17529 [Android] New Registration Flows - Personal account countly tracking


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

As a part of the final step for new registration flows we need to provide countly tracking in case the user allows it.

Solutions

  • Implement it by reusing some parts like the initialization code configuration (half of this is on kalium)
  • Handle initialization properly according to environment allowance (only staging and prod)
  • Add the tracking logic events for the flows
  • Carry over the identifier id for the freshly created user
  • Fix/ hide the sync bar on the new registrations flows (https://wearezeta.atlassian.net/browse/WPB-18399)

Needs release with

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Connect to staging or prod, go to Analytics dashboard and see the events there when the consent by the user was granted.


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.

@yamilmedina yamilmedina changed the title feat: new registration flows anonymous usage data (WPB-17529) feat(new-registration): add flows anonymous usage data (WPB-17529) Jun 27, 2025
@@ -82,6 +90,7 @@ class CreateAccountDataDetailViewModel @Inject constructor(
private fun onEmailContinue() {
detailsState = detailsState.copy(loading = true, continueEnabled = false)
viewModelScope.launch {
delay(ANALYTICS_INIT_WARMUP_THRESHOLD)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not my favorite, but the Countly SDK in my tests it hardly takes a half a second to init (is not sync), so adding this as a way to wait and then proceed for the first screens tracking.

Comment on lines +262 to +265
is CreateAccountUsernameScreenDestination,
is CreateAccountVerificationCodeScreenDestination,
is CreateAccountDataDetailScreenDestination,
is CreateAccountSelectorScreenDestination,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All related to hide the sync bar on the new registrations flows, thanks @saleniuk for the hint.

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.

Nice!

I don't have much to add to your amazing work 🔥 just a very small nitpick comment that I also might be wrong 😅

Apart from that, awaiting for the approvals 👌🏻

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 27, 2025
Copy link

Copy link

codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 71.25000% with 23 lines in your changes missing coverage. Please review.

Project coverage is 47.83%. Comparing base (7119fe2) to head (b14e65a).

Files with missing lines Patch % Lines
...tlin/com/wire/android/datastore/GlobalDataStore.kt 13.33% 13 Missing ⚠️
...tlin/com/wire/android/util/CurrentScreenManager.kt 0.00% 4 Missing ⚠️
...ion/code/CreateAccountVerificationCodeViewModel.kt 0.00% 3 Missing ⚠️
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% 1 Missing ⚠️
...cs/FinalizeRegistrationAnalyticsMetadataUseCase.kt 90.00% 0 Missing and 1 partial ⚠️
...analytics/ObserveCurrentSessionAnalyticsUseCase.kt 95.65% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (71.25%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4088      +/-   ##
===========================================
+ Coverage    47.75%   47.83%   +0.08%     
===========================================
  Files          502      504       +2     
  Lines        17582    17649      +67     
  Branches      2899     2907       +8     
===========================================
+ Hits          8396     8443      +47     
- Misses        8306     8327      +21     
+ Partials       880      879       -1     
Files with missing lines Coverage Δ
.../create/username/CreateAccountUsernameViewModel.kt 100.00% <100.00%> (ø)
...ration/details/CreateAccountDataDetailViewModel.kt 77.31% <100.00%> (+5.55%) ⬆️
...in/com/wire/android/util/ServerConfigExtensions.kt 100.00% <100.00%> (ø)
...rc/main/kotlin/com/wire/android/WireApplication.kt 0.00% <0.00%> (ø)
...cs/FinalizeRegistrationAnalyticsMetadataUseCase.kt 90.00% <90.00%> (ø)
...analytics/ObserveCurrentSessionAnalyticsUseCase.kt 91.66% <95.65%> (+2.30%) ⬆️
...ion/code/CreateAccountVerificationCodeViewModel.kt 0.00% <0.00%> (ø)
...tlin/com/wire/android/util/CurrentScreenManager.kt 25.00% <0.00%> (-1.05%) ⬇️
...tlin/com/wire/android/datastore/GlobalDataStore.kt 19.04% <13.33%> (-1.79%) ⬇️

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 7119fe2...b14e65a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

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

Copy link
Contributor

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

@yamilmedina yamilmedina requested a review from Garzas June 30, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants