-
Notifications
You must be signed in to change notification settings - Fork 36
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
iOS-8282 analytics parameters update #4135
base: releases/5.18
Are you sure you want to change the base?
Changes from all commits
918eb9b
3d2526d
d155f7e
4364db5
0dc0c05
6a05302
d8e076e
1b6ff72
898a7a4
aaefde9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,11 +10,29 @@ import Foundation | |
import TangemStaking | ||
|
||
struct CommonStakingAnalyticsLogger: StakingAnalyticsLogger { | ||
func logAPIError(errorDescription: String, currencySymbol: String?) { | ||
var params: [Analytics.ParameterKey: String] = [.errorDescription: errorDescription] | ||
if let currencySymbol { | ||
params[.token] = currencySymbol | ||
func logError(_ error: any Error, currencySymbol: String) { | ||
let event: Analytics.Event | ||
var parameters: [Analytics.ParameterKey: String] = [.token: currencySymbol] | ||
switch error { | ||
case let apiError as StakeKitAPIError: | ||
if let code = apiError.code { | ||
parameters[.errorCode] = code | ||
} | ||
if let message = apiError.message { | ||
parameters[.errorMessage] = message | ||
} | ||
Comment on lines
+18
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: |
||
event = .stakingErrors | ||
case let httpError as StakeKitHTTPError: | ||
parameters[.errorDescription] = httpError.errorDescription | ||
event = .stakingErrors | ||
case let error as LocalizedError where error is StakingManagerError || error is StakeKitMapperError: | ||
parameters[.errorDescription] = error.errorDescription | ||
event = .stakingAppErrors | ||
default: return | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Все другие ошибки (например системные или любые добавленные в будущем) будут втихую игнорироваться Прошлая реализация работала по другому |
||
} | ||
Analytics.log(event: .stakingErrors, params: params) | ||
Analytics.log( | ||
event: event, | ||
params: parameters | ||
) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ import SwiftUI | |
|
||
enum TokenNotificationEvent: Hashable { | ||
case networkUnreachable(currencySymbol: String) | ||
case someNetworksUnreachable | ||
case someNetworksUnreachable(networks: [WalletModel]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Что-то c большой вероятность где-то утечет, если напрямую в енам класть WalletModel Например Мне кажется тут лучше держать айдишники, а не сами walletmodel |
||
case rentFee(rentMessage: String) | ||
case noAccount(message: String) | ||
case existentialDepositWarning(message: String) | ||
|
@@ -255,8 +255,9 @@ extension TokenNotificationEvent { | |
return [.token: currencySymbol] | ||
case .notEnoughFeeForTransaction(let configuration): | ||
return [.token: configuration.eventConfiguration.feeAmountTypeCurrencySymbol] | ||
case .someNetworksUnreachable, | ||
.rentFee, | ||
case .someNetworksUnreachable(let networks): | ||
return [.tokens: networks.map(\.tokenItem.currencySymbol).joined(separator: ", ")] | ||
case .rentFee, | ||
.noAccount, | ||
.existentialDepositWarning, | ||
.bnbBeaconChainRetirement, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А все эти удаленные ивенты чем-то будут заменены?
Просто странно что сами то действия остались (рефреш, перелистывание и т.д.), удалена только их аналитика