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.
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>
| } | ||
| 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 |
Improve login performance by caching wallet state on a per account level in unencrypted JSON file and rehydrate before wallets load.
1e3aa7d to
3e6460c
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 login/account lifecycle and wallet/config object behavior, including async delegation and disk persistence; mistakes could cause stale UI state, extra disk writes, or login regressions despite strong test coverage.
Overview
Adds a cache-first login path that saves wallet/config state to
accountCache/<storageWalletId>/walletCache.jsonand, on subsequent logins, restores lightweightEdgeCurrencyWallet/EdgeCurrencyConfigobjects so the app can render wallets before currency engines finish loading.Introduces new cache modules (
cache-wallet-saver,cache-wallet-loader, cached wallet/config wrappers, shared poller + otherMethods/disklet delegation) and wires them intoaccount-pixie(load cache early, background file loading, throttled reactive auto-save) andaccount-api(merge cached + real wallets/IDs untilkeysLoaded). Adds extensive end-to-end tests plus fake plugin controls to deterministically gate engine creation and validate delegation/yaob update propagation; also improves swap quote cleanup logging and exportsasEdgeTokenfor cache validation.Written by Cursor Bugbot for commit 3e6460c. This will update automatically on new commits. Configure here.