NTP-18531: Autoretry changes for DG and AMC critical flows (#14064)

This commit is contained in:
Raaj Gopal
2024-12-13 12:02:02 +05:30
committed by GitHub
parent 8a7fe8712d
commit a3b2f4a357
7 changed files with 31 additions and 0 deletions

View File

@@ -714,6 +714,7 @@ interface RetrofitService {
): Response<GenericResponse<ActionData>>
@GET("/alchemist/inflate/v2/{screenId}")
@RetryPolicy(retryCount = 3)
suspend fun fetchInvestmentTabScreenResponse(
@Header("Accept-Encoding") acceptEncoding: String,
@Header("X-Target") target: String,

View File

@@ -11,8 +11,11 @@ import android.content.Context
import com.chuckerteam.chucker.api.ChuckerCollector
import com.chuckerteam.chucker.api.ChuckerInterceptor
import com.navi.amc.BuildConfig
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.NAVI_AMC_RETRY_POLICY_ENABLED
import com.navi.common.model.NetworkInfo
import com.navi.common.network.BaseHttpClient
import com.navi.common.network.retry.interceptor.RetryInterceptor
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
@@ -34,6 +37,9 @@ class NaviHttpClient(networkInfo: NetworkInfo, private val context: Context) :
)
}
}
if (FirebaseRemoteConfigHelper.getBoolean(NAVI_AMC_RETRY_POLICY_ENABLED)) {
okHttpClientBuilder.addInterceptor(RetryInterceptor())
}
okHttpClientBuilder.addInterceptor {
val oldRequest = it.request()

View File

@@ -25,6 +25,7 @@ import com.navi.common.csat.models.NetPromoterScoreRequest
import com.navi.common.model.UploadDataAsyncResponse
import com.navi.common.network.models.GenericResponse
import com.navi.common.network.models.SuccessResponse
import com.navi.common.network.retry.annotations.RetryPolicy
import com.navi.naviwidgets.models.response.CSATResponse
import com.navi.payment.model.clientmodels.PostPaymentData
import okhttp3.MultipartBody
@@ -393,6 +394,7 @@ interface RetrofitService {
): Response<GenericResponse<AdditionalDataAsyncResponse<NextCtaResponse>>>
@GET("/fund/fund-details")
@RetryPolicy(retryCount = 3)
suspend fun fetchFundDetails(
@Query("isin") isin: String
): Response<GenericResponse<FundDetails>>

View File

@@ -53,6 +53,8 @@ object FirebaseRemoteConfigHelper {
const val NAVI_UPI_ENABLED = "NAVI_UPI_ENABLED"
const val ACCEPT_ENCODING_DEFAULT_VALUE = "ACCEPT_ENCODING_DEFAULT_VALUE"
const val UST_IN_GOLD_ENABLED = "UST_IN_GOLD_ENABLED"
const val NAVI_GOLD_RETRY_POLICY_ENABLED = "NAVI_GOLD_RETRY_POLICY_ENABLED"
const val NAVI_AMC_RETRY_POLICY_ENABLED = "NAVI_AMC_RETRY_POLICY_ENABLED"
const val UST_IN_AMC_ENABLED = "UST_IN_AMC_ENABLED"
const val AMC_CSAT_TIMER_DELAY_IN_SEC = "AMC_CSAT_TIMER_DELAY_IN_SEC"
const val AMC_ORDER_STATUS_POLLING_SCREEN_UI_DATA_V2 =

View File

@@ -610,4 +610,12 @@
<key>UPI_LITE_MANDATE_INFO_IN_DB_REFRESH_MIN_TIMESTAMP</key>
<value>86400000</value>
</entry>
<entry>
<key>NAVI_AMC_RETRY_POLICY_ENABLED</key>
<value>false</value>
</entry>
<entry>
<key>NAVI_GOLD_RETRY_POLICY_ENABLED</key>
<value>false</value>
</entry>
</defaultsMap>

View File

@@ -11,8 +11,10 @@ import android.content.Context
import com.chuckerteam.chucker.api.ChuckerCollector
import com.chuckerteam.chucker.api.ChuckerInterceptor
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.NAVI_GOLD_RETRY_POLICY_ENABLED
import com.navi.common.model.NetworkInfo
import com.navi.common.network.BaseHttpClient
import com.navi.common.network.retry.interceptor.RetryInterceptor
import com.navi.gold.BuildConfig
import okhttp3.Interceptor
import okhttp3.OkHttpClient
@@ -38,6 +40,10 @@ class NaviHttpClient(networkInfo: NetworkInfo, private val context: Context) :
}
}
if (FirebaseRemoteConfigHelper.getBoolean(NAVI_GOLD_RETRY_POLICY_ENABLED)) {
okHttpClientBuilder.addInterceptor(RetryInterceptor())
}
okHttpClientBuilder.addInterceptor {
val oldRequest = it.request()
val newRequest = oldRequest.newBuilder()

View File

@@ -16,6 +16,7 @@ import com.navi.common.model.common.InvoiceDownloadData
import com.navi.common.model.common.WidgetResponse
import com.navi.common.network.models.GenericResponse
import com.navi.common.network.models.SuccessResponse
import com.navi.common.network.retry.annotations.RetryPolicy
import com.navi.gold.model.AmountDataRequest
import com.navi.gold.model.BankBranch
import com.navi.gold.model.BankDataResponse
@@ -61,11 +62,13 @@ interface RetrofitService {
): Response<GenericResponse<WidgetResponse>>
@GET("/kuber/sip/setup-sip-page-content")
@RetryPolicy(retryCount = 3)
suspend fun getDigitalGoldSetupSipPage(
@QueryMap params: Map<String, String>
): Response<GenericResponse<WidgetResponse>>
@GET("/kuber/transactions/transaction-history-page-content")
@RetryPolicy(retryCount = 3)
suspend fun fetchDigitalGoldTransactionHistory(
@QueryMap params: Map<String, String>
): Response<GenericResponse<WidgetResponse>>
@@ -111,11 +114,13 @@ interface RetrofitService {
): Response<GenericResponse<WidgetResponse>>
@GET("/kuber/home/get-home-content")
@RetryPolicy(retryCount = 3)
suspend fun getDigitalGoldHome(
@QueryMap params: Map<String, String>
): Response<GenericResponse<WidgetResponse>>
@POST("/kuber/order/sell")
@RetryPolicy(retryCount = 3)
suspend fun getDigitalGoldSellOrder(
@Body goldSellOrderRequest: GoldSellOrderRequest
): Response<GenericResponse<GoldSellOrderResponse>>
@@ -146,6 +151,7 @@ interface RetrofitService {
): Response<GenericResponse<DigitalGoldActionCheckResponse>>
@GET("/kuber/order/payment-details/get-upi-page-content")
@RetryPolicy(retryCount = 3)
suspend fun fetchDigitalGoldSellUpiScreenData(
@Query("exchangeRateId") exchangeRateId: String,
@Query("amount") amount: Double