Repository navigation
feat: track coinbase buy events - #879
Conversation
…itory and an implementation for the interface - set up web services for payment_methods, place_buy_order, commit_order and send_funds_to_wallet
…to feature-buy-dash-data # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
…_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…r_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt
…1131_Buy_Dash_UI_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
…i models - update implementation in CoinBaseRepository.kt and CoinbaseServicesViewModel.kt to for buy/commit/send flows
…to feature-buy-dash-data # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt
…t.kt - change user authorization scope for coinbase in CoinBaseWebClientActivity.kt - inject wallet data provider in WalletDataProviderModule.kt - update calls to get payment methods, place/commit buy orders and send funds to dash wallet
…1131_Buy_Dash_UI_Order_Preview_Info_dialogs_Error_Success_messages # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseBuyDashFragment.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt # wallet/src/de/schildbach/wallet/ui/coinbase/CoinBaseWebClientActivity.kt
- observe coinbase logout with livedata - update implementation to open Coinbase portal upon coinbase authentication
…to bugfix-refresh-buy-sell-ui # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/Constants.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/repository/CoinBaseRepository.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/viewmodels/CoinbaseServicesViewModel.kt # wallet/src/de/schildbach/wallet/ui/BuyAndSellLiquidUpholdActivity.kt # wallet/src/de/schildbach/wallet/ui/BuyAndSellViewModel.kt
- use lamdas to handle click on Buy & Sell dash items
…to feature-coinbase-buy-events # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/CoinbaseServicesFragment.kt # wallet/src/de/schildbach/wallet/ui/BuyAndSellLiquidUpholdActivity.kt
…to feature-coinbase-buy-events # Conflicts: # integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/ui/dialogs/CancelTransactionDialog.kt
| .noCode().minDecimals(2).optionalDecimals() | ||
|
|
||
| private var onCurrencyToggleClicked: (() -> Unit)? = null | ||
| private val analytics = FirebaseAnalyticsServiceImpl.getInstance() |
There was a problem hiding this comment.
@ClaudeHangui it's better to use Hilt for injecting the analytics service. getInstance() method was added when we didn't have DI in the wallet.
| analytics.logEvent(if (dashToFiat) AnalyticsConstants.Coinbase.ENTER_AMOUNT_DASH | ||
| else AnalyticsConstants.Coinbase.ENTER_AMOUNT_FIAT, | ||
| bundleOf() | ||
| ) |
There was a problem hiding this comment.
Since this is a common component, then would not this log all currency direction changes as being from the coinbase module?
There was a problem hiding this comment.
Agree, this is related to my previous comment. The fact that we cannot easily inject AnalyticsService into this component is the first indication that logs are made at the wrong level. DashToFiat should be propagated through the viewModel into the coinbase and logged in there.
There was a problem hiding this comment.
Should that be the case for all of the component classes? The Fragment that is using them and responding to events from the component should log the event, rather than the component itself.
There was a problem hiding this comment.
Yes, that should be the case. Common components should only be responsible for their own functionality and shouldn't know or care about event logging.
…at and fiatToDash
- update event on EnterAmountFragment.kt -> record event for coinbase flow only
- rollback to using Event wrapper class in Coinbase flow to ensure navigation is only fired once
| private var loadingDialog: FancyAlertDialog? = null | ||
| private var currentExchangeRate: org.dash.wallet.common.data.ExchangeRate? = null | ||
|
|
||
| @Inject lateinit var analyticsService: FirebaseAnalyticsServiceImpl |
There was a problem hiding this comment.
When injecting, wouldn't it be:
@Inject lateinit var analyticsService: AnalyticsService
HashEngineering
left a comment
There was a problem hiding this comment.
one comment left above.
| binding.continueBtn.setOnClickListener { | ||
| if (!binding.amountView.showCurrencySelector) { | ||
| analyticsService.logEvent( | ||
| AnalyticsConstants.Coinbase.CONTINUE_DASH_PURCHASE, |
There was a problem hiding this comment.
@ClaudeHangui this is still wrong. Common components should only be responsible for their own functionality and shouldn't know or care about event logging. Events should be propagated down to the end-user (conbase module in this case) and logged in there.
Otherwise, we'll end up with a tree of if-else that checks for coinbase vs crowdnode vs etc logs. This breaks both single-responsibility and open-closed principles.
There was a problem hiding this comment.
you guys are absolutely right !
There was a problem hiding this comment.
This has been addressed, so I will merge this story.
…baseServicesFragment.kt - propagate logging of Coinbase events from EnterAmountFragment.kt to CoinbaseBuyDashFragment.kt
| showSearch = false | ||
| ) { _, index, dialog -> | ||
| dialog.dismiss() | ||
| analytics.logEvent(AnalyticsConstants.Coinbase.CHANGE_PAYMENT_METHOD, bundleOf()) |
There was a problem hiding this comment.
Here remains a logged event inside a common component.
There was a problem hiding this comment.
Fixed in last push
HashEngineering
left a comment
There was a problem hiding this comment.
Excellent, this is ready to merge.
Issue being fixed or feature implemented
This PR focuses on tracking buy events related to a Coinbase user
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: