Problem
In src/reconnect.js, missed messages are fetched with a hardcoded page 1, limit 100:
const { messages } = getRoomMessages(roomId, 1, 100)
missedMessages[roomId] = messages.filter(m => new Date(m.createdAt) > since)
If more than 100 messages were sent to a room while the user was disconnected, only the first 100 are checked. Messages beyond that are silently lost.
Expected behavior
rejoinRooms() should return all messages sent since the given timestamp, regardless of count.
Fix
Paginate through all messages until no more remain past the since timestamp, or fetch all messages for the room and filter:
const allMessages = getRoomMessages(roomId, 1, Infinity) // or paginate
missedMessages[roomId] = allMessages.messages.filter(m => new Date(m.createdAt) > since)
A cleaner fix would be to add an internal getMessagesSince(roomId, since) function to messages.js that does a single filtered pass over the in-memory array.
Files
src/reconnect.js — line 37
src/messages.js — candidate location for a getMessagesSince() helper
Problem
In
src/reconnect.js, missed messages are fetched with a hardcoded page 1, limit 100:If more than 100 messages were sent to a room while the user was disconnected, only the first 100 are checked. Messages beyond that are silently lost.
Expected behavior
rejoinRooms()should return all messages sent since the given timestamp, regardless of count.Fix
Paginate through all messages until no more remain past the
sincetimestamp, or fetch all messages for the room and filter:A cleaner fix would be to add an internal
getMessagesSince(roomId, since)function tomessages.jsthat does a single filtered pass over the in-memory array.Files
src/reconnect.js— line 37src/messages.js— candidate location for agetMessagesSince()helper