Paint the last-known library on cold start #2
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/local-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Item 2 of the speed lane. Stacked on #1.
Bookmarks, highlights and lists were memory only —
StashPreferencespersisted identity, relays, last shared page and recent hashtags and nothing else. So launching the app showed an empty screen until a relay answered, and offline showed nothing ever.Design
EventCachestores raw event JSON, not parsed bookmarks, and reads it back through exactly the samemap/finisha fetch uses. A cached row therefore cannot drift from a fetched one, and the cache never has to learn what a bookmark is — which is also why it is testable on the JVM with no Android and no rust-nostr.writerefuses an entry containing a raw newline rather than let one event silently become two broken rowsfilesDir, notcacheDir: Android may evictcacheDirunder storage pressure, and the entire point is that it survives to the next launchOne thing deliberately left alone:
bookmarkEvidence/CompanionGateis not satisfied by a cache read. The gate exists because an unloaded list is indistinguishable from an empty one, and a cached list is exactly that — so it still waits for a real fetch.Testing
ColdStartCacheE2ETestdrives the real Activity: first launch against a healthy relay, second launch with only a relay that answers nothing. Anything on screen came off the disk, asserted within 4s —FETCH_TIMEOUTalone is 12s.That test was written after the wiring, so I proved it can fail rather than assuming: removing the cold-start paint (1+/7−, verified landed) fails it, while the empty-state control correctly keeps passing.