Currently, when loading messages from the sqlite db, the min Id of the currently loaded messages are used to determine the "before date" – the date that must come after the display date of all messages to be loaded.
However, when the displayDate != createdAt on a message (e.g. an ohai date is used), the min id may correspond to a message with a display date that is after a message with a greater id. I think.
Perhaps the solution is to always keep the min display date in memory and query that way?
AATTMinMaxPair now holds dates and message ids. Message ids are used for fetching, and dates are used for loading from database. Fixed in 3bdfe0e87c3fcf578acbc017f3d56d217696106f
Currently, when loading messages from the sqlite db, the min Id of the currently loaded messages are used to determine the "before date" – the date that must come after the display date of all messages to be loaded.
However, when the displayDate != createdAt on a message (e.g. an ohai date is used), the min id may correspond to a message with a display date that is after a message with a greater id. I think.
Perhaps the solution is to always keep the min display date in memory and query that way?