d8386b5f76c4783c17208f2023eeafdf60ab472d
This addresses the issue where entering a chat page would only display recent websocket messages, swallowing historical messages. The fix implements a proper hydration pipeline in MessageSyncService that: 1. Tracks hydrated state per conversation via `hydratedConversations` Set 2. Unhydrated conversations run full pipeline: local contiguous range check, incremental sync above maxSeq, gap fill below minSeq, mark hydrated 3. Hydrated conversations only do lightweight incremental sync using trusted baseline 4. Clear conversation now also clears in-memory state and hydrated flag Also adds: - `getContiguousRange()` method to find local message continuity gaps - `MESSAGES_PAGE_SIZE` (20) and `MAX_GAP_FILL_ROUNDS` (5) constants - Test mocks with configurable state for hydration scenarios - `messageHydration.test.ts` unit tests
Description
No description provided
Languages
TypeScript
99.9%
JavaScript
0.1%