Question
onSync not chronological
I've set up a basic chat app. I'm adding a new property for
each message to a persistent remote SO called "chat_so". A message
consists of a few sub properties(icon, color), as well as the
message text. (The project requires each message to have these
properties unique.) When a new user logs on, all the messages are
successfully fetched by the onSync. However, the order of the
properties is not chronological. Its almost like its in
chronological chunks, but mixed together randomly. I haven't been
able to dertimine any pattern in the chunks that are together(ie if
they are all from the same user, etc). In my onSync I'm looping
through from the first property to the last property.
What is the solution here to ensure that the message history is fetched in chronological order? I could put all the messages in an Array, but then each new message would require the entire message history to be re-downloaded, and I'll get write concurrency problems, as pointed out to me in another thread.
What is the solution here to ensure that the message history is fetched in chronological order? I could put all the messages in an Array, but then each new message would require the entire message history to be re-downloaded, and I'll get write concurrency problems, as pointed out to me in another thread.
