android: do not paint a connect refusal while the wallet is connecting #154
Loading…
Reference in a new issue
No description provided.
Delete branch "onionwire/t_1b021834-onionwire-android-do-not-paint-a-wallet"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Android half of the wallet-startup stabilization (plan Task 5 + Task 6). The Rust half (card t_… for
src/) stops storing an unreachable probe aslast_errorin the first place; this change is deliberate defense in depth at the display seam plus the missing reload.What changed
displayLastError(state, raw)inWalletManagerScreen.kt, next towalletFailureText. It returnsnullfor alastErrorstarting withwallet connect:/wallet write:whilestateisconnecting(case/whitespace insensitive, mirroring the core'serror_is_unreachableverbatim — a bareConnection refusedis not matched). In every other state the same string is shown: pastconnectingit means the child accepted a connection and then died, which is exactly what the user needs to see.WalletScreen.kt'sWalletChildStatus.toInput()now wraps the field aslastError = displayLastError(state, lastError)instead ofwalletFailureText(lastError). That is the single seam bothwalletChildLineand the red failure card read, so there is no second filter.walletFailureTextstays as it was and is still applied insidedisplayLastError, so-13/No wallet file/ raw JSON still becomeWALLET_NOT_OPEN_TEXT; only the transient connect refusal is suppressed.shouldReloadWalletReads(state)inWalletScreen.kt(syncing/readyonly, trimmed + case-insensitive) plusLaunchedEffect(childInput?.state) { if (shouldReloadWalletReads(childInput?.state)) reload() }. The existingLaunchedEffect(Unit) { reload(); vm.refreshChainSource() }is untouched. Not reloaded whileconnecting:walletBalance()returns the string"err"rather than throwing, and that call is what pinned the headline tobalance —.Tests (JVM, locally —
android-ci.ymldoes not run Kotlin unit tests)cd android && ./gradlew :app:testDebugUnitTest --tests '*WalletManagerTest*' --tests '*WalletChildStatusTextTest*'WalletManagerTest: 50 tests, 0 failures, 0 errors, 0 skippedWalletChildStatusTextTest: 47 tests, 0 failures, 0 errors, 0 skipped:app:testDebugUnitTest: 213 tests, 0 failures, 0 errors, 0 skippedNew tests, all passing:
connecting_connect_refusal_is_not_shown,a_connect_refusal_after_connecting_is_still_shown,display_last_error_still_rewrites_no_wallet_file,wallet_reads_reload_only_once_the_child_is_answering. The existingwalletFailureTexttests (the_daemons_no_wallet_file_never_reaches_the_screen,filtering_the_sdk_record_twice_changes_nothing, …) still pass unchanged.Not done
No release, no tag, no dispatch of
release.yml/android-release.yml. Mainnet Cuprate is still unvalidated and chain P2P stays clearnet. No emulator/device run of the wallet screen was performed — this host cannot exercise a real Cuprate launch, so the acceptance in the plan's Task 5/6 is covered by the pure-function tests only.