pending events are not certain to be sorted here

This commit is contained in:
Bruno Windels 2019-07-29 09:54:34 +02:00
parent 3ed72df620
commit b26f7df689
2 changed files with 5 additions and 1 deletions

View file

@ -18,7 +18,7 @@ export default class SendQueue {
if (pendingEvents.length) {
console.info(`SendQueue for room ${roomId} has ${pendingEvents.length} pending events`, pendingEvents);
}
this._pendingEvents.setManySorted(pendingEvents.map(data => new PendingEvent(data)));
this._pendingEvents.setManyUnsorted(pendingEvents.map(data => new PendingEvent(data)));
this._isSending = false;
this._offline = false;
this._amountSent = 0;

View file

@ -8,6 +8,10 @@ export default class SortedArray extends BaseObservableList {
this._items = [];
}
setManyUnsorted(items) {
this.setManySorted(items);
}
setManySorted(items) {
// TODO: we can make this way faster by only looking up the first and last key,
// and merging whatever is inbetween with items