Conversation
8b8cd1a to
53a3312
Compare
This comment has been minimized.
This comment has been minimized.
53a3312 to
520c5ad
Compare
This comment has been minimized.
This comment has been minimized.
520c5ad to
2bfc435
Compare
This comment has been minimized.
This comment has been minimized.
db35d1c to
38a0e8c
Compare
This comment has been minimized.
This comment has been minimized.
38a0e8c to
45f5446
Compare
This comment has been minimized.
This comment has been minimized.
294dc9f to
e82fdcd
Compare
This comment has been minimized.
This comment has been minimized.
| } | ||
| const errorWithCode = error as Error & { code?: string } | ||
| return errorWithCode.code === 'ENOENT' | ||
| } |
There was a problem hiding this comment.
File-not-found detection is too fragile
Low Severity
isFileNotFoundError depends on exact, case-sensitive Error.message prefixes ('Cannot load', 'Cannot read file') to detect missing cache files. If disklet changes wording/casing or platform-specific messages differ, first-login “missing cache” can be misclassified as unexpected and logged as a warning.
36fa958 to
ac72065
Compare
This comment has been minimized.
This comment has been minimized.
| get userSettings(): object | undefined { | ||
| const realConfig = tryGetRealConfig() | ||
| return realConfig != null ? realConfig.userSettings : {} | ||
| }, |
There was a problem hiding this comment.
Cached config returns empty userSettings
Medium Severity
The cached EdgeCurrencyConfig.userSettings getter returns {} when the real config is unavailable, even though the type is object | undefined. This changes semantics for callers that distinguish “no settings yet” (undefined) from “settings exist” (object), and can cause cache-mode behavior to diverge from real-config behavior.
| // Data store: | ||
| get created(): Date | undefined { | ||
| return createdDate | ||
| }, |
There was a problem hiding this comment.
Cached wallet created date may be invalid
Low Severity
makeCachedCurrencyWallet converts cacheData.created to createdDate = new Date(createdString) and always returns it from created. If the cache has an invalid or non-ISO created string, created becomes an “Invalid Date” object instead of undefined, which can break consumers that assume a valid Date.
|
Bugbot Autofix prepared fixes for 2 of the 2 bugs found in the latest run.
Or push these changes by commenting: Preview (e6e1588d29)diff --git a/src/core/cache/cached-currency-config.ts b/src/core/cache/cached-currency-config.ts
--- a/src/core/cache/cached-currency-config.ts
+++ b/src/core/cache/cached-currency-config.ts
@@ -141,7 +141,7 @@
// User settings (delegate when available, write delegates):
get userSettings(): object | undefined {
const realConfig = tryGetRealConfig()
- return realConfig != null ? realConfig.userSettings : {}
+ return realConfig != null ? realConfig.userSettings : undefined
},
async changeUserSettings(settings: object): Promise<void> {
diff --git a/src/core/cache/cached-currency-wallet.ts b/src/core/cache/cached-currency-wallet.ts
--- a/src/core/cache/cached-currency-wallet.ts
+++ b/src/core/cache/cached-currency-wallet.ts
@@ -155,7 +155,8 @@
} = cacheData
const shortId = walletId.slice(0, WALLET_ID_DISPLAY_LENGTH)
- const createdDate = new Date(createdString)
+ const parsedDate = new Date(createdString)
+ const createdDate = isNaN(parsedDate.getTime()) ? undefined : parsedDate
// Track mutable state locally. When the GUI calls a setter, we update
// the local value immediately and call update(wallet) to push it |
|
/rebase |
1e3aa7d to
3e6460c
Compare
| result[walletId] = wallet | ||
| } | ||
| } | ||
| return result |
There was a problem hiding this comment.
Because YAOB diffs objects shallowly (===), this needs to be referrentially stable. So you need to store the object somewhere and replace it each time something inside changes. Otherwise we'll either get superfluous updates or missing updates (either would be bad).
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.
3e6460c to
049daf9
Compare



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 core login/account wallet plumbing and introduces new persistence/rehydration behavior, which could affect wallet lists or startup edge-cases if the cache becomes stale or invalid.
Overview
Adds a cache-first login path that restores lightweight
EdgeCurrencyWallet/EdgeCurrencyConfigobjects fromaccountCache/<storageWalletId>/walletCache.jsonso the UI can show wallets immediately while real engines load in the background.Implements a new wallet-cache subsystem (schema cleaners, loader, cached delegating wallet/config with shared poller, delegating
otherMethodsand disklets) plus a throttled, dirty-triggered saver wired intoaccount-pixieto keep the cache updated;makeAccountApinow merges cached and real wallets/IDs until keys/wallets are fully loaded. Also tightens swap-quote cleanup logging, exportsasEdgeTokenfor reuse, and adds extensive end-to-end tests (with a gated fake engine) covering cache save/load, delegation, yaob propagation, and disklet behavior.Written by Cursor Bugbot for commit 049daf9. This will update automatically on new commits. Configure here.