rrbrambley / MessageBeast-ObjC

A library for building Message-based apps on App.net
MIT License
6 stars 0 forks source link

Using MinMaxPair.minId to load messages from DB is wrong #3

Closed rrbrambley closed 10 years ago

rrbrambley commented 10 years ago

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?

rrbrambley commented 10 years ago

AATTMinMaxPair now holds dates and message ids. Message ids are used for fetching, and dates are used for loading from database. Fixed in 3bdfe0e87c3fcf578acbc017f3d56d217696106f