NTP-77421 | removed okhttp retry experiment code (#16791)
This commit is contained in:
@@ -12,12 +12,7 @@ import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.base.bandwidthbuddy.BandwidthAccessor
|
||||
import com.navi.base.sharedpref.PreferenceManager
|
||||
import com.navi.base.utils.NetWatchManger
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.OKHTTP_CUSTOM_DNS_EXPERIMENT_V2
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.OKHTTP_CUSTOM_DNS_VALUE
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.OKHTTP_RETRY_EXPERIMENT
|
||||
import com.navi.common.uitron.util.UiTronDependencyProvider
|
||||
import com.navi.common.utils.TemporaryStorageHelper
|
||||
import com.navi.uitron.UiTronSdkManager
|
||||
import com.naviapp.BuildConfig
|
||||
import com.naviapp.analytics.utils.NaviSDKHelper
|
||||
@@ -34,13 +29,6 @@ class SdkInitializer @Inject constructor() : ComponentInitializer {
|
||||
UiTronSdkManager.init(UiTronDependencyProvider(application.applicationContext))
|
||||
initSdkDebugMode(application.applicationContext)
|
||||
BandwidthAccessor.init()
|
||||
// This will be removed in next release
|
||||
TemporaryStorageHelper.isOkHttpCustomDnsV2Enabled =
|
||||
FirebaseRemoteConfigHelper.getBoolean(OKHTTP_CUSTOM_DNS_EXPERIMENT_V2)
|
||||
TemporaryStorageHelper.isOkHttpRetryEnabled =
|
||||
FirebaseRemoteConfigHelper.getBoolean(OKHTTP_RETRY_EXPERIMENT)
|
||||
TemporaryStorageHelper.customDnsValue =
|
||||
FirebaseRemoteConfigHelper.getString(OKHTTP_CUSTOM_DNS_VALUE, "8.8.8.8")
|
||||
}
|
||||
|
||||
private fun initSdkDebugMode(applicationContext: Context) {
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.navi.common.network
|
||||
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
import com.navi.common.utils.TemporaryStorageHelper
|
||||
import java.net.InetAddress
|
||||
import okhttp3.Dns
|
||||
|
||||
val NAVI_DNS = NaviDns()
|
||||
|
||||
class NaviDns : Dns {
|
||||
override fun lookup(hostname: String): List<InetAddress> {
|
||||
val inetAddressList = mutableListOf<InetAddress>()
|
||||
try {
|
||||
// Try SYSTEM DNS first
|
||||
val hostAddresses = inetAddressList.map { it.hostAddress }
|
||||
NaviTrackEvent.trackEventOnClickStream(
|
||||
eventName = "Navi_CustomDns_Lookup",
|
||||
eventValues =
|
||||
mapOf("hostname" to hostname, "hostAddresses" to hostAddresses.toString()),
|
||||
)
|
||||
return InetAddress.getAllByName(hostname).toList()
|
||||
} catch (e: Exception) {
|
||||
// In case of exception, try Google DNS
|
||||
val fallbackDns = TemporaryStorageHelper.customDnsValue.ifBlank { "8.8.8.8" }
|
||||
inetAddressList.addAll(InetAddress.getAllByName(fallbackDns))
|
||||
NaviTrackEvent.trackEventOnClickStream(
|
||||
eventName = "Navi_CustomDns_Lookup_Exception",
|
||||
eventValues =
|
||||
mapOf(
|
||||
"hostname" to hostname,
|
||||
"exception" to e.message.orEmpty(),
|
||||
"fallbackDns" to fallbackDns,
|
||||
),
|
||||
)
|
||||
}
|
||||
return inetAddressList
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ import com.navi.common.network.handleException
|
||||
import com.navi.common.network.isNetworkConnectivityInterceptorEnabled
|
||||
import com.navi.common.network.logIOException
|
||||
import com.navi.common.utils.Constants
|
||||
import com.navi.common.utils.TemporaryStorageHelper
|
||||
import com.navi.common.utils.getAnnotation
|
||||
import com.navi.naviwidgets.utils.VERTICAL
|
||||
import java.io.IOException
|
||||
@@ -84,11 +83,6 @@ class MetricInterceptor : Interceptor {
|
||||
"networkConnectivityInterceptorEnabled",
|
||||
isNetworkConnectivityInterceptorEnabled().toString(),
|
||||
),
|
||||
Pair(
|
||||
"customDnsV2Enabled",
|
||||
TemporaryStorageHelper.isOkHttpCustomDnsV2Enabled.toString(),
|
||||
),
|
||||
Pair("okHttpRetryEnabled", TemporaryStorageHelper.isOkHttpRetryEnabled.toString()),
|
||||
)
|
||||
|
||||
if (shouldEnableRequestBodyLogging != null) {
|
||||
|
||||
@@ -52,14 +52,6 @@ class CommonNaviAnalytics private constructor() {
|
||||
Pair("apiUrl", apiUrl.toString()),
|
||||
Pair("logMessage", error?.logMessage.toString()),
|
||||
Pair("alfredSessionId", AlfredFacade.getAlfredSessionId()),
|
||||
Pair(
|
||||
"customDnsV2Enabled",
|
||||
TemporaryStorageHelper.isOkHttpCustomDnsV2Enabled.toString(),
|
||||
),
|
||||
Pair(
|
||||
"okHttpRetryEnabled",
|
||||
TemporaryStorageHelper.isOkHttpRetryEnabled.toString(),
|
||||
),
|
||||
Pair(
|
||||
"networkConnectivityInterceptorEnabled",
|
||||
isNetworkConnectivityInterceptorEnabled().toString(),
|
||||
|
||||
@@ -34,11 +34,6 @@ object TemporaryStorageHelper {
|
||||
var emailSuccessFlow = MutableSharedFlow<Boolean?>(replay = 1)
|
||||
private set
|
||||
|
||||
// This will be removed in next release
|
||||
var isOkHttpCustomDnsV2Enabled: Boolean = false
|
||||
var isOkHttpRetryEnabled: Boolean = false
|
||||
var customDnsValue: String = "8.8.8.8"
|
||||
|
||||
// temporary changes, will be removed in the next release
|
||||
var scanAndPayClickTime = 0L
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.navi.common.network.isNetworkConnectivityInterceptorEnabled
|
||||
import com.navi.common.network.models.ErrorMessage
|
||||
import com.navi.common.network.models.GenericErrorResponse
|
||||
import com.navi.common.network.models.RepoResult
|
||||
import com.navi.common.utils.TemporaryStorageHelper
|
||||
import com.navi.pay.common.model.config.PspSelectionConfigContent
|
||||
import com.navi.pay.common.model.network.ValidateVpaResponse
|
||||
import com.navi.pay.common.model.view.CheckBalanceAnalyticsEventData
|
||||
@@ -537,14 +536,6 @@ class NaviPayAnalytics private constructor() {
|
||||
"networkConnectivityInterceptorEnabled",
|
||||
isNetworkConnectivityInterceptorEnabled().toString(),
|
||||
),
|
||||
Pair(
|
||||
"customDnsV2Enabled",
|
||||
TemporaryStorageHelper.isOkHttpCustomDnsV2Enabled.toString(),
|
||||
),
|
||||
Pair(
|
||||
"okHttpRetryEnabled",
|
||||
TemporaryStorageHelper.isOkHttpRetryEnabled.toString(),
|
||||
),
|
||||
)
|
||||
NaviTrackEvent.trackEvent("NaviPay_Dev_SetupUseCase_CustomerApi", map)
|
||||
}
|
||||
|
||||
@@ -14,10 +14,8 @@ import com.navi.base.cache.repository.NaviCacheRepository
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.UPI_RETRY_INTERCEPTOR_ENABLED
|
||||
import com.navi.common.model.NetworkInfo
|
||||
import com.navi.common.network.BaseHttpClient
|
||||
import com.navi.common.network.NAVI_DNS
|
||||
import com.navi.common.network.retry.interceptor.RetryInterceptor
|
||||
import com.navi.common.network.retry.interceptor.isRetryInterceptorEnabled
|
||||
import com.navi.common.utils.TemporaryStorageHelper
|
||||
import com.navi.pay.BuildConfig
|
||||
import com.navi.pay.utils.NAVI_PAY_SSID_CACHE_KEY
|
||||
import kotlinx.coroutines.runBlocking
|
||||
@@ -48,12 +46,6 @@ class NaviPayHttpClient(
|
||||
if (isRetryInterceptorEnabled(UPI_RETRY_INTERCEPTOR_ENABLED)) {
|
||||
addInterceptor(RetryInterceptor())
|
||||
}
|
||||
if (TemporaryStorageHelper.isOkHttpCustomDnsV2Enabled) {
|
||||
dns(NAVI_DNS)
|
||||
}
|
||||
if (TemporaryStorageHelper.isOkHttpRetryEnabled) {
|
||||
retryOnConnectionFailure(true)
|
||||
}
|
||||
addInterceptor(naviPayHeaderInterceptor)
|
||||
}
|
||||
return okHttpClientBuilder
|
||||
|
||||
Reference in New Issue
Block a user