mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-14 23:35:31 +00:00
sort by doc_id to ensure consistent order for all changes with the same timestamp
This commit is contained in:
parent
7d6811559c
commit
92e67511d5
1 changed files with 6 additions and 1 deletions
|
@ -158,7 +158,12 @@ module.exports = MongoPackManager =
|
|||
return true
|
||||
|
||||
timeOrder = (a, b) ->
|
||||
b.meta.end_ts - a.meta.end_ts
|
||||
(b.meta.end_ts - a.meta.end_ts) || documentOrder(a, b)
|
||||
|
||||
documentOrder = (a, b) ->
|
||||
x = a.doc_id.valueOf()
|
||||
y = b.doc_id.valueOf()
|
||||
if x > y then 1 else if x < y then -1 else 0
|
||||
|
||||
updates = MongoPackManager._filterAndLimit(updates, unpackedSet, filterFn, limit)
|
||||
#console.log 'initial updates are', updates
|
||||
|
|
Loading…
Add table
Reference in a new issue