Skip to content

Conversation

@samholmes
Copy link
Contributor

@samholmes samholmes commented Nov 28, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Note

Improves login startup and simplifies settings/state handling.

  • Load syncedSettings and localSettings in parallel, then dispatch a single LOGIN with both; remove ACCOUNT_INIT_COMPLETE usage across reducers
  • Add one-time migrateDenominationSettings to strip default denoms and set denominationSettingsOptimized flag
  • Update reducers to read from LOGIN payload: settings scene state, SpendingLimitsReducer, and PasswordReminderReducer; adjust tests/snapshots accordingly
  • Refactor SettingsScene: manage biometrics and PIN locally (via edge-login-ui-rn + react-query), remove Redux touch/pin toggles; improve error handling
  • LoginActions: restructure navigation (new/existing account), keep notification/survey flows; stop writing defaults when settings files are missing
  • Cleanup: more explicit typing, safer JSON parsing, remove some scam-warning prompts, small UI scene typings; add QueryClient to FakeProviders
  • Minor fixes: review trigger migration robustness, Wallet list/menus error handling

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


@samholmes samholmes force-pushed the sam/optimize-initializeAccount branch from 5956aee to 5d92708 Compare December 2, 2025 00:09
@samholmes samholmes force-pushed the sam/optimize-initializeAccount branch from 5d92708 to e6e97a1 Compare December 5, 2025 23:19
Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

Found two small glitches, and one question.

@samholmes samholmes force-pushed the sam/optimize-initializeAccount branch from b2cec9d to c00ed98 Compare December 22, 2025 23:25
The showScamWarningModal function was already disabled (always returns
false), making these calls unnecessary async overhead during login and
other operations.

Removes calls from:
- initializeAccount (firstLogin)
- WcConnectionsScene (firstWalletConnect)
- WalletListMenuActions (firstPrivateKeyView)
When Settings.json doesn't exist (new account or first login), return
default values without writing them to disk. Defaults are derived from
cleaners, so they don't need to be persisted. Settings will be written
when the user explicitly changes a value.

This eliminates unnecessary disk I/O during the login flow.
When local Settings.json doesn't exist (new account), return default
values without writing them to disk. Defaults are derived from cleaners,
so they don't need to be persisted. Settings will be written when values
actually change.

This eliminates unnecessary disk I/O during the login flow.
Move biometric checks (isTouchEnabled, getSupportedBiometryType) from
blocking awaits to background Promise execution. This removes two
blocking native module calls from the critical login path.

The biometric state is loaded asynchronously and dispatched via a new
UI/SETTINGS/SET_TOUCH_ID_SUPPORT action when available. The UI will
use default values (false) until the background check completes.

Also removes the redundant refreshTouchId call - this is already called
by edge-login-ui-rn in submitLogin() before the onLogin callback, so
the call here was unnecessary.
@samholmes samholmes force-pushed the sam/optimize-initializeAccount branch from c00ed98 to 608a2b5 Compare December 22, 2025 23:45
@samholmes samholmes enabled auto-merge December 22, 2025 23:47
@samholmes samholmes disabled auto-merge December 22, 2025 23:52
@samholmes samholmes force-pushed the sam/optimize-initializeAccount branch from 608a2b5 to 6f9ada5 Compare December 22, 2025 23:56
@samholmes samholmes enabled auto-merge December 22, 2025 23:56

for (const pluginId of Object.keys(denominationSettings)) {
const currencyConfig = account.currencyConfig[pluginId]
if (currencyConfig == null) continue
Copy link

Choose a reason for hiding this comment

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

Migration loses settings for temporarily unavailable plugins

The migrateDenominationSettings function skips any plugin where account.currencyConfig[pluginId] is null (line 580), but then writes cleanedSettings which only contains the processed plugins (line 630). If a user has custom denomination settings for a plugin that happens to be temporarily unavailable during the one-time migration (e.g., due to a plugin update, network issue, or disabled plugin), those settings are permanently lost because they're not preserved in cleanedSettings. The settings for unavailable plugins need to be copied to cleanedSettings before they're skipped.

Additional Locations (1)

Fix in Cursor Fix in Web

Remove isTouchEnabled and isTouchSupported from global Redux state.
Biometric state is now loaded lazily in SettingsScene using useAsyncValue,
which removes it from the login critical path.

- Remove biometric fields from SettingsState and AccountInitPayload
- Remove CHANGE_TOUCH_ID_SETTINGS action type
- Remove updateTouchIdEnabled thunk from SettingsActions
- SettingsScene loads biometric state locally on mount via useAsyncValue
- Toggle calls enableTouchId/disableTouchId directly with local state
Add a migration that removes default denomination values from the synced
settings file. This migration:

1. Runs once per account (tracked via denominationSettingsOptimized flag)
2. Compares each saved denomination to the default from currencyInfo
3. Removes entries that match the default (they're derived on-demand)
4. Reduces settings file size for existing accounts

The migration runs in the background after ACCOUNT_INIT_COMPLETE to
avoid blocking the login flow. For existing accounts with many saved
denominations, this significantly reduces the settings file size.
Remove the expensive nested loop that merged default denomination
settings with synced settings. Since default denominations are no longer
populated in the LOGIN reducer, we can use synced settings directly.

The synced settings contain only user customizations. Default
denominations are derived on-demand from currencyInfo via selectors.
Remove the expensive loop that populated denomination defaults for all
currency plugins and tokens during LOGIN. This loop iterated through
every plugin and token to set default denominations in Redux state.

Denomination defaults are already available from currencyInfo and can be
derived on-demand via selectors (selectDisplayDenom already has fallback
logic to currencyConfig). This change eliminates unnecessary work during
the login critical path.
Separate out the new account workflow to `navigateToNewAccountFlow`
in initializeAccount and the existing account flow into
`navigateToExistingAccountHome`.
Eliminate the ACCOUNT_INIT_COMPLETE action by loading all settings upfront
and dispatching them in the LOGIN action. This enables immediate navigation
after login since all required state is available in Redux right away.

- Load synced and local settings in parallel before LOGIN dispatch
- Expand LOGIN action payload to include syncedSettings and localSettings
- Remove ACCOUNT_INIT_COMPLETE action type and AccountInitPayload
- Remove pinLoginEnabled from Redux, load locally in SettingsScene
- Remove togglePinLoginEnabled thunk from SettingsActions
- Update WalletsReducer to remove ACCOUNT_INIT_COMPLETE handling
- Update SpendingLimitsReducer to read from LOGIN payload
- Update PasswordReminderReducer to read from LOGIN payload
- Remove getFirstActiveWalletInfo (walletId/currencyCode no longer set at login)
@samholmes samholmes force-pushed the sam/optimize-initializeAccount branch from 6f9ada5 to ef36815 Compare December 23, 2025 01:07
@samholmes samholmes merged commit 46139f7 into develop Dec 23, 2025
4 checks passed
@samholmes samholmes deleted the sam/optimize-initializeAccount branch December 23, 2025 01:18
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.

3 participants