Fix delayed connection status change
What changed, and why it matters
This commit changes how the wallet reacts when the user switches between server types (a local node versus a lightweight server). Instead of immediately rebuilding and resyncing the wallet in the foreground, the app now delegates that work to a dedicated method. The stated goal is to fix a delayed or stale connection-status display. The diff itself is a one-line refactor and does not contain any obvious security bug or fix for one.
Treat this as a routine functional refactor unless additional context shows the delayed status change had security consequences (for example, continuing to use a wrong server before resync). Reviewers may want to inspect the implementation of WalletManager.applyConnectionChange to confirm it still performs reopenWallet and syncInBackground correctly and does not introduce race conditions.
Security signals we found
No direct security-relevant change is visible in the diff.
The commit message and diff describe a UI/state timing fix, not a security fix.
No input validation, cryptography, authentication, or authorization logic is modified.
No references to CVEs, advisories, or security researchers are present in the supplied materials.
Evidence from the diff
In lib/wallet_core_glue.dart, applyConnectionChange() was updated so that, when useSharedWalletCore is true, it calls Provider.of
Changed components
lib/wallet_core_glue.dartWalletManager.applyConnectionChange (called but not shown in diff)Inspect captured patch +1 / −2
diff --git a/lib/wallet_core_glue.dart b/lib/wallet_core_glue.dart
index 3c82dbc..e36f64a 100644
--- a/lib/wallet_core_glue.dart
+++ b/lib/wallet_core_glue.dart
@@ -181,8 +181,7 @@ Future<void> deleteWallet(BuildContext context) async {
/// Rebuilds the wallet if the server kind (LWS↔node) changed, then resyncs.
void applyConnectionChange(BuildContext context) {
if (useSharedWalletCore) {
- final manager = Provider.of<WalletManager>(context, listen: false);
- unawaited(manager.reopenWallet('XMR').then((_) => manager.syncInBackground()));
+ unawaited(Provider.of<WalletManager>(context, listen: false).applyConnectionChange('XMR'));
} else {
Provider.of<WalletModel>(context, listen: false).applyConnectionChange();
}
Why this scored 24/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.