Suppress false insufficient-balance errors while syncing#203
Suppress false insufficient-balance errors while syncing#203piatoss3612 wants to merge 7 commits into
Conversation
82fbb8f to
b04acad
Compare
fb2c7ab to
37e8870
Compare
9917514 to
0ebb26a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ebb26ac1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
0ebb26a to
f2b694a
Compare
f2b694a to
1db4a88
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1db4a88083
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a308c6be6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7379523e27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2064d5300b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Replace the fabricated "InsufficientFunds" unit-test input with the real zcash_client_backend 0.23.0 Display string, and add classifier_matches_real_ librustzcash_display: a canary that constructs the actual Error::InsufficientFunds / Error::ScanRequired variants and runs their Display through send_build_error_code, so a future crate bump that renames those strings breaks CI instead of silently reintroducing the VZR-42 false "insufficient" symptom. Also pin the send-max "Insufficient shielded balance to cover fee" custom string, guard the Dart classifySendFailure AnyhowException(.message) branch (the real FRB runtime type), and document the Display/custom-string coupling on send_build_error_code. VZR-42 review follow-up.
Problem
While the wallet is still scanning, the local spendable balance can be transiently lower than the eventual spendable balance. Send and ZEC swap paths treated those mid-sync shortfalls as final insufficient-funds errors, which could block Review or surface misleading balance copy even though retrying after sync would succeed.
Approach
Keep the fix small and avoid a separate readiness state:
sync_in_progress,scan_required, orinsufficient_funds.SendFailureKindparser for those coded Rust errors.SyncState.isSyncedToTipis a computed getter from the existing sync fields; it is used only to decide when a local spendable shortfall is final.Scope
This PR covers send and the ZEC-send side of swap. It does not change non-ZEC deposit flows or broaden generic swap failure handling.
Behavior
sync_in_progressuntil sync has stopped and the DB is synced to tip.Testing
Latest targeted validation after the desktop fee-estimate recheck:
fvm flutter test test/features/send/send_screen_test.dartfvm flutter analyzegit diff --checkTargeted validation after the mobile review recheck:
fvm flutter test test/features/send/mobile_send_screen_test.dart --tags mobile --run-skipped --dart-define=VIZOR_FORM_FACTOR=mobilefvm flutter analyzegit diff --checkValidation after rebasing onto
origin/main(f18df5ef):fvm flutter test test/features/send/mobile_send_screen_test.dart --tags mobile --run-skipped --dart-define=VIZOR_FORM_FACTOR=mobilefvm flutter test test/features/send/send_screen_test.dart test/features/send/send_failure_test.dart test/features/swap/swap_screen_test.dartfvm flutter test test/features/swap/mobile_swap_modal_route_test.dart --tags mobile --run-skipped --dart-define=VIZOR_FORM_FACTOR=mobilefvm flutter analyzecd rust && cargo test wallet::sync::send::testsgit diff --checkEarlier validation before the latest main rebase:
fvm flutter test→ 1388 passed / 47 skippedcd rust && cargo test --lib→ 179 passed / 1 ignored