mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Pop last version, not last timestamp
This commit is contained in:
parent
b45db3aa2b
commit
866084ee6b
2 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ module.exports = MongoManager =
|
|||
getLastCompressedUpdate: (doc_id, callback = (error, update) ->) ->
|
||||
db.docHistory
|
||||
.find(doc_id: ObjectId(doc_id.toString()))
|
||||
.sort( "meta.end_ts": -1)
|
||||
.sort( v: -1 )
|
||||
.limit(1)
|
||||
.toArray (error, compressedUpdates) ->
|
||||
return callback(error) if error?
|
||||
|
|
|
@ -34,9 +34,9 @@ describe "MongoManager", ->
|
|||
.calledWith(1)
|
||||
.should.equal true
|
||||
|
||||
it "should sort in descending timestamp order", ->
|
||||
it "should sort in descending version order", ->
|
||||
@db.docHistory.sort
|
||||
.calledWith("meta.end_ts": -1)
|
||||
.calledWith(v: -1)
|
||||
.should.equal true
|
||||
|
||||
it "should call the call back with the update", ->
|
||||
|
|
Loading…
Reference in a new issue