Fix address search to match address or label case-insensitively (#3837)
What changed, and why it matters
This commit fixes a user-interface bug in the wallet's address search. Previously, searching for an address sometimes returned no results if the address contained uppercase letters (common for Zcash, Ethereum, Solana, Tron) because the search was comparing a lowercased query against the original mixed-case address. The fix makes the comparison case-insensitive and also allows searching by address even when the address has a label. There is no security vulnerability here—just a usability fix.
No security action required. Treat as a normal bug-fix/UX improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change in addresses_page.dart rewrites the filter logic for the Receive > Addresses search. It now lowercases both the query and the candidate address/label before comparison, and it ORs address and label matches rather than only checking the address when the label is empty. The second file (buy_sell_view_model.dart) only restores a missing import for print_verbose, unrelated to the search behavior. No cryptographic, authentication, authorization, or input-validation changes are present.
Changed components
lib/new-ui/pages/addresses_page.dartlib/view_model/buy/buy_sell_view_model.dartInspect captured patch +5 / −5
### lib/new-ui/pages/addresses_page.dart
@@ -113,13 +113,12 @@ class _NewAddressesPageState extends State<NewAddressesPage> {
@override
Widget build(BuildContext context) {
+ final query = _searchController.text.trim().toLowerCase();
final filteredItems = items.where((item) {
if (item is! WalletAddressListItem) return false;
- if (_searchController.text.isEmpty) return true;
- if (item.name == null || item.name!.isEmpty) {
- return (item.address.contains(_searchController.text.toLowerCase()));
- }
- return (item.name ?? '').toLowerCase().contains(_searchController.text.toLowerCase());
+ if (query.isEmpty) return true;
+ return item.address.toLowerCase().contains(query) ||
+ (item.name ?? '').toLowerCase().contains(query);
}).toList();
return Container(
### lib/view_model/buy/buy_sell_view_model.dart
@@ -20,6 +20,7 @@ import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
import 'package:cw_core/amount/money.dart';
import 'package:cw_core/crypto_amount_format.dart';
import 'package:cw_core/crypto_currency.dart';
+import 'package:cw_core/utils/print_verbose.dart';
import 'package:flutter/cupertino.dart';
import 'package:mobx/mobx.dart';
Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.