mirror of
https://github.com/hoornet/vega.git
synced 2026-04-24 14:50:00 -07:00
- Rust: rusqlite (bundled) with WAL mode; wrystr.db in app data dir - db_save_notes: upsert batch of raw event JSON, prune to 500 kind-1 notes - db_load_feed: return N most-recent kind-1 raws for instant startup display - db_save_profile / db_load_profile: cache NDKUserProfile JSON by pubkey - Falls back to in-memory SQLite if the on-disk open fails - src/lib/db.ts: typed invoke wrappers; all errors silenced (cache is best-effort) - feed store: loadCachedFeed() populates notes before relay connects; loadFeed() merges fresh+cached (so relay returning fewer notes doesn't erase cached ones), then saves fresh notes to SQLite - useProfile: reads SQLite cache to show avatar/name instantly while relay request is in-flight; saves result to SQLite after relay responds - Feed: calls loadCachedFeed() first → notes visible before relay connects Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>