mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 00:16:59 +00:00
Every widen re-requested the whole DM window (the filters carried `since` only, no `until`), so a relay re-streamed the entire history from the new floor — a few pixels of scroll walked the window to the 10-year backstop, re-downloading exponentially more each step (589 → 1486 → 2609 events in one session). This splits each DM protocol into two responsibilities: - Live tail (existing managers, now fixed): a one-week floor with no `until`, always open to the future. Never widens, so new messages keep arriving. - History slices (new managers): load the past in bounded `since`+`until` one-shot slices. Widening fetches only the new band `[newFloor, prevFloor]`; consecutive slices are disjoint so advancing the filter never re-streams an earlier slice — they live in the cache. The NIP-17 2-day wrapper-timestamp margin is applied to the slice `since`, overlapping adjacent slices so a randomized outer timestamp can't open a gap. NIP-04 (exact timestamps) needs no margin. New: AccountGiftWrapsHistoryEoseManager owns the geometric window and the bounded slices; ChatroomListNip04HistorySubAssembler / ChatroomNip04History- SubAssembler follow its slice bounds so both protocols page to the same depth. The live managers (AccountGiftWrapsEoseManager and the NIP-04 followers) are reduced to the fixed one-week tail. Also adds the rooms-list stall-gate: the auto-fill remembers the private-room count at the last widen (on the history manager, so it survives reopening the screen) and stops widening once a step brings in no new private room — widening pulls older messages, not rooms, so a few busy correspondents would otherwise flood events without ever filling the list. "Fill until full OR nothing new found", instead of walking to the 10-year backstop. Design: amethyst/plans/2026-06-01-dm-live-tail-and-history-slices.md https://claude.ai/code/session_01B1fmmmX8JjQWH3amMLdvcW