mirror of
https://github.com/hoornet/vega.git
synced 2026-06-13 08:23:31 -07:00
fdb7aab9d1
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>
47 lines
1.1 KiB
JSON
47 lines
1.1 KiB
JSON
{
|
|
"$schema": "https://schema.tauri.app/config/2",
|
|
"productName": "Wrystr",
|
|
"version": "0.1.9",
|
|
"identifier": "com.hoornet.wrystr",
|
|
"build": {
|
|
"beforeDevCommand": "npm run dev",
|
|
"devUrl": "http://localhost:1420",
|
|
"beforeBuildCommand": "npm run build",
|
|
"frontendDist": "../dist"
|
|
},
|
|
"app": {
|
|
"windows": [
|
|
{
|
|
"title": "Wrystr",
|
|
"width": 1200,
|
|
"height": 800,
|
|
"minWidth": 900,
|
|
"minHeight": 600
|
|
}
|
|
],
|
|
"security": {
|
|
"csp": null
|
|
}
|
|
},
|
|
"bundle": {
|
|
"active": true,
|
|
"targets": ["deb", "rpm", "nsis", "msi", "dmg"],
|
|
"icon": [
|
|
"icons/32x32.png",
|
|
"icons/128x128.png",
|
|
"icons/128x128@2x.png",
|
|
"icons/icon.icns",
|
|
"icons/icon.ico"
|
|
]
|
|
},
|
|
"plugins": {
|
|
"updater": {
|
|
"endpoints": [
|
|
"https://github.com/hoornet/wrystr/releases/latest/download/latest.json"
|
|
],
|
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDIwODYwNENEMjY2NEFCQkYKUldTL3EyUW16UVNHSUk2VXg5WXVZcDF2WUVFOU9kUWgyNjRsQzdoYjdwS0dra1VyUnhVK1EyY20K",
|
|
"dialog": false
|
|
}
|
|
}
|
|
}
|