Skip to content

Comments

Release: 7.0.3#4468

Merged
jorbuedo merged 11 commits intoproductionfrom
preview
Jan 29, 2026
Merged

Release: 7.0.3#4468
jorbuedo merged 11 commits intoproductionfrom
preview

Conversation

@jorbuedo
Copy link
Contributor

@jorbuedo jorbuedo commented Jan 29, 2026

Note

High Risk
High risk because it changes app startup/wallet loading and migration behavior, including automatic storage clearing/recovery paths that could affect persisted wallet metadata and user settings if triggered incorrectly.

Overview
Hardens startup + migrations against storage corruption/hangs. Adds validateStorageIntegrity/attemptStorageRecovery, introduces clearRecoverableStorage (preserve keystore/) and uses it from useMigrations with a 60s timeout + retries; runMigrations now returns failure results instead of throwing on version mismatch.

Improves wallet hydration/recovery behavior. WalletManagerHydrationWrapper adds a 30s timeout and continues rendering on failure; WalletManager.hydrate adds defensive error handling for storage reads. Introduces recoverOrphanedWallets to rebuild missing wallet metadata from keystore/ xpubs, with new unit tests.

Deep-link fixes for network + decimal amounts. Cardano link actions now optionally include network, link parsing detects mainnet vs preprod from address prefixes and normalizes numeric/decimal amounts, and useActionExecutor switches the selected network before executing link actions (with updated tests and Android link test script).

Written by Cursor Bugbot for commit 44c5af5. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

'network' in cardanoAction ? cardanoAction.network : undefined
if (actionNetwork && actionNetwork !== currentNetwork) {
walletManager.setSelectedNetwork(actionNetwork)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Network switch race condition in action executor

High Severity

The network switching logic calls walletManager.setSelectedNetwork(actionNetwork) but doesn't await its completion before processing the action. The setSelectedNetwork method is asynchronous internally (it calls hydrateFn().then(...) and returns void), meaning the switch (cardanoAction.action) block executes immediately while the network switch is still in progress. Actions like send-single-pt, send-only-receiver, and pay-request may be processed against the wrong network, potentially causing transaction preparation issues when scanning a testnet QR code while on mainnet (or vice versa).

Fix in Cursor Fix in Web

})
// App will behave as fresh install anyway since storage is cleared
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exported function clearAllStorage is never used

Low Severity

The clearAllStorage function is exported but never imported or called anywhere in the codebase. Only clearRecoverableStorage is actually used (by useMigrations.ts). This is dead code that adds maintenance burden without providing any functionality.

Fix in Cursor Fix in Web

f.error.message.includes('MMKV') ||
f.error.message.includes('storage') ||
f.error.message.includes('getAllKeys') ||
f.error.message.includes('multiGet'),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated critical error detection pattern

Low Severity

The same critical error detection logic checking for 'corrupt', 'MMKV', 'storage', 'getAllKeys', 'multiGet' patterns appears twice in useMigrations. Once for checking migration result failures (lines 112-118) and again for caught exceptions (lines 149-154). This duplication increases maintenance burden and risk of inconsistent updates.

Additional Locations (1)

Fix in Cursor Fix in Web

)
}
}, [walletManager])
}, [hydrationError])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant logging effect for hydrationError state

Low Severity

The hydrationError state triggers a second useEffect that logs a warning, but this is redundant since errors are already logged at the point they occur (lines 39-43 for timeout, lines 58-60 for failures). The state is never exposed to consumers or used for conditional rendering, making both the state and the logging effect unnecessary complexity.

Fix in Cursor Fix in Web

@jorbuedo jorbuedo merged commit c59a3fc into production Jan 29, 2026
3 of 4 checks passed
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