fix(zcoin): ARRR not reappearing in coins list after deactivation and reactivation#3184
fix(zcoin): ARRR not reappearing in coins list after deactivation and reactivation#3184
Conversation
zcoin activation function simply discarded coins that were already active without notifying listeners to display the coin in UI
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds ZHTLC configuration support and adjusts activation handling. Introduces an ArrrActivationService MM2 dependency and a method to update ZHTLC config by disabling coins before persisting. Updates UI to show a ZHTLC Config button and advanced options in the configuration dialog. Tweaks activation status bar and translations. Updates sdk submodule and .gitignore. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as CoinDetails (ZhtlcConfigButton)
participant Dialog as ZHTLC Config Dialog
participant AAS as ArrrActivationService
participant CR as CoinsRepo
participant MM2 as MM2 RPC
User->>UI: Tap "ZHTLC Config"
UI->>Dialog: Open configuration dialog
Dialog-->>UI: Return ZhtlcUserConfig
UI->>AAS: updateZhtlcConfig(asset, newConfig)
activate AAS
AAS->>MM2: disable_coin(coinId) [if active]
MM2-->>AAS: ok/error (logged)
AAS-->>UI: persist config result
deactivate AAS
UI->>CR: Deactivate+Activate coin with new config
CR->>CR: Check activation state
alt Already active
CR->>CR: Broadcast active, subscribe balances, parent checks, register icon
else Not active
CR->>CR: Standard activation (_activateZhtlcAsset)
end
CR-->>UI: Activation flow complete
UI-->>User: Navigate to Wallet / show status
sequenceDiagram
autonumber
participant App as main.dart
participant AAS as ArrrActivationService
participant CR as CoinsRepo
participant MM2 as MM2
App->>AAS: Construct(komodoDefiSdk, mm2)
App->>CR: Construct(kdfSdk, mm2, tradingStatusService, arrrActivationService)
note over CR,AAS: Services wired with MM2-enabled config/activation paths
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Visit the preview URL for this PR (updated for commit 77ac0c7): https://walletrc--pull-3184-merge-wj9jebhp.web.app (expires Thu, 23 Oct 2025 15:36:31 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where ARRR (and other ZHTLC coins) would not reappear in the coins list after being deactivated and reactivated. Additionally, it improves the ZHTLC configuration dialog by organizing advanced settings into a collapsible section and adds a configuration button to the coin details page.
- Fixed ZHTLC coin reappearing issue by checking for already-activated assets during activation
- Improved ZHTLC configuration dialog with collapsible advanced settings section
- Added ZHTLC configuration button to coin details page for easier access to sync settings
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk | Updated subproject commit |
| lib/views/wallet/wallet_page/common/zhtlc/zhtlc_configuration_dialog.dart | Reorganized UI to move advanced settings into collapsible section |
| lib/views/wallet/wallet_page/common/zhtlc/zhtlc_activation_status_bar.dart | Enhanced error display and increased error status duration |
| lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart | Added ZHTLC configuration button to coin details page |
| lib/services/arrr_activation/arrr_activation_service.dart | Added updateZhtlcConfig method for modifying configurations |
| lib/main.dart | Updated ArrrActivationService constructor to include MM2 dependency |
| lib/bloc/coins_bloc/coins_repo.dart | Fixed core bug by checking for already-activated assets during activation |
| assets/translations/en.json | Added new translation keys for advanced configuration UI |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lib/views/wallet/wallet_page/common/zhtlc/zhtlc_configuration_dialog.dart
Show resolved
Hide resolved
lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart
Outdated
Show resolved
Hide resolved
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
lib/generated/codegen_loader.g.dartis excluded by!**/generated/**
📒 Files selected for processing (9)
.gitignore(1 hunks)assets/translations/en.json(1 hunks)lib/bloc/coins_bloc/coins_repo.dart(1 hunks)lib/main.dart(1 hunks)lib/services/arrr_activation/arrr_activation_service.dart(2 hunks)lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart(4 hunks)lib/views/wallet/wallet_page/common/zhtlc/zhtlc_activation_status_bar.dart(4 hunks)lib/views/wallet/wallet_page/common/zhtlc/zhtlc_configuration_dialog.dart(4 hunks)sdk(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-01T15:51:37.060Z
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Applied to files:
lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dartlib/views/wallet/wallet_page/common/zhtlc/zhtlc_activation_status_bar.dart
🪛 GitHub Actions: takenagain is validating code guidelines 🚀
lib/main.dart
[error] 1-1: Target of URI doesn't exist: 'package:komodo_defi_framework_example/services/secure_storage_service.dart'.
sdk
[error] 9-9: Missing concrete implementations of 'abstract class IBinanceProvider.fetch24hrTicker', 'abstract class IBinanceProvider.fetchExchangeInfo', 'abstract class IBinanceProvider.fetchExchangeInfoReduced', and 'abstract class IBinanceProvider.fetchKlines'.
[error] 6-6: Target of URI doesn't exist: 'package:kdf_sdk_example/main.dart'.
[error] 4-4: Target of URI doesn't exist: 'package:mocktail/mocktail.dart'.
[error] 12-12: Missing concrete implementations of 'abstract class ApiClient.executeRpc'.
[warning] 1-1: include_file_not_found: The include file 'package:very_good_analysis/analysis_options.yaml' can't be found.
[error] 1-1: Target of URI doesn't exist: 'package:kdf_sdk_example/widgets/assets/asset_item.dart'.
[error] 1-1: Target of URI doesn't exist: 'package:komodo_defi_framework_example/services/secure_storage_service.dart'.
[error] 2-2: Target of URI doesn't exist: 'package:komodo_symbol_converter/komodo_symbol_converter.dart'.
[error] 14-14: The function 'registerFallbackValue' isn't defined.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build Desktop (windows)
- GitHub Check: Build Mobile (Android)
lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart
Show resolved
Hide resolved
smk762
left a comment
There was a problem hiding this comment.
Confirmed ARRR appears in the portfolio list after activation cycling (via both the disable button in coin page, and toggle in activation list).
LGTM, thanks!
lib/views/wallet/coin_details/coin_details_info/coin_details_common_buttons.dart
Show resolved
Hide resolved
CharlVS
left a comment
There was a problem hiding this comment.
Great work! Thank you for fixing it swiftly, @takenagain.
In the future, let's revisit what changes/shortfalls need addressing in KW/SDK so that KW doesn't need to manually call activation/deactivation RPCs.
mismatch of assumptions: activateArrr returns an activation error result rather than throwing an exception, so it has to be rethrown in the error handler for it to bubble up. there is also a mismatch between single and multiple activations, but that is fine for now since single activations are all that are present
Fixes the issue reported of ARRR not reappearing in the coins list if deactivated and reactivated using the "Add assets" toggle.
Minor ZHTLC improvements:
Unfortunately, cancelling an in-progress activation is more involved and would be best left as a follow-up enhancement in the next release. Already tracked in #3178
Steps to reproduce the bug on walletrc.web.app
Summary by CodeRabbit
New Features
Improvements
Chores
Note
Adds a ZHTLC config button with advanced settings, handles already-activated assets, improves activation status/error handling, and updates i18n/initialization.
lib/bloc/coins_bloc/coins_repo.dart).ArrrActivationServicenow constructed withMM2; addsupdateZhtlcConfigto disable coin viadisable_coinand save new config (lib/services/arrr_activation/arrr_activation_service.dart,lib/main.dart).ZhtlcConfigButtonto edit sync config for ZHTLC coins; integrates dialog, updates config, and reactivates coin (lib/views/wallet/coin_details/.../coin_details_common_buttons.dart).lib/views/wallet/wallet_page/common/zhtlc/zhtlc_configuration_dialog.dart).ErrorDisplay(lib/views/wallet/wallet_page/common/zhtlc/zhtlc_activation_status_bar.dart).assets/translations/en.json,lib/generated/codegen_loader.g.dart).Written by Cursor Bugbot for commit 6a15cb8. This will update automatically on new commits. Configure here.