NTP-15268 | cl lite sync crash fix (#13991)

Co-authored-by: Shankar Yadav <shankar.yadav@navi.com>
This commit is contained in:
Akshita Singh
2024-12-05 19:32:43 +05:30
committed by GitHub
parent fda478f7a8
commit c9183e571b
2 changed files with 31 additions and 25 deletions

View File

@@ -255,20 +255,19 @@ constructor(
) {
val upiLiteBoundStatus =
try {
upiLiteClHelper.checkUpiLiteBoundStatus(accountId = linkedAccountEntity.accountId)!!
} catch (e: Exception) {
naviPayAnalytics.onDevGenericEvent(
event = "Sync_CL_For_Upi_Lite_Failed",
params =
mapOf(
"func" to ::syncClForUpiLite.name,
"reason" to
"CL Helper checkUpiLiteBoundStatus failed. Exception: ${e.message}"
)
)
return
}
upiLiteClHelper.checkUpiLiteBoundStatus(accountId = linkedAccountEntity.accountId)
if (upiLiteBoundStatus?.status == null) {
naviPayAnalytics.onDevGenericEvent(
event = "Sync_CL_For_Upi_Lite_Failed",
params =
mapOf(
"func" to ::syncClForUpiLite.name,
"reason" to
"CL Helper checkUpiLiteBoundStatus failed. Exception: upiLiteBoundStatus is null"
)
)
return
}
naviPayAnalytics.onDevGenericEvent(
event = "Sync_CL_For_Upi_Lite",

View File

@@ -460,18 +460,25 @@ constructor(
phoneNumber: String,
deviceId: String,
accountReferenceId: String
): UpiLiteBoundStatusResponse? =
npciClService.instance()?.isUpiLiteBound(phoneNumber, deviceId, accountReferenceId)?.let {
result ->
gson.fromJson(result, UpiLiteBoundStatusResponse::class.java)
): UpiLiteBoundStatusResponse? {
try {
val result =
npciClService.instance()!!.isUpiLiteBound(phoneNumber, deviceId, accountReferenceId)
val upiLiteBoundStatus = gson.fromJson(result, UpiLiteBoundStatusResponse::class.java)
if (upiLiteBoundStatus?.status != null) return upiLiteBoundStatus
naviPayAnalytics.onDevGenericEvent(
event = "is_upi_lite_bound_failed",
params = mapOf("reason" to "NPCI Cl service is null")
)
return null
} catch (e: Exception) {
naviPayAnalytics.onDevGenericEvent(
event = "is_upi_lite_bound_failed",
params = mapOf("reason" to "NPCI Cl service is null. Exception: ${e.message}")
)
return null
}
?: run {
naviPayAnalytics.onDevGenericEvent(
event = "is_upi_lite_bound_failed",
params = mapOf("reason" to "NPCI Cl service is null")
)
null
}
}
/*
Delete Lite related data from customer's device