Skip to content

Fix recipient amounts being cleared on locale changes - #1476

Merged
julian-CStack merged 4 commits into
stagingfrom
fix/recipient-locale-change
Nov 2, 2026
Merged

julian-CStack merged 4 commits into
stagingfrom
fix/recipient-locale-change

Conversation

@danrmiller

@danrmiller danrmiller commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Happens on both mobile and desktop:

  1. Enter a Monero amount such as 1.000000000001.
  2. Change from a period-decimal locale to a comma-decimal locale.
  3. The screen correctly shows 1,000000000001, but the stored amount becomes empty.

Why: changing the displayed text immediately triggers validation. The old parsing code

void _updateRecipientData({String? label, bool replaceLabel = false}) {
final address = addressController.text;
final amount = ref
.read(pAmountFormatter(widget.coin))
.tryParseEditable(amountController.text);
final previous = ref.read(pRecipient(_id));
ref.read(pRecipient(_id).notifier).state = (
can still expect a period, so it rejects the newly formatted amount.

Instead parse using the current locale directly (stack_wallet/lib/pages/send_view/frost_ms/recipient.dart:94), rather than the formatter’s temporarily outdated locale.

The regression tests: mobile and desktop tests (stack_wallet/test/pages/send_view/frost_ms/recipient_test.dart:276) check that:

  • Changing locale preserves the actual amount and recipient name.
  • Editing with commas works.
  • Switching back to periods preserves the amount.
  • Subsequent address edits don’t lose the amount.

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.98246% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.59%. Comparing base (ad1efd5) to head (6fb054b).
⚠️ Report is 6 commits behind head on staging.

Files with missing lines Patch % Lines
...gs_views/global_settings_view/hidden_settings.dart 0.00% 6 Missing ⚠️
...nsaction_views/transaction_search_filter_view.dart 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1476      +/-   ##
===========================================
+ Coverage    10.74%   11.59%   +0.84%     
===========================================
  Files         1132     1133       +1     
  Lines       113993   114059      +66     
===========================================
+ Hits         12254    13223     +969     
+ Misses      101739   100836     -903     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@julian-CStack
julian-CStack force-pushed the fix/recipient-locale-change branch from 48bb6e4 to 3b05ff9 Compare October 26, 2026 19:02
@julian-CStack
julian-CStack merged commit a5b7074 into staging Nov 2, 2026
2 checks passed
@julian-CStack
julian-CStack deleted the fix/recipient-locale-change branch November 2, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants