mirror of
https://github.com/hoornet/vega.git
synced 2026-04-24 06:40:01 -07:00
Root cause: switchAccount fetched the nsec from the OS keychain on every switch. Any keychain failure (timeout, Windows Credential Manager quirk, no entry yet) silently fell through to loginWithPubkey → read-only mode. Fix: cache each NDKPrivateKeySigner in-memory (_signerCache map) the moment loginWithNsec succeeds. switchAccount checks the cache first; the OS keychain is now only consulted at startup (restoreSession). Signers are pure crypto objects with no session state — safe to reuse indefinitely. Verified with a 9-switch stress test across 3 accounts (A1→A2→A3→A1→ A2→A1→A3→A2→A1): hasSigner=true and correct pubkey on every switch. Also adds dev tooling: - src/lib/tauri-dev-mock.ts: localStorage-backed keychain + SQLite stubs so the frontend can run in a plain browser for Playwright testing - src/main.tsx: import mock first in DEV mode (no-op in production) - test/gen-accounts.mjs: generates 3 deterministic test keypairs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
367 B
Plaintext
32 lines
367 B
Plaintext
# Logs
|
|
logs
|
|
*.log
|
|
npm-debug.log*
|
|
yarn-debug.log*
|
|
yarn-error.log*
|
|
pnpm-debug.log*
|
|
lerna-debug.log*
|
|
|
|
node_modules
|
|
dist
|
|
dist-ssr
|
|
*.local
|
|
|
|
# Playwright output
|
|
.playwright-mcp/
|
|
|
|
# Private / not for public repo
|
|
OPENSATS_APPLICATION.md
|
|
test/accounts.json
|
|
|
|
# Editor directories and files
|
|
.vscode/*
|
|
!.vscode/extensions.json
|
|
.idea
|
|
.DS_Store
|
|
*.suo
|
|
*.ntvs*
|
|
*.njsproj
|
|
*.sln
|
|
*.sw?
|