Skip to content

Cache message history locally #53

Description

@ih8js-git

Problem Description

Currently, vimstoat only caches User objects in the local cache.db (CacheStore). Message history is not cached anywhere on disk:

  1. Opening a DM channel triggers a fresh network call to fetch up to 50 messages via fetch_message_history.
  2. Loaded messages and live WebSocket message events (new messages, edits, deletes) are stored solely in memory in app.store.current_dm_messages: Vec<Message>.
  3. Navigating between channels or restarting the app discards message history, requiring full re-fetching over the network each time.

Proposed Solution

  • Persist messages locally (e.g. keyed by channel_id + message ID or in an indexed structure per channel in CacheStore).
  • Hydrate channel messages instantly from local cache when entering a channel.
  • Fetch newer/missing messages from the API to sync and update the cache.
  • Ensure WebSocket updates (edits, deletions) write through or invalidate the cache accordingly.

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

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions