fix: reset the address validity when clearing the send form
What changed, and why it matters
This commit fixes a UI state bug in Stack Wallet's send form. When a user clears the send form, the wallet now also resets whether the entered address is considered valid. Without this fix, the form could incorrectly keep showing an old address as valid after the user cleared it, which might confuse someone into thinking a new or empty address is ready to send to.
Review whether any other send-form state providers (e.g., fee, amount, memo/OP_RETURN) are also left stale on clear, and add regression tests for the clear-form action. Consider adding a single reset method that synchronizes all related providers.
Security signals we found
Stale UI state after form reset
Address validity not synchronized with address field reset
Potential UI confusion leading to incorrect send confirmation
Defensive state reset in user-facing financial transaction flow
Evidence from the diff
Two send form widgets (SendView and DesktopSend) call _setValidAddressProviders("") inside their clear-form methods. This resets the provider-backed address validity state to an empty/invalid value when the form is reset. Previously, clearing the address string and related flags did not reset the validity state, leaving stale valid/invalid status in the UI and possibly enabling downstream logic to proceed based on stale validation.
Changed components
lib/pages/send_view/send_view.dartlib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dartInspect captured patch +2 / −0
### lib/pages/send_view/send_view.dart
@@ -1218,6 +1218,7 @@ class _SendViewState extends ConsumerState<SendView> {
_address = "";
_addressToggleFlag = false;
_setOpReturnData(null);
+ _setValidAddressProviders("");
setState(() {});
}
### lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart
@@ -871,6 +871,7 @@ class _DesktopSendState extends ConsumerState<DesktopSend> {
_addressToggleFlag = false;
_syncFeeAmount(null);
_setOpReturnData(null);
+ _setValidAddressProviders("");
setState(() {});
}
Why this scored 34/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.