Skip to content

Commit

Permalink
[desk-tool] Properly paginate through history
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr authored and rexxars committed Oct 6, 2020
1 parent 144b1e4 commit 3af46a2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class Controller {

let queryParams = `effectFormat=mendoza&excludeContent=true&excludeMutations=true&includeIdentifiedDocumentsOnly=true&reverse=true&limit=${limit}`
if (this._earliestTransactionId) {
queryParams += `&fromTransaction=${this._earliestTransactionId}`
queryParams += `&toTransaction=${this._earliestTransactionId}`
}

const url = `/data/history/${dataset}/transactions/${publishedId},${draftId}?${queryParams}`
Expand All @@ -117,6 +117,11 @@ export class Controller {

count++

if (result.value.id === this._earliestTransactionId) {
// toTransaction is inclusive so we must ignore it when we fetch the next page
continue
}

this.timeline.addTranslogEntry(result.value)
this._earliestTransactionId = result.value.id
}
Expand Down

0 comments on commit 3af46a2

Please sign in to comment.