The data path that makes the cache visible: today every channel open waits on the network. Wire the spec's flow: on open, render the newest CACHE_SEED_COUNT from cache immediately, then fetch only the delta after the cached tip and reconcile. Scroll-up pages from cache until exhausted, then CHATHISTORY BEFORE the oldest cached msgid, writing pages back. Forward paging with the tailTrimmed flag keeps the live window bounded both directions.
Spec
Acceptance criteria
- A cached channel paints from disk without a network wait, then converges with the server delta
- A cold channel falls back to a normal chathistory seed and populates the cache
- Scroll-up serves cache pages until exhausted, then fetches BEFORE and caches the result so the next scroll is local
- Scrolling back down after deep scrollback restores newer messages from cache without refetching
- The live window never exceeds
MAX_LIVE_MESSAGES regardless of scroll depth
Blocked by the IndexedDB adapter and writer tickets in this epic, and #33.
The data path that makes the cache visible: today every channel open waits on the network. Wire the spec's flow: on open, render the newest
CACHE_SEED_COUNTfrom cache immediately, then fetch only the delta after the cached tip and reconcile. Scroll-up pages from cache until exhausted, thenCHATHISTORY BEFOREthe oldest cached msgid, writing pages back. Forward paging with thetailTrimmedflag keeps the live window bounded both directions.Spec
Acceptance criteria
MAX_LIVE_MESSAGESregardless of scroll depthBlocked by the IndexedDB adapter and writer tickets in this epic, and #33.