mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
Concord fetched a channel's messages only when its screen was open (the history pager mounts on the channel screen), so an un-opened channel showed "No messages yet" in the community list and never appeared in the Messages inbox — unlike NIP-28 / NIP-29, which preload a last-message per room. Add a one-shot warm drain, `Account.warmConcordChannelPreviews`, triggered on community-screen open and app-wide per subscribed community from the account preload (both debounced so the cold-boot fold burst warms once). Per channel (`ConcordSubscriptionPlanner.channelPreviewFilters`): - never read -> the newest `previewLimit` (10) wraps: a preview plus a rough sense of how busy the channel is, without pulling the whole backlog. - read -> everything `since lastRead - 1` (capped at `catchUpLimit`): the unread badge is accurate and the missed messages are cached for on-open; the `-1` re-includes the last-read message (its created_at == lastRead) so a caught-up channel still shows a preview, and unread stays exact (the count is strict `>`). Filters group by relay into one REQ per relay (one filter per channel); the wraps ingest through the normal cache path, and the always-on plane subscription keeps them fresh afterward. Full history still pages in on open. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>