Skip to content

Cache-first seeding and paging #58

Description

@zealsprince

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clientClient apps: UI, platform adapters, cache, PWA

    Fields

    Start date

    None yet

    Target date

    None yet

    Size

    None yet

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions