Fix bug loading conversation upsidedown

Sometimes a conversation's messages would be reverse-ordered on first
load, correcting themselves after a refresh. This is an artifact of the
order we load messages from the database. To fix, load them in the
opposite order.

The alternative solution would be to reset the collection every time we
fetch new messages, but this would create an entirely new set of model
objects each time, which seems unnecessary.
pull/749/head
lilia 10 years ago
parent 296dae544d
commit 1bdb42b67e

@ -72,8 +72,7 @@
// 'conversation' index on [conversationId, received_at]
name : 'conversation',
lower : [conversationId],
upper : [conversationId, Number.MAX_VALUE],
order : 'desc'
upper : [conversationId, Number.MAX_VALUE]
// SELECT messages WHERE conversationId = this.id ORDER
// received_at DESC
};

Loading…
Cancel
Save