-
Notifications
You must be signed in to change notification settings - Fork 39
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
yamilmedina
wants to merge
23
commits into
develop
Choose a base branch
from
feat/new-regs-analytics
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+485
−27
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1db38d7
fix: general fixes about navigation and copies
yamilmedina eab79c6
feat: implement analytics changes for new reg
yamilmedina 7c09f70
feat: pr comments
yamilmedina 2731926
feat: detekt fixes
yamilmedina ba8df2d
Merge branch 'fix/copy-new-registration-flow' into feat/new-regs-anal…
yamilmedina bd4aaef
feat: wip analytics
yamilmedina f68ea4e
feat: wip analytics, sending events
yamilmedina d671984
feat: wip analytics, sending events
yamilmedina 0d528c7
feat: wip analytics, sending events
yamilmedina bd87787
feat: add analytics to registration flows screens
yamilmedina 328e087
feat: add analytics to registration flows screens, add warmup for sdk
yamilmedina c01e5c3
feat: add analytics to registration flows screens, add warmup for sdk
yamilmedina 98ff06a
Merge branch 'develop' into feat/new-regs-analytics
yamilmedina d6d667b
chore: update kalium ref
yamilmedina 06f52f5
feat: init countly only when is allowed to
yamilmedina e432433
feat: perform cleanup and transfer id for user after registratiobn
yamilmedina 3c2a4ed
feat: perform cleanup and transfer id for user after registratiobn
yamilmedina a49a2d0
feat: perform cleanup and write test coverage
yamilmedina 7601e83
feat: write test coverage
yamilmedina ad6a7d1
feat: rename usecase
yamilmedina f7ad846
Merge branch 'develop' into feat/new-regs-analytics
yamilmedina 9974f4e
empty commit
yamilmedina b14e65a
feat: test coverage
yamilmedina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...rc/main/kotlin/com/wire/android/analytics/FinalizeRegistrationAnalyticsMetadataUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2025 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
package com.wire.android.analytics | ||
|
||
import com.wire.android.datastore.GlobalDataStore | ||
import com.wire.android.di.CurrentAccount | ||
import com.wire.android.di.KaliumCoreLogic | ||
import com.wire.kalium.logic.CoreLogic | ||
import com.wire.kalium.logic.data.user.UserId | ||
import kotlinx.coroutines.flow.firstOrNull | ||
import javax.inject.Inject | ||
|
||
/** | ||
* Finalize the registration process and analytics metadata in case there was enabled in the process. | ||
* Transfers the identifier to the logged in user and clean up the registration process. | ||
*/ | ||
class FinalizeRegistrationAnalyticsMetadataUseCase @Inject constructor( | ||
private val globalDataStore: GlobalDataStore, | ||
@CurrentAccount private val currentAccount: UserId, | ||
@KaliumCoreLogic private val coreLogic: CoreLogic | ||
) { | ||
suspend operator fun invoke() { | ||
if (globalDataStore.isAnonymousRegistrationEnabled().firstOrNull() == false) return | ||
|
||
val trackId = globalDataStore.getAnonymousRegistrationTrackId() | ||
if (!trackId.isNullOrBlank()) { | ||
coreLogic.getSessionScope(currentAccount).setNewUserTrackingIdentifier(trackId) | ||
globalDataStore.clearAnonymousRegistrationTrackId() | ||
globalDataStore.setAnonymousRegistrationEnabled(false) | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.