Conversation
8b8cd1a to
53a3312
Compare
This comment has been minimized.
This comment has been minimized.
53a3312 to
520c5ad
Compare
| result[walletId] = wallet | ||
| } | ||
| } | ||
| return result |
There was a problem hiding this comment.
Getter always allocates new object reducing bridge efficiency
Low Severity
When cacheSetup is non-null (for the lifetime of the account after a cache-first login), the currencyWallets getter always allocates a new result object on every access. The watcher pixie calls update(accountApi) on every Redux state change, causing yaob to re-read this getter, see a new object reference, and push the full wallet map over the bridge—even when the underlying wallet set hasn't changed. Previously the getter returned a stable reference from the pixie output.
This comment has been minimized.
This comment has been minimized.
520c5ad to
2bfc435
Compare
Add missing return in fake plugin getBalance for token balance. Improve @ts-expect-error comment and log swap quote close errors. Co-authored-by: Cursor <cursoragent@cursor.com>
Improve login performance by caching wallet state on a per account level in unencrypted JSON file and rehydrate before wallets load.
fixup! Cache and restore wallets Co-authored-by: Cursor <cursoragent@cursor.com>
fixup! Cache and restore wallets
Review feedback:
- W2: Add account existence check in background .catch handler
- W3: Add comment about coupling to disklet error format
- W4: Pass error directly to log instead of String(error)
- S1: Use asJSON instead of JSON.parse for better error context
- S4: Fix misleading retry comment in cache saver
- S5: Add comments explaining .catch(() => {}) in scheduleSave
- S6: Increase poll interval from 300ms to 500ms
- S7: Remove outdated JSDoc clause about GUI waiting
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Bugbot Autofix prepared fixes for 1 of the 1 bugs found in the latest run.
Or push these changes by commenting: Preview (cfdb37f5a6)diff --git a/src/core/account/account-pixie.ts b/src/core/account/account-pixie.ts
--- a/src/core/account/account-pixie.ts
+++ b/src/core/account/account-pixie.ts
@@ -362,8 +362,10 @@
if (cacheSaver == null) return
- // Trigger initial save to persist cached wallet data from login
- if (!initialSaveDone) {
+ // Trigger initial save to persist cached wallet data from login.
+ // Wait until keysLoaded is true to ensure builtinTokens are populated,
+ // avoiding overwriting cached tokens with empty data during cache-first login.
+ if (!initialSaveDone && accountState.keysLoaded) {
initialSaveDone = true
cacheSaver.markDirty()
return |
83eab7a to
28424f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Improve login performance by caching wallet state on a per account level in unencrypted JSON file and rehydrate before wallets load.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
noneNote
Medium Risk
Touches the login/account startup path and changes what
EdgeAccount.currencyWalletsreturns before keys/engines load, which could cause subtle UI or lifecycle regressions if cache data is stale or delegation/update behavior is wrong.Overview
Implements cache-first login by loading
accountCache/<storageWalletId>/walletCache.jsonduringaccountPixiestartup and immediately exposing cachedEdgeCurrencyWalletobjects (with background loading of the normal files/engines when cache is present).Adds a new cache subsystem (
cache-wallet-loader/cached-currency-wallet/cached-currency-config/cleaners/utils) that validates cached JSON, constructs delegating wallet/config objects that fall back to real engines when available, supports delegatingotherMethodsand wallet disklets, and ensures yaob propagation by callingupdate(wallet)in key setters.Introduces an auto-saving, throttled cache writer (
makeWalletCacheSaver) wired intoaccountPixieto persist active wallet state (balances, enabled tokens, public info, selected token definitions, andotherMethodsnames) with failure backoff;makeAccountApinow optionally merges cached wallets/IDs until keys are loaded. Includes extensive end-to-end tests plus fake-plugin hooks to deterministically gate engine startup and simulate missingotherMethods, and adds documentation for the architecture.Written by Cursor Bugbot for commit 28424f6. This will update automatically on new commits. Configure here.