Conversation
|
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 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Visit the preview URL for this PR (updated for commit 84a016e): https://walletrc--pull-2750-merge-24g546se.web.app (expires Fri, 18 Jul 2025 14:54:41 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
|
I've hit a possible edge case with this one. Not sure yet if easily reproducible or if pre-requisite steps are relevant but here is goes anyway:
No logs were identified which held any information that appeared to be related to this. Upon logging out and then back in again, all the previously selected coins which were hanging out with the cat of Dr Schrödinger appeared without problem. After disabling half of them, I logged out/in again, and the selection was preserved. Attempting again to replicate the problem, I disabled MATIC but left 1INCH-PLG20 active. After L.I/O again, this was preserved - MATIC not in portfolio, but 1INCH-PLG20 was. This is an unnatural state, as I dont understand how it was actually activated when running the token activation methods without parent coin active will return {
"mmrpc": "2.0",
"error": "Platform coin MATIC is not activated",
"error_path": "token.lp_coins",
"error_trace": "token:136] lp_coins:5032]",
"error_type": "PlatformCoinIsNotActivated",
"error_data": "MATIC",
"id": null
}This time around, I was able to activate and deactivate coins as expected, though MATIC ended up tl;dr, this works in perfect conditions, but the edge cases as close as walking the plank. Please recheck the parent/token logics. In legacy desktop, attempts to disable a parent would prompt a pop up to appear threatening to kill its children too unless the parent remains abled. |
…n-edge-case fix: disable parent coin removes tokens
…into codex/fix-reactivation-of-disabled-default-coins
|
I've confirmed that attempting to disable parent shows pop up listing the child tokens which will also be disabled. Next test was to check the case where an attempt is made to disable a token while active swap is in progress, or order is open, then do the same again for a parent coin while a child was in the middle of a swap. I was unable to progress this far, as the following error presented. I subsequently confirmed that MATIC is indeed active, and its wallet page shows balance / addresses / history as expected from an active coin. Attempting a BEP20 token swap led to the same outcome. For reference, if not yet implemented (or towards a separate issue), this should be the flow when disabling during swap:
|
- move confirmation popups to utils.dart for now - use coins_repo to disable coin in coins_bloc - flush coins before disabling - fix syncing loop yielding unnecessary state updates - exclude excluded coins from syncing steps - deactivate children before parent coin
- enabledType - defaultAddress - nonEmptyHdAddress - getDerivationPath - getHdAddress - reset
coins are automatically reactivated using SDK `.pubkeys` function, so there is no longer a need for a background reactivation task


This pull request introduces functionality to handle parent-child relationships between coins in the wallet. It ensures that disabling a parent coin also disables its associated child tokens and provides user confirmation dialogs for such actions. The changes span multiple files and address both the backend logic and the user interface.
Backend changes for handling parent-child coin relationships:
lib/bloc/coins_bloc/coins_bloc.dart: Refactored the logic for disabling coins to account for child tokens. A newcoinsToDisableset aggregates both parent coins and their child tokens before processing deactivation. [1] [2]lib/bloc/coins_bloc/coins_repo.dart: Updated the coin repository to disable child tokens when a parent coin is deactivated, ensuring proper cleanup of balance watchers and broadcasting the state change.User interface changes for confirmation dialogs:
lib/shared/utils/utils.dart: Added a newconfirmParentCoinDisableutility function that displays a confirmation dialog when disabling a parent coin, listing its child tokens.lib/views/wallet/coin_details/coin_details_info/coin_details_info.dart: Integrated the confirmation dialog into the "Disable Coin" button logic, ensuring user consent before disabling parent coins and their tokens.lib/views/wallet/wallet_page/common/expandable_coin_list_item.dart: Updated the "More Actions" menu to include the confirmation dialog when disabling coins from the expandable coin list.Miscellaneous changes:
assets/translations/en.json: Added a new localized string for the confirmation dialog message (parentCoinDisableWarning).lib/views/wallet/coins_manager/coins_manager_list_wrapper.dart: Incorporated the confirmation dialog into the coin manager's removal logic for parent coins. [1] [2]