Fix the ordering in rageshakes (#12020)

* Fix the ordering in rageshakes

Fixes https://github.com/vector-im/element-web/issues/26715

* Update src/rageshake/rageshake.ts

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Richard van der Hoff 2023-12-08 22:03:23 +00:00 committed by GitHub
parent 75500b606e
commit db24a041aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -385,7 +385,8 @@ export class IndexedDBLogStore {
return;
}
const newLines = cursor.value.lines;
lines += newLines;
// The query returns log chunks in reverse time order, so prepend this new chunk to the buffer.
lines = newLines + lines;
sizeSoFar += newLines.length;
// If we have now exceeded the size limit, stop.