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

chore: add client suffix on debug builds [ACOL-144] #2678

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.ui.text.input.TextFieldValue
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wire.android.BuildConfig
import com.wire.android.di.AuthServerConfigProvider
import com.wire.android.di.ClientScopeProvider
import com.wire.android.di.KaliumCoreLogic
Expand Down Expand Up @@ -209,7 +210,8 @@ class CreateAccountCodeViewModel @Inject constructor(
clientScopeProviderFactory.create(userId).clientScope.getOrRegister(
RegisterClientUseCase.RegisterClientParam(
password = password,
capabilities = null
capabilities = null,
modelPostfix = if(BuildConfig.PRIVATE_BUILD) " [${BuildConfig.FLAVOR}_${BuildConfig.BUILD_TYPE}]" else null
Copy link
Member

Choose a reason for hiding this comment

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

Is PrivateBuild the correct parameter? Won't clients with custom builds also have that?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind.

It seems we use PRIVATE_BUILD just for debug stuff. Only visible to us.

I guess we could name it better 🤔
Anyway. LGTM!

Copy link
Contributor

Choose a reason for hiding this comment

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

Just checked and as default we go with false, if not set (like the case of those custom builds)

/**
* Process feature flags and if the feature is not included in a product flavor,
* a default value of "false" or "deactivated" is used.
*
* @see "FeatureFlags.kt" file definition.
*/

)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.text.input.TextFieldValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wire.android.BuildConfig
import com.wire.android.datastore.UserDataStore
import com.wire.kalium.logic.feature.client.GetOrRegisterClientUseCase
import com.wire.kalium.logic.feature.client.RegisterClientResult
Expand Down Expand Up @@ -79,6 +80,7 @@ class RegisterDeviceViewModel @Inject constructor(
RegisterClientUseCase.RegisterClientParam(
password = password,
capabilities = null,
modelPostfix = if(BuildConfig.PRIVATE_BUILD) " [${BuildConfig.FLAVOR}_${BuildConfig.BUILD_TYPE}]" else null
)
)) {
is RegisterClientResult.Failure.TooManyClients ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.text.input.TextFieldValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wire.android.BuildConfig
import com.wire.android.datastore.UserDataStore
import com.wire.android.ui.authentication.devices.model.Device
import com.wire.kalium.logic.data.client.ClientType
Expand Down Expand Up @@ -115,7 +116,8 @@ class RemoveDeviceViewModel @Inject constructor(

private suspend fun registerClient(password: String?, onCompleted: (initialSyncCompleted: Boolean, isE2EIRequired: Boolean) -> Unit) {
registerClientUseCase(
RegisterClientUseCase.RegisterClientParam(password, null)
RegisterClientUseCase.RegisterClientParam(password, null,
modelPostfix = if(BuildConfig.PRIVATE_BUILD) " [${BuildConfig.FLAVOR}_${BuildConfig.BUILD_TYPE}]" else null)
).also { result ->
when (result) {
is RegisterClientResult.Failure.PasswordAuthRequired -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.compose.ui.text.input.TextFieldValue
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wire.android.BuildConfig
import com.wire.android.datastore.UserDataStoreProvider
import com.wire.android.di.AuthServerConfigProvider
import com.wire.android.di.ClientScopeProvider
Expand Down Expand Up @@ -136,7 +137,8 @@ open class LoginViewModel @Inject constructor(
RegisterClientUseCase.RegisterClientParam(
password = password,
capabilities = capabilities,
secondFactorVerificationCode = secondFactorVerificationCode
secondFactorVerificationCode = secondFactorVerificationCode,
modelPostfix = if(BuildConfig.PRIVATE_BUILD) " [${BuildConfig.FLAVOR}_${BuildConfig.BUILD_TYPE}]" else null
)
)
}
Expand Down
Loading